#include <iostream>
using namespace std;
int main()
{
    int N, L;
    cin >> N >> L;
    int H[N];
    int tulkicsi = 0;
    cout << "" << endl;
    for(int i = 0; i < N; i++){
        cin >> H[i];
        if(H[i] <= L){
            tulkicsi = H[i];
            cout << H[i] << endl;
        }else{
            cout << -1 << endl;
        }
    }
    return 0;
}