f n = if x >= 0 then x else (-1) - x where x = 3 - n `mod` 8 main = do print $ map f [0..20]