#include <iostream>
#include <vector>
#include <utility>
#include <algorithm>
#include <cmath>
using namespace std;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
int m, n;
cin >> m >> n;
// Đọc dãy A và B
vector<pair<long long, int>> a(m), b(n);
for (int i = 0; i < m; i++) {
cin >> a[i].first;
a[i].second = i + 1; // Lưu chỉ số ban đầu
}
for (int i = 0; i < n; i++) {
cin >> b[i].first;
b[i].second = i + 1; // Lưu chỉ số ban đầu
}
// Sắp xếp cả hai dãy
sort(a.begin(), a.end());
sort(b.begin(), b.end());
long long min_absolute_sum = (long long)1e18; // Giá trị nhỏ nhất
int pos_a = -1, pos_b = -1; // Lưu chỉ số kết quả
// Tìm cặp tối ưu
for (int i = 0; i < m; ++i) {
long long target = -a[i].first; // Tìm giá trị gần 0 nhất
int pos = lower_bound(b.begin(), b.end(), make_pair(target, 0)) - b.begin();
int prev_pos = pos - 1;
// Kiểm tra phần tử tại `pos`
if (pos < n) {
long long cur_sum = abs(a[i].first + b[pos].first);
if (cur_sum < min_absolute_sum) {
min_absolute_sum = cur_sum;
pos_a = a[i].second;
pos_b = b[pos].second;
}
}
// Kiểm tra phần tử trước `pos`
if (prev_pos >= 0) {
long long cur_sum = abs(a[i].first + b[prev_pos].first);
if (cur_sum < min_absolute_sum) {
min_absolute_sum = cur_sum;
pos_a = a[i].second;
pos_b = b[prev_pos].second;
}
}
}
// In kết quả
cout << pos_a << " " << pos_b << endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8dmVjdG9yPgojaW5jbHVkZSA8dXRpbGl0eT4KI2luY2x1ZGUgPGFsZ29yaXRobT4KI2luY2x1ZGUgPGNtYXRoPgoKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmludCBtYWluKCkgewogICAgaW9zX2Jhc2U6OnN5bmNfd2l0aF9zdGRpbygwKTsKICAgIGNpbi50aWUoMCk7CgogICAgaW50IG0sIG47CiAgICBjaW4gPj4gbSA+PiBuOwoKICAgIC8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HJhIHBo4bqnbiB04butIHThuqFpIGBwb3NgCiAgICAgICAgaWYgKHBvcyA8IG4pIHsKICAgICAgICAgICAgbG9uZyBsb25nIGN1cl9zdW0gPSBhYnMoYVtpXS5maXJzdCArIGJbcG9zXS5maXJzdCk7CiAgICAgICAgICAgIGlmIChjdXJfc3VtIDwgbWluX2Fic29sdXRlX3N1bSkgewogICAgICAgICAgICAgICAgbWluX2Fic29sdXRlX3N1bSA9IGN1cl9zdW07CiAgICAgICAgICAgICAgICBwb3NfYSA9IGFbaV0uc2Vjb25kOwogICAgICAgICAgICAgICAgcG9zX2IgPSBiW3Bvc10uc2Vjb25kOwogICAgICAgICAgICB9CiAgICAgICAgfQoKICAgICAgICAvLyBLaeG7g20gdHJhIHBo4bqnbiB04butIHRyxrDhu5tjIGBwb3NgCiAgICAgICAgaWYgKHByZXZfcG9zID49IDApIHsKICAgICAgICAgICAgbG9uZyBsb25nIGN1cl9zdW0gPSBhYnMoYVtpXS5maXJzdCArIGJbcHJldl9wb3NdLmZpcnN0KTsKICAgICAgICAgICAgaWYgKGN1cl9zdW0gPCBtaW5fYWJzb2x1dGVfc3VtKSB7CiAgICAgICAgICAgICAgICBtaW5fYWJzb2x1dGVfc3VtID0gY3VyX3N1bTsKICAgICAgICAgICAgICAgIHBvc19hID0gYVtpXS5zZWNvbmQ7CiAgICAgICAgICAgICAgICBwb3NfYiA9IGJbcHJldl9wb3NdLnNlY29uZDsKICAgICAgICAgICAgfQogICAgICAgIH0KICAgIH0KCiAgICAvLyBJbiBr4bq/dCBxdeG6owogICAgY291dCA8PCBwb3NfYSA8PCAiICIgPDwgcG9zX2IgPDwgZW5kbDsKCiAgICByZXR1cm4gMDsKfQ==