#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;
int n = B.size();
vector<pair<int,int>> sortedB;
for(int i = 0; i < n; i++) {
sortedB.push_back({B[i], i});
}
sort(sortedB.begin(), sortedB.end());
for(int i = 0; i < A.size(); i++) {
int lower = lower_bound(sortedB.begin(), sortedB.end(), make_pair(-A[i], INT_MIN)) - sortedB.begin();
// break;
if(lower != n) {
int absoluteValue = abs(A[i] + sortedB[lower].first);
if(absoluteValue < minimumAbsoluteValue) {
minimumAbsoluteValue = absoluteValue;
result.first = i + 1;
result.second = sortedB[lower].second + 1;
}
}
if(lower != 0) {
lower--;
int absoluteValue = abs(A[i] + sortedB[lower].first);
if(absoluteValue < minimumAbsoluteValue) {
minimumAbsoluteValue = absoluteValue;
result.first = i + 1;
result.second = sortedB[lower].second + 1;
}
}
// cout << minimumAbsoluteValue << endl;
}
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+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgpwYWlyPGludCwgaW50PiBzb2x2ZSh2ZWN0b3I8aW50PiYgQSwgdmVjdG9yPGludD4mIEIpIHsKICAgIHBhaXI8aW50LCBpbnQ+IHJlc3VsdDsKICAgIGludCBtaW5pbXVtQWJzb2x1dGVWYWx1ZSA9IElOVF9NQVg7CgogICAgaW50IG4gPSBCLnNpemUoKTsKICAgIHZlY3RvcjxwYWlyPGludCxpbnQ+PiBzb3J0ZWRCOwogICAgZm9yKGludCBpID0gMDsgaSA8IG47IGkrKykgewogICAgICAgIHNvcnRlZEIucHVzaF9iYWNrKHtCW2ldLCBpfSk7CiAgICB9CgogICAgc29ydChzb3J0ZWRCLmJlZ2luKCksIHNvcnRlZEIuZW5kKCkpOwoKICAgIGZvcihpbnQgaSA9IDA7IGkgPCBBLnNpemUoKTsgaSsrKSB7CiAgICAgICAgaW50IGxvd2VyID0gbG93ZXJfYm91bmQoc29ydGVkQi5iZWdpbigpLCBzb3J0ZWRCLmVuZCgpLCBtYWtlX3BhaXIoLUFbaV0sIElOVF9NSU4pKSAtIHNvcnRlZEIuYmVnaW4oKTsKICAgICAgICAvLyBicmVhazsKICAgICAgICBpZihsb3dlciAhPSBuKSB7CiAgICAgICAgICAgIGludCBhYnNvbHV0ZVZhbHVlID0gYWJzKEFbaV0gKyBzb3J0ZWRCW2xvd2VyXS5maXJzdCk7CiAgICAgICAgICAgIGlmKGFic29sdXRlVmFsdWUgPCBtaW5pbXVtQWJzb2x1dGVWYWx1ZSkgewogICAgICAgICAgICAgICAgbWluaW11bUFic29sdXRlVmFsdWUgPSBhYnNvbHV0ZVZhbHVlOwogICAgICAgICAgICAgICAgcmVzdWx0LmZpcnN0ID0gaSArIDE7CiAgICAgICAgICAgICAgICByZXN1bHQuc2Vjb25kID0gc29ydGVkQltsb3dlcl0uc2Vjb25kICsgMTsKICAgICAgICAgICAgfQogICAgICAgIH0KICAgICAgICBpZihsb3dlciAhPSAwKSB7CiAgICAgICAgICAgIGxvd2VyLS07CiAgICAgICAgICAgIGludCBhYnNvbHV0ZVZhbHVlID0gYWJzKEFbaV0gKyBzb3J0ZWRCW2xvd2VyXS5maXJzdCk7CiAgICAgICAgICAgIGlmKGFic29sdXRlVmFsdWUgPCBtaW5pbXVtQWJzb2x1dGVWYWx1ZSkgewogICAgICAgICAgICAgICAgbWluaW11bUFic29sdXRlVmFsdWUgPSBhYnNvbHV0ZVZhbHVlOwogICAgICAgICAgICAgICAgcmVzdWx0LmZpcnN0ID0gaSArIDE7CiAgICAgICAgICAgICAgICByZXN1bHQuc2Vjb25kID0gc29ydGVkQltsb3dlcl0uc2Vjb25kICsgMTsKICAgICAgICAgICAgfQogICAgICAgIH0KCiAgICAgICAgLy8gY291dCA8PCBtaW5pbXVtQWJzb2x1dGVWYWx1ZSA8PCBlbmRsOwogICAgfQoKICAgIHJldHVybiByZXN1bHQ7Cn0KCmludCBtYWluKCkgewoJaW50IG0sIG47IGNpbiA+PiBtID4+IG47Cgl2ZWN0b3I8aW50PiBBKG0pOwoJdmVjdG9yPGludD4gQihuKTsKIAoJZm9yKGludCYgeCA6IEEpIGNpbiA+PiB4OwoJZm9yKGludCYgeCA6IEIpIGNpbiA+PiB4OwogCglwYWlyPGludCwgaW50PiByZXMgPSBzb2x2ZShBLCBCKTsKCWNvdXQgPDwgcmVzLmZpcnN0IDw8ICIgIiA8PCByZXMuc2Vjb25kOwoJCglyZXR1cm4gMDsKfQ==