#include using namespace std; int main () { int N, M; cin >> N >> M; vector> A; vector X; for (int i = 0; i < N; i ++) { cin >> X[i]; A.emplace_back(X[i], i); } for (int i = 0; i < M; i ++) { int a; cin >> a; A.emplace_back(a, -1); } sort(A.begin(), A.end()); vector ans(N, -1); queue que; for (auto [a, i] : A) { if (i == -1) { while (!que.empty()) { ans[que.front()] = a - X[que.front()]; que.pop(); } } else { que.push(i); } } for (int a : ans) { if (a == -1) { cout << "Infinity"; } else { cout << a << endl; } } }