#include <iostream>
#include <vector>
typedef long long ll;
int main() {
int n; std::cin >> n;
std::vector<int> t(n), a(n);
for (auto& it : t) std::cin >> it;
for (auto& it : a) std::cin >> it;
int imin = -1; ll minsum = ll(1e18);
for (int i = 0; i < n; ++i) {
ll temp = ll(a[i]+1)*t[i];
if (temp < minsum || (temp == minsum && a[imin] > a[i])) {
minsum = temp;
imin = i;
}
}
std::cout << imin+1;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8dmVjdG9yPgoKdHlwZWRlZiBsb25nIGxvbmcgbGw7CgppbnQgbWFpbigpIHsKICAgIGludCBuOyBzdGQ6OmNpbiA+PiBuOwogICAgc3RkOjp2ZWN0b3I8aW50PiB0KG4pLCBhKG4pOwogICAgZm9yIChhdXRvJiBpdCA6IHQpIHN0ZDo6Y2luID4+IGl0OwogICAgZm9yIChhdXRvJiBpdCA6IGEpIHN0ZDo6Y2luID4+IGl0OwogICAgaW50IGltaW4gPSAtMTsgbGwgbWluc3VtID0gbGwoMWUxOCk7CiAgICBmb3IgKGludCBpID0gMDsgaSA8IG47ICsraSkgewogICAgICAgIGxsIHRlbXAgPSBsbChhW2ldKzEpKnRbaV07CiAgICAgICAgaWYgKHRlbXAgPCBtaW5zdW0gfHwgKHRlbXAgPT0gbWluc3VtICYmIGFbaW1pbl0gPiBhW2ldKSkgewogICAgICAgICAgICBtaW5zdW0gPSB0ZW1wOwogICAgICAgICAgICBpbWluID0gaTsKICAgICAgICB9CiAgICB9CiAgICBzdGQ6OmNvdXQgPDwgaW1pbisxOwogICAgcmV0dXJuIDA7Cn0=