#include <bits/stdc++.h>
using namespace std;
int main()
{
    int n,x,y;
    int a[105];
    cin >> n >> x >> y;
    for (int i=0;i<n;i++)
    {
        cin >> a[i];
        if (a[i]==x)
        {
            cout << a[i] <<" ";
            cout << y <<" ";
        } 
        else
        {
            cout << a[i] <<" ";
        }
    }

    
	return 0;
}
/**************************************************************
	Problem: 1217
	User: mariooo
	Language: C++
	Result: Accepted
	Time:8 ms
	Memory:2072 kb
****************************************************************/