#include #include #include #include #include using namespace std; int main() { int N, M; cin >> N >> M; vector X(N), Y(M); for (int i = 0; i < N; ++i) { cin >> X[i]; } for (int i = 0; i < M; ++i) { cin >> Y[i]; } for (int i = 0; i < N; ++i) { int ptr = lower_bound(Y.begin(), Y.end(), X[i]) - Y.begin(); if (ptr != M) cout << Y[ptr] - X[i] << endl; else cout << "Infinity" << endl; } return 0; }