#include <bits/stdc++.h>
using namespace std;
string st;
void cut(int &l,int &s,int a){
if(a>0){
if(l >s) l = l/2;
else s = s/2;
}
else return;
cut(l,s,a-1);//递归
}
int main(){
cin>>st;
int a = st[1] - '0';//字符串中提取数字
int l = 1189 , s = 841;
cut(l,s,a);
if(s>l)cout<<s<<'\n'<<l<<endl;
else cout << l <<'\n'<< s<<endl;//调整输出
}