#include using namespace std; int main() { int N, M; cin >> N >> M; vector X(N); vector Y(M); for(int i = 0; i < N; i++) cin >> X.at(i); for(int i = 0; i < M; i++) cin >> Y.at(i); sort(Y.begin(), Y.end()); for(int i = 0; i < N; i++) { auto iter = upper_bound(Y.begin(), Y.end(), X.at(i)); if(iter - Y.begin() == M) cout << "Infinity" << endl; else cout << *iter - X.at(i) << endl; } return 0; }