You've got a rectangular parallelepiped with integer edge lengths. You know the areas of its three faces that have a common vertex. Your task is to find the sum of lengths of all 12 edges of this parallelepiped.
The first and the single line contains three space-separated integers — the areas of the parallelepiped's faces. The area's values are positive ( &gt; 0) and do not exceed 10<sup class="upper-index">4</sup>. It is guaranteed that there exists at least one parallelepiped that satisfies the problem statement.
#include <bits/stdc++.h>
#define ll long long int
#define MAX(a,b) (a>b?a:b)
#define MIN(a,b) (a>b?b:a)
#define IOS ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
#define loop1(start,end,step) for(ll i=start;i<end;i+=step)
#define loop2(start,end,step) for(ll j=start;j<end;j+=step)
#define ISEVEN(n) ((n%2== 0) ? 1 : 0)
#define ISODD(n) ((n%2!= 0) ? 1 : 0)
#define MOD 1000000007
#define ACCEPT(nos,n) for(int i=0;i<n;i++) cin>>nos[i];
#define printArray(nos,n) for(int i=0;i<n;i++) cout<<nos[i]<<' '; cout<<endl;

using namespace std;


void solve(ll caseNo)
{
	ll n;
	cin>>n;

	ll nos[7];
	ACCEPT(nos, 7);
	
	ll count=0,ans;
	for (int i = 0; i < 7; i++)
    {
        count += nos[i];
        if (count >= n)
        {
            ans = i + 1;
            break;
        }
        if(i==6)
            i=-1;
    }
 
    cout << ans;



} 
	
int main()
{
	#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
	#endif
	
	IOS
	int t=1;
	// cin>>t;
	ll temp=1;

	while(t--)
	{
		solve(temp);
		temp++;
		
	}
	return 0;
}