#include "bits/stdc++.h" using namespace std; int main() { int n; int temp; while (cin >> n) { int i = 0; string str; while (n) { temp = n % 8; n /= 8; str.push_back(temp + '0'); } for (int j = str.size() - 1; j >= 0 ; j--) { cout << str[j]; } printf("\n"); } }