#include #include int main(){ unsigned long N; std::stack st; std::cin >> N; while(N){ st.push(N % 7); N /= 7; } if(st.empty()) std::cout << '0'; else while(!st.empty()){ std::cout << st.top(); st.pop(); } }