#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <bitset>
#include <queue>
#include <deque>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
using namespace std;
#define IOS ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define in freopen("in.txt","r",stdin);
#define out freopen("out.txt","w",stdout);
#define endl "\n"
typedef long long ll;
const ll MOD = 998244353;
const ll N = 2e5+10;
const ll MAXBIT = 60;
const ll INF = 1e18;
const double eps = 1e-8;
ll a;
ll dec_to_bin(ll n)
{
string s;
while(n)
{
s += (n % 2) + '0';
n /= 2;
}
reverse(s.begin(),s.end());
return strtoll(s.c_str(), NULL, 10);
}
int main()
{
cin >> a;
for(ll i = 1;i;i++)
{
auto ans = dec_to_bin(i);
if(ans % a == 0)
{
cout << ans / a << " " << ans;
return 0;
}
}
return 0;
}