#include <bits/stdc++.h>
using namespace std;
pair<int,int> solve(vector<int>& A, vector<int>& B) {
pair<int,int> result;
int minimumAbsoluteValue = INT_MAX;
for(int i = 0; i < A.size(); i++) {
for(int j = 0; j < B.size(); j++) {
if(minimumAbsoluteValue > abs(A[i] + B[j])) {
minimumAbsoluteValue = abs(A[i] + B[j]);
result.first = i + 1;
result.second = j + 1;
}
}
}
return result;
}
int main() {
int m, n; cin >> m >> n;
vector<int> A(m);
vector<int> B(n);
for(int& x : A) cin >> x;
for(int& x : B) cin >> x;
pair<int, int> res = solve(A, B);
cout << res.first << " " << res.second;
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgpwYWlyPGludCxpbnQ+IHNvbHZlKHZlY3RvcjxpbnQ+JiBBLCB2ZWN0b3I8aW50PiYgQikgewogICAgcGFpcjxpbnQsaW50PiByZXN1bHQ7CiAgICBpbnQgbWluaW11bUFic29sdXRlVmFsdWUgPSBJTlRfTUFYOwogICAgZm9yKGludCBpID0gMDsgaSA8IEEuc2l6ZSgpOyBpKyspIHsKICAgICAgICBmb3IoaW50IGogPSAwOyBqIDwgQi5zaXplKCk7IGorKykgewogICAgICAgICAgICBpZihtaW5pbXVtQWJzb2x1dGVWYWx1ZSA+IGFicyhBW2ldICsgQltqXSkpIHsKICAgICAgICAgICAgICAgIG1pbmltdW1BYnNvbHV0ZVZhbHVlID0gYWJzKEFbaV0gKyBCW2pdKTsKICAgICAgICAgICAgICAgIHJlc3VsdC5maXJzdCA9IGkgKyAxOwogICAgICAgICAgICAgICAgcmVzdWx0LnNlY29uZCA9IGogKyAxOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgfQogICAgcmV0dXJuIHJlc3VsdDsKfQoKaW50IG1haW4oKSB7CglpbnQgbSwgbjsgY2luID4+IG0gPj4gbjsKCXZlY3RvcjxpbnQ+IEEobSk7Cgl2ZWN0b3I8aW50PiBCKG4pOwoJCglmb3IoaW50JiB4IDogQSkgY2luID4+IHg7Cglmb3IoaW50JiB4IDogQikgY2luID4+IHg7CgkKCXBhaXI8aW50LCBpbnQ+IHJlcyA9IHNvbHZlKEEsIEIpOwoJY291dCA8PCByZXMuZmlyc3QgPDwgIiAiIDw8IHJlcy5zZWNvbmQ7CgkKCQoJcmV0dXJuIDA7Cn0=