module Main where

solve 0 = "1"
solve 1 = "0"
solve n | odd n  = "4" ++ solve (n - 1)
        | even n = take (div n 2) (cycle "8")

main = do
  s <- readFile "holes.in"
  writeFile "holes.out" $ (solve $ read s) ++ "\n"
