#include using namespace std; using ll = long long; const ll MOD = 1000000007; using P = pair; #define rep(i, n) for(int i = 0; i < n; i++) #define all(x) (x).begin(),(x).end() int main(){ int n,m; cin >> n >> m; vector y(m+1),x(n); rep(i,n) cin >> x[i]; rep(i,m) cin >> y[i]; y[m] = MOD;sort(all(y)); rep(i,n){ int z = *lower_bound(all(y),x[i]); if(z==MOD) cout << "Infinity" << endl; else cout << z-x[i] << endl; } return 0; }