#include <iostream>
#include <fstream>
#include <cstring>
using namespace std;
int find(int x);
int main()
{
int n;
#ifndef ONLINE_JUDGE
ifstream cin("d:\\OJ\\uva_in.txt");
#endif // ONLINE_JUDGE
while (cin >> n) {
cout << oct << n << endl;
}
return 0;
}