#include <bits/stdc++.h>
using namespace std;
int main()
{
int n, x, y;
cin >> n >> x >> y;
int a[n+1];
for (int i = 0; i < n; ++i) {
cin >> a[i];
}
int b= 0;
while(a[b]!=x&&b<n){
b++;
}
for(int i=n; i>b+1;i--) {
a[i] = a[i-1];
}
a[b+1] = y;
for(int i=0; i<=n; i++) {
cout << a[i] << " ";
}
return 0;
}
/**************************************************************
Problem: 1217
User: sf751616
Language: C++
Result: Accepted
Time:7 ms
Memory:2072 kb
****************************************************************/