import sys input = sys.stdin.readline from collections import * from bisect import * N, M = map(int, input().split()) X = list(map(int, input().split())) Y = list(map(int, input().split())) Y.sort() for Xi in X: if Xi>Y[-1]: print('Infinity') else: idx = bisect_left(Y, Xi) print(Y[idx]-Xi)