#include #include using namespace std; long x,inv,c1,c2; int main() { cin>>x>>c1>>c2; while (x!=0 || c1!=0 || c2!=0) { inv=1; while (x!=0) { if (x%10==c1) inv=inv*10+c2; else inv=inv*10+x%10; x=x/10; } x=0; while (inv>9) { x=x*10+inv%10; inv/=10; } cout<>x>>c1>>c2; } return 0; }