-- Try yukicoder -- author: Leonardone @ NEETSDKASU main = readLn >>= print . base7 base7 0 = 0 base7 x = m + 10 * base7 d where (d, m) = divMod x 7