#include #include #define m 999999999 using namespace std; fstream fin("p.in"); int rec(int n,int c1,int c2) { int c,a; c=n%10; if(n==c1)return c2; if(n<10)return n; if(n>9) { a=rec(n/10,c1,c2); } if(c==c1)c=c2; return a*10+c; } int main() { int x,a,b,d; while(cin>>x>>a>>b) { d=rec(x,a,b); if(d) { cout<