#include <iostream>
#include <cmath>
using namespace std;
int main()
{
int a1, a2, a3, b1, b2, b3, x;
cin >> a1 >> b1 >> a2 >> b2 >> a3 >> b3 >> x;
int s1 = (x / b1 + 1) * a1;
int s2 = (x / b2 + 1) * a2;
int s3 = (x / b3 + 1) * a3;
int mx = max(max(s1, s2), s3);
if (s1 == mx)
cout << 1 << endl;
else if (s2 == mx)
cout << 2 << endl;
else if (s3 == mx)
cout << 3 << endl;
}