#include #include using namespace std; int a[1009], b[1009]; int main() { ios::sync_with_stdio(false); cin.tie(0); int n, m; cin >> n >> m; for (int i = 0; i < n; i++) cin >> a[i]; for (int i = 0; i < m; i++) cin >> b[i]; for (int i = 0; i < n; i++) { int mn = -1; for (int j = 0; j < m; j++) if (a[i] < b[j] && (mn == -1 || b[j] < mn)) mn = b[j]; if (mn == -1) cout << "Infinity\n"; else cout << mn - a[i] << '\n'; } return 0; }