#include using namespace std; int main () { int N, M; cin >> N >> M; vector> A; for (int i = 0; i < N; i ++) { int a; cin >> a; A.emplace_back(a, i); } for (int i = 0; i < M; i ++) { int a; cin >> a; A.emplace_back(a, -1); } sort(A.begin(), A.end()); vector ans(N, -1); queue que; for (auto [a, i] : A) { if (i == -1) { while (!que.empty()) { ans[que.front()] = a; que.pop(); } } else { que.push(i); } } for (int a : ans) { if (a == -1) { cout << "Infinity"; } else { cout << a << endl; } } }