#include using namespace std; typedef long long LL; const LL MOD=1e9+7; const LL mod=1e9+6; LL powmod(LL a,LL n,LL m){ LL res=1; a%=m; while(n){ if(n&1)(res*=a)%=m; (a*=a)%=m; n>>=1; } return res; } LL mulmod(LL a,LL b,LL m){ return (a%m)*(b%m)%m; } int main(){ string s;cin>>s; replace(s.begin(),s.end(),'^',' '); stringstream ss(s); LL a,b,c; ss>>a>>b>>c; if(a%MOD==0) cout<<0<<" " <<0<