#include<iostream> #include<cstdio> #include<vector> using namespace std; void deci_to_m(int x,int m){ vector<int> resultant; while(x!=0){ resultant.push_back(x%m); x/=m; } for(int i=resultant.size()-1;i>=0;--i){ printf("%d",resultant[i]); } } int main(){ int n; while(scanf("%d",&n)!=EOF){ deci_to_m(n, 8); printf("\n"); } return 0; }