main :: IO () main = readLn >>= putStrLn . solve solve :: Int -> String solve n | n `mod` 2 == 0 = replicate (n `div` 2) '1' | otherwise = "7" ++ replicate ((n-3) `div` 2) '1'