#include using namespace std; int main() { int n,c1,c2; int a[20],k=0; cin>>n>>c1>>c2; while(n!=0 || c1!=0 || c2!=0) { int p=1,nr=0; while(n!=0) { if(n%10==c1) nr=nr+c2*p; else nr=nr+(n%10)*p; n/=10; p=p*10; } a[k++]=nr; cin>>n>>c1>>c2; } for(int i=0;i