#include #define FOR(i,a,b) for (int i=(a);i<(b);i++) #define FORR(i,a,b) for (int i=(a);i>=(b);i--) #define pb push_back #define pcnt __builtin_popcount #define show(x) cout<<#x<<" = "< pii; typedef vector vi; typedef vector vvi; typedef vector vpii; typedef set si; typedef pair pll; typedef vector vl; typedef vector vvl; typedef vector vpll; typedef set sl; templatestring join(vector&v) {stringstream s;FOR(i,0,sz(v))s<<' '<b)swap(a,b);for(;a>0;b%=a,swap(a,b));return b;} int modpow(ll a,ll n,int m){if(a==0)return a;ll p=1;for(;n>0;n/=2,a=a*a%m)if(n&1)p=p*a%m;return (int)p;} const int iinf = 1e9; const ll linf = 4e18; const int mod = 1e9+7; const double eps = 1e-10; ll a[32][2]={ 1,0,31,2147483647,465,64424509410,4495,934155386445,31465,8718783606820,169911,58851789346035,736281, 306029304599382,2629575,1275122102497425,7888725,4371847208562600,20160075,12569060724617475,44352165, 30724370660176050,84672315,64521178386369705,141120525,117311233429763100,206253075,185742786263791575, 265182525,257182319442172950,300540195,312292816465495725,300540195,333112337563195440,265182525, 312292816465495725,206253075,257182319442172950,141120525,185742786263791575,84672315,117311233429763100,44352165,64521178386369705, 20160075,30724370660176050,7888725,12569060724617475,2629575,4371847208562600,736281,1275122102497425, 169911,306029304599382,31465,58851789346035,4495,8718783606820,465,934155386445,31,64424509410,1,2147483647 }; main(){ cin.tie(0); ios::sync_with_stdio(false); int x; cin >> x; if(x>31){ cout << "0 0\n"; return 0; } cout << a[x][0] << " " << a[x][1] << "\n"; return 0; }