#include #include using namespace std; typedef long long ll; ll solve(ll x){ string s; while(x){ s.push_back((char)('0' + x%10)); x /= 10; } ll ret = 0; for(int i=0;i> p >> q >> x >> y; ll revn = y; while(revn%10==0) revn += q; ll n = solve(revn); cout << revn << endl; cout << n; n %= p; while(n!=x){ cout << 0; (n *= 10) %= p; } cout << endl; }