#include #include using namespace std; using namespace atcoder; using ll = long long; using ld = long double; int N, M, X[1010], Y[1010]; int main() { cin >> N >> M; for (int i = 0; i < N; i++) cin >> X[i]; for (int i = 0; i < M; i++) cin >> Y[i]; sort(Y, Y + M); for (int i = 0; i < N; i++) { int pos = lower_bound(Y, Y + M, X[i]) - Y; if (pos == M) cout << "Infinity" << endl; else cout << Y[pos] - X[i] << endl; } return 0; }