main = putStrLn (pechat' 1 6)
pechat' x n =
if x > n then "" else ((posledovatelnost' 1 x (x `mod` 2 == 0)) ++ "\n" ++ (pechat' (x+1) n))
posledovatelnost' x n zadomNapered =
if (x < n) then
if zadomNapered then
show n ++ "-" ++ (posledovatelnost' x (n-1) True)
else
show x ++ "-" ++ (posledovatelnost' (x+1) n False)
else
if (x == n) then
if zadomNapered then (show n) else (show x)
else
""