Dr. Bruce Banner hates his enemies (like others don't). As we all know, he can barely talk when he turns into the incredible Hulk. That's why he asked you to help him to express his feelings.Hulk likes the Inception so much, and like that his feelings are complicated. They have n layers. The first layer is hate, second one is love, third one is hate and so on...For example if n = 1, then his feeling is "I hate it" or if n = 2 it's "I hate that I love it", and if n = 3 it's "I hate that I love that I hate it" and so on.Please help Dr. Banner.

The only line of the input contains a single integer n (1 ≤ n ≤ 100) — the number of layers of love and hate.

I hate it
I hate that I love it
I hate that I love that I hate it

import Data.Maybe
import Control.Monad
import qualified Data.ByteString as BS
import qualified Data.ByteString.Char8 as BS8

getInt = read `fmap` getLine :: IO Int
getInts = (map (fst . fromJust . BS8.readInt) . BS8.words) `fmap` BS.getLine :: IO [Int]

getDouble = read `fmap` getLine :: IO Double
getDoubles = map fromIntegral `fmap` getInts :: IO [Double]

love = "that I love "
hate = "that I hate "

main = do
    n <- getInt
    if n == 1 then putStrLn "I hate it"
    else putStrLn ("I hate " ++ build n ++ "it")

build 1 = ""
build n = build (n-1) ++ (if n `mod` 2 == 0 then love else hate)

f 1 True = ["I love it"]
f 1 False = ["I hate it"]
f n True = "I love that":(f (n-1) False)
f n False = "I hate that":(f (n-1) True)
fn x = unwords (f x False)
main = do
    n <- getLine
    putStrLn (fn (read n))

main = do
  n <- getLine
  let f (x, y) = if (x > 0) then (if y then "I hate" else "I love") ++ (if (x > 1) then " that " else "") ++  f(x - 1, not y) else " it"
  putStrLn( f(read $ n, True) );

import Data.List

main = do
    n <- getLine
    let emotions = [if odd(i) then hate else love | i <- [1..(read n :: Int)]]
    putStrLn $ intercalate "that " emotions ++ "it"

hate :: String
hate = "I hate "

love :: String
love = "I love "

go :: (Integral x) => x -> String

go n
  | n == 1            = "I hate"
  | (n `mod` 2) == 1  = (go (n-1)) ++ " that I hate"
  | otherwise         = (go (n-1)) ++ " that I love"

main = do
  line <- getLine
  let n = read line :: Int
  putStrLn $ go n ++ " it"

main :: IO ()
main = do
  layer <- readLn
  putStrLn ( hulk layer )

hulk :: Int -> String
hulk x = (hulkLayer x) ++ " it"

hulkLayer :: Int -> String
hulkLayer 1 = "I hate"
hulkLayer x =
  (hulkLayer (x-1)) ++ " that I " ++ (feel x)

feel :: Int -> String
feel x = if odd x then "hate" else "love"

{-# LANGUAGE FlexibleContexts, ScopedTypeVariables, BangPatterns #-}
{-# OPTIONS_GHC -O2 #-}

import Control.Applicative
import Control.Monad hiding ((<$!>))
import Control.Monad.ST.Safe
import Control.Monad.State hiding ((<$!>))
import Data.Array
-- import Data.Array.IArray
import Data.Array.IO.Safe
import Data.Array.MArray.Safe
import Data.Array.ST.Safe
-- import Data.Array.Unboxed
import qualified Data.ByteString.Char8 as B
import qualified Data.ByteString.Lazy.Builder as BB
import Data.Char
import qualified Data.Foldable as F
import Data.Function
import Data.Graph
import Data.Int
import Data.List
import Data.List.Split
import Data.Maybe
import Data.Monoid
import Data.Ratio
import qualified Data.Sequence as Seq
import Data.Sequence (Seq)
import Data.Set (Set)
import qualified Data.Set as Set
import Data.IntSet (IntSet)
import qualified Data.IntSet as IntSet
-- import Data.Tree
import Data.Tuple
import Data.Map (Map)
import qualified Data.Map as Map
import Data.IntMap (IntMap)
import qualified Data.IntMap as IntMap
-- import Debug.Trace
import System.IO

-- getInts = fmap (map read . words) getLine
getInts = unfoldr (B.readInt . B.dropWhile isSpace) <$> B.getLine

main = do
  n <- readLn

  putStrLn $ unwords $ zipWith (++) (concat $ repeat ["I hate", "I love"]) (replicate (n-1) " that" ++ [" it"])

main = do
    n <- fmap read getLine :: IO Int
    putStrLn $ solve "hate" n

solve :: String -> Int -> String
solve s 1 = "I " ++ s ++ " it"
solve s n = "I " ++ s ++ " that " ++ solve (opp s) (n - 1)

opp :: String -> String
opp "hate" = "love"
opp _ = "hate"

{-# LANGUAGE BlockArguments #-}

import Control.Arrow

main = do { x <- getLine; (read >>> solve "I hate " 1 >>> putStrLn) x }

solve :: String -> Int -> Int -> String
solve s x y | x == y = s ++ "it"
            | mod x 2 == 0 = solve (s ++ "that I hate ") (x+1) y
            | mod x 2 == 1 = solve (s ++ "that I love ") (x+1) y

import Control.Applicative ((<$>))
import qualified Data.List as L

solve :: Int -> String
solve t = (L.intercalate " " seg) ++ " it"
  where
    seg     = foldl apd ["I hate"] [2..t]
    apd l n
      | even n    = l ++ ["that I love"]
      | otherwise = l ++ ["that I hate"]

main :: IO ()
main = do
  n <- read <$> getLine
  putStrLn (solve n)

import Data.List
import Data.Maybe
import Data.Char
import Data.Function
main=   readsolveprint
readsolveprint::IO()
readsolveprint =  interact $ unwords . solve.read.head. lines
solve :: Int->[String]
solve 1= ["I hate it"]
solve x =  (take (x-1) $  cycle ["I hate that", "I love that"])  ++ f where
  f=if x `mod` 2 /= 0 then ["I hate it"] else ["I love it"]

f n | n == 1 = "I hate it"
    | n == 2 = "I hate that I love it"
    | otherwise = "I hate that I love that " ++ f (n - 2)

main = getLine >>= (putStrLn . f . read . head . words)

import Control.Monad

main = getInt >>= putStrLn . parse

getInt::IO Int
getInt = liftM read getLine

parse::Int -> String
parse n = start ++ " it"
  where start = foldl concat "I hate" [2..n]
        concat str i
          | i `mod` 2 == 0 = str ++ " that I love"
          | otherwise = str ++ " that I hate"

import Text.Printf
import Data.List
import Data.Functor
import Prelude

readInt :: String -> Int
readInt = read

main :: IO ()
main = do
    n <- read <$> getLine
    putStrLn . (++ " it") . intercalate " that " . take n . cycle $ ["I hate", "I love"]

hate :: Int -> String
love :: Int -> String

hate 1 = "I hate it"
hate n = "I hate that " ++ love (n - 1)
love 1 = "I love it"
love n = "I love that " ++ hate (n - 1)

main :: IO()
main = readLn >>= putStrLn . hate

import Control.Applicative
import Control.Monad
import Data.List

main=do
     n<-  read <$>  getLine::IO Int
     let x= intercalate "that" $ take n $ cycle [" I hate "," I love "]
     putStrLn $  tail $ x ++ "it"

-- 2019-11-24 20:43:35.642224548 UTC
import Data.Maybe
import Control.Monad
import Text.Read
nat_para :: Integral i => i -> a -> (i -> a -> a) -> a
nat_para i x f = np (abs i)
             where np 0 = x
                   np i = let i' = i - 1
                           in f i' (np i')
hd :: [a] -> a
hd ([]) = error "empty head"
hd (a : as) = a
tl = drop 1
nat_cata :: Integral i => i -> a -> (a -> a) -> a
nat_cata i x f = nc (abs i)
             where nc 0 = x
                   nc i = f (nc (i - 1))
iF :: Bool -> a -> a -> a
iF (True) t f = t
iF (False) t f = f
list_para :: [b] -> a -> (b -> [b] -> a -> a) -> a
list_para ([]) x f = x
list_para (y : ys) x f = f y ys (list_para ys x f)
magiciF :: Bool -> String
magiciF b = if b then "EASY" else "HARD"
uncurry' = id
parser :: String -> Int
parser = read
solve = \a -> nat_para (flip (-) 1 a) ((\n_6989586621679051752 -> iF ((n_6989586621679051752 `mod` 2) == 0) "I love it" "I hate it") a) (\b c -> iF (((== 0) . (`mod` 2)) (b - a)) (("I hate that " ++) c) (("I love that " ++) c))
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-11-24 05:06:47.459910813 UTC
import Data.Maybe
import Control.Monad
import Text.Read
nat_para :: Integral i => i -> a -> (i -> a -> a) -> a
nat_para i x f = np (abs i)
             where np 0 = x
                   np i = let i' = i - 1
                           in f i' (np i')
hd :: [a] -> a
hd ([]) = error "empty head"
hd (a : as) = a
tl = drop 1
nat_cata :: Integral i => i -> a -> (a -> a) -> a
nat_cata i x f = nc (abs i)
             where nc 0 = x
                   nc i = f (nc (i - 1))
iF :: Bool -> a -> a -> a
iF (True) t f = t
iF (False) t f = f
list_para :: [b] -> a -> (b -> [b] -> a -> a) -> a
list_para ([]) x f = x
list_para (y : ys) x f = f y ys (list_para ys x f)
magiciF :: Bool -> String
magiciF b = if b then "EASY" else "HARD"
uncurry' = id
parser :: String -> Int
parser = read
solve = \a -> nat_para (flip (-) 1 a) ((\n_6989586621679050168 -> iF ((n_6989586621679050168 `mod` 2) == 0) "I love it" "I hate it") a) (\b c -> iF (((== 0) . (`mod` 2)) (b - a)) (("I hate that " ++) c) (("I love that " ++) c))
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-11-24 19:47:40.593640185 UTC
import Data.Maybe
import Control.Monad
import Text.Read
nat_para :: Integral i => i -> a -> (i -> a -> a) -> a
nat_para i x f = np (abs i)
             where np 0 = x
                   np i = let i' = i - 1
                           in f i' (np i')
hd :: [a] -> a
hd ([]) = error "empty head"
hd (a : as) = a
tl = drop 1
nat_cata :: Integral i => i -> a -> (a -> a) -> a
nat_cata i x f = nc (abs i)
             where nc 0 = x
                   nc i = f (nc (i - 1))
iF :: Bool -> a -> a -> a
iF (True) t f = t
iF (False) t f = f
list_para :: [b] -> a -> (b -> [b] -> a -> a) -> a
list_para ([]) x f = x
list_para (y : ys) x f = f y ys (list_para ys x f)
magiciF :: Bool -> String
magiciF b = if b then "EASY" else "HARD"
uncurry' = id
parser :: String -> Int
parser = read
solve = \a -> nat_para (flip (-) 1 a) ((\n_6989586621679050238 -> iF ((n_6989586621679050238 `mod` 2) == 0) "I love it" "I hate it") a) (\b c -> iF (((== 0) . (`mod` 2)) (b - a)) (("I hate that " ++) c) (("I love that " ++) c))
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-11-20 21:17:08.568559806 UTC
import Data.Maybe
import Control.Monad
import Text.Read
nat_para :: Integral i => i -> a -> (i -> a -> a) -> a
nat_para i x f = np (abs i)
             where np 0 = x
                   np i = let i' = i - 1
                           in f i' (np i')
hd :: [a] -> a
hd ([]) = error "empty head"
hd (a : as) = a
tl = drop 1
nat_cata :: Integral i => i -> a -> (a -> a) -> a
nat_cata i x f = nc (abs i)
             where nc 0 = x
                   nc i = f (nc (i - 1))
iF :: Bool -> a -> a -> a
iF (True) t f = t
iF (False) t f = f
list_para :: [b] -> a -> (b -> [b] -> a -> a) -> a
list_para ([]) x f = x
list_para (y : ys) x f = f y ys (list_para ys x f)
magiciF :: Bool -> String
magiciF b = if b then "EASY" else "HARD"
uncurry' = id
parser :: String -> Int
parser = read
solve = \a -> nat_para (flip (-) 1 a) ((\n_6989586621679051817 -> iF ((n_6989586621679051817 `mod` 2) == 0) "I love it" "I hate it") a) (\b c -> iF (((== 0) . (`mod` 2)) (b - a)) (("I hate that " ++) c) (("I love that " ++) c))
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-11-24 05:04:24.247100453 UTC
import Data.Maybe
import Control.Monad
import Text.Read
nat_para :: Integral i => i -> a -> (i -> a -> a) -> a
nat_para i x f = np (abs i)
             where np 0 = x
                   np i = let i' = i - 1
                           in f i' (np i')
hd :: [a] -> a
hd ([]) = error "empty head"
hd (a : as) = a
tl = drop 1
nat_cata :: Integral i => i -> a -> (a -> a) -> a
nat_cata i x f = nc (abs i)
             where nc 0 = x
                   nc i = f (nc (i - 1))
iF :: Bool -> a -> a -> a
iF (True) t f = t
iF (False) t f = f
list_para :: [b] -> a -> (b -> [b] -> a -> a) -> a
list_para ([]) x f = x
list_para (y : ys) x f = f y ys (list_para ys x f)
magiciF :: Bool -> String
magiciF b = if b then "EASY" else "HARD"
uncurry' = id
parser :: String -> Int
parser = read
solve = \a -> nat_para (flip (-) 1 a) ((\n_6989586621679050168 -> iF ((n_6989586621679050168 `mod` 2) == 0) "I love it" "I hate it") a) (\b c -> iF (((== 0) . (`mod` 2)) (b - a)) (("I hate that " ++) c) (("I love that " ++) c))
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-11-14 21:34:13.653101282 UTC
import Data.Maybe
import Control.Monad
import Text.Read
nat_para :: Integral i => i -> a -> (i -> a -> a) -> a
nat_para i x f = np (abs i)
             where np 0 = x
                   np i = let i' = i - 1
                           in f i' (np i')
hd :: [a] -> a
hd ([]) = error "empty head"
hd (a : as) = a
tl = drop 1
nat_cata :: Integral i => i -> a -> (a -> a) -> a
nat_cata i x f = nc (abs i)
             where nc 0 = x
                   nc i = f (nc (i - 1))
iF :: Bool -> a -> a -> a
iF (True) t f = t
iF (False) t f = f
list_para :: [b] -> a -> (b -> [b] -> a -> a) -> a
list_para ([]) x f = x
list_para (y : ys) x f = f y ys (list_para ys x f)
magiciF :: Bool -> String
magiciF b = if b then "EASY" else "HARD"
uncurry' = id
parser :: String -> Int
parser = read
solve = \a -> nat_para (flip (-) 1 a) ((\n_6989586621679121131 -> iF ((n_6989586621679121131 `mod` 2) == 0) "I love it" "I hate it") a) (\b c -> iF (((== 0) . (`mod` 2)) (b - a)) (("I hate that " ++) c) (("I love that " ++) c))
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-11-24 20:25:35.391704187 UTC
import Data.Maybe
import Control.Monad
import Text.Read
nat_para :: Integral i => i -> a -> (i -> a -> a) -> a
nat_para i x f = np (abs i)
             where np 0 = x
                   np i = let i' = i - 1
                           in f i' (np i')
hd :: [a] -> a
hd ([]) = error "empty head"
hd (a : as) = a
tl = drop 1
nat_cata :: Integral i => i -> a -> (a -> a) -> a
nat_cata i x f = nc (abs i)
             where nc 0 = x
                   nc i = f (nc (i - 1))
iF :: Bool -> a -> a -> a
iF (True) t f = t
iF (False) t f = f
list_para :: [b] -> a -> (b -> [b] -> a -> a) -> a
list_para ([]) x f = x
list_para (y : ys) x f = f y ys (list_para ys x f)
magiciF :: Bool -> String
magiciF b = if b then "EASY" else "HARD"
uncurry' = id
parser :: String -> Int
parser = read
solve = \a -> nat_para (flip (-) 1 a) ((\n_6989586621679051903 -> iF ((n_6989586621679051903 `mod` 2) == 0) "I love it" "I hate it") a) (\b c -> iF (((== 0) . (`mod` 2)) (b - a)) (("I hate that " ++) c) (("I love that " ++) c))
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-11-24 05:02:38.537124654 UTC
import Data.Maybe
import Control.Monad
import Text.Read
nat_para :: Integral i => i -> a -> (i -> a -> a) -> a
nat_para i x f = np (abs i)
             where np 0 = x
                   np i = let i' = i - 1
                           in f i' (np i')
hd :: [a] -> a
hd ([]) = error "empty head"
hd (a : as) = a
tl = drop 1
nat_cata :: Integral i => i -> a -> (a -> a) -> a
nat_cata i x f = nc (abs i)
             where nc 0 = x
                   nc i = f (nc (i - 1))
iF :: Bool -> a -> a -> a
iF (True) t f = t
iF (False) t f = f
list_para :: [b] -> a -> (b -> [b] -> a -> a) -> a
list_para ([]) x f = x
list_para (y : ys) x f = f y ys (list_para ys x f)
magiciF :: Bool -> String
magiciF b = if b then "EASY" else "HARD"
uncurry' = id
parser :: String -> Int
parser = read
solve = \a -> nat_para (flip (-) 1 a) ((\n_6989586621679050168 -> iF ((n_6989586621679050168 `mod` 2) == 0) "I love it" "I hate it") a) (\b c -> iF (((== 0) . (`mod` 2)) (b - a)) (("I hate that " ++) c) (("I love that " ++) c))
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-11-24 19:45:57.671564784 UTC
import Data.Maybe
import Control.Monad
import Text.Read
nat_para :: Integral i => i -> a -> (i -> a -> a) -> a
nat_para i x f = np (abs i)
             where np 0 = x
                   np i = let i' = i - 1
                           in f i' (np i')
hd :: [a] -> a
hd ([]) = error "empty head"
hd (a : as) = a
tl = drop 1
nat_cata :: Integral i => i -> a -> (a -> a) -> a
nat_cata i x f = nc (abs i)
             where nc 0 = x
                   nc i = f (nc (i - 1))
iF :: Bool -> a -> a -> a
iF (True) t f = t
iF (False) t f = f
list_para :: [b] -> a -> (b -> [b] -> a -> a) -> a
list_para ([]) x f = x
list_para (y : ys) x f = f y ys (list_para ys x f)
magiciF :: Bool -> String
magiciF b = if b then "EASY" else "HARD"
uncurry' = id
parser :: String -> Int
parser = read
solve = \a -> nat_para (flip (-) 1 a) ((\n_6989586621679050238 -> iF ((n_6989586621679050238 `mod` 2) == 0) "I love it" "I hate it") a) (\b c -> iF (((== 0) . (`mod` 2)) (b - a)) (("I hate that " ++) c) (("I love that " ++) c))
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-11-24 20:48:17.054512803 UTC
import Data.Maybe
import Control.Monad
import Text.Read
nat_para :: Integral i => i -> a -> (i -> a -> a) -> a
nat_para i x f = np (abs i)
             where np 0 = x
                   np i = let i' = i - 1
                           in f i' (np i')
hd :: [a] -> a
hd ([]) = error "empty head"
hd (a : as) = a
tl = drop 1
nat_cata :: Integral i => i -> a -> (a -> a) -> a
nat_cata i x f = nc (abs i)
             where nc 0 = x
                   nc i = f (nc (i - 1))
iF :: Bool -> a -> a -> a
iF (True) t f = t
iF (False) t f = f
list_para :: [b] -> a -> (b -> [b] -> a -> a) -> a
list_para ([]) x f = x
list_para (y : ys) x f = f y ys (list_para ys x f)
magiciF :: Bool -> String
magiciF b = if b then "EASY" else "HARD"
uncurry' = id
parser :: String -> Int
parser = read
solve = \a -> nat_para (flip (-) 1 a) ((\n_6989586621679051752 -> iF ((n_6989586621679051752 `mod` 2) == 0) "I love it" "I hate it") a) (\b c -> iF (((== 0) . (`mod` 2)) (b - a)) (("I hate that " ++) c) (("I love that " ++) c))
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-11-24 20:23:34.78482098 UTC
import Data.Maybe
import Control.Monad
import Text.Read
nat_para :: Integral i => i -> a -> (i -> a -> a) -> a
nat_para i x f = np (abs i)
             where np 0 = x
                   np i = let i' = i - 1
                           in f i' (np i')
hd :: [a] -> a
hd ([]) = error "empty head"
hd (a : as) = a
tl = drop 1
nat_cata :: Integral i => i -> a -> (a -> a) -> a
nat_cata i x f = nc (abs i)
             where nc 0 = x
                   nc i = f (nc (i - 1))
iF :: Bool -> a -> a -> a
iF (True) t f = t
iF (False) t f = f
list_para :: [b] -> a -> (b -> [b] -> a -> a) -> a
list_para ([]) x f = x
list_para (y : ys) x f = f y ys (list_para ys x f)
magiciF :: Bool -> String
magiciF b = if b then "EASY" else "HARD"
uncurry' = id
parser :: String -> Int
parser = read
solve = \a -> nat_para (flip (-) 1 a) ((\n_6989586621679051903 -> iF ((n_6989586621679051903 `mod` 2) == 0) "I love it" "I hate it") a) (\b c -> iF (((== 0) . (`mod` 2)) (b - a)) (("I hate that " ++) c) (("I love that " ++) c))
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-11-24 05:10:01.201803523 UTC
import Data.Maybe
import Control.Monad
import Text.Read
nat_para :: Integral i => i -> a -> (i -> a -> a) -> a
nat_para i x f = np (abs i)
             where np 0 = x
                   np i = let i' = i - 1
                           in f i' (np i')
hd :: [a] -> a
hd ([]) = error "empty head"
hd (a : as) = a
tl = drop 1
nat_cata :: Integral i => i -> a -> (a -> a) -> a
nat_cata i x f = nc (abs i)
             where nc 0 = x
                   nc i = f (nc (i - 1))
iF :: Bool -> a -> a -> a
iF (True) t f = t
iF (False) t f = f
list_para :: [b] -> a -> (b -> [b] -> a -> a) -> a
list_para ([]) x f = x
list_para (y : ys) x f = f y ys (list_para ys x f)
magiciF :: Bool -> String
magiciF b = if b then "EASY" else "HARD"
uncurry' = id
parser :: String -> Int
parser = read
solve = \a -> nat_para (flip (-) 1 a) ((\n_6989586621679050168 -> iF ((n_6989586621679050168 `mod` 2) == 0) "I love it" "I hate it") a) (\b c -> iF (((== 0) . (`mod` 2)) (b - a)) (("I hate that " ++) c) (("I love that " ++) c))
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-11-20 21:04:10.502421734 UTC
import Data.Maybe
import Control.Monad
import Text.Read
nat_para :: Integral i => i -> a -> (i -> a -> a) -> a
nat_para i x f = np (abs i)
             where np 0 = x
                   np i = let i' = i - 1
                           in f i' (np i')
hd :: [a] -> a
hd ([]) = error "empty head"
hd (a : as) = a
tl = drop 1
nat_cata :: Integral i => i -> a -> (a -> a) -> a
nat_cata i x f = nc (abs i)
             where nc 0 = x
                   nc i = f (nc (i - 1))
iF :: Bool -> a -> a -> a
iF (True) t f = t
iF (False) t f = f
list_para :: [b] -> a -> (b -> [b] -> a -> a) -> a
list_para ([]) x f = x
list_para (y : ys) x f = f y ys (list_para ys x f)
magiciF :: Bool -> String
magiciF b = if b then "EASY" else "HARD"
uncurry' = id
parser :: String -> Int
parser = read
solve = \a -> nat_para (flip (-) 1 a) ((\n_6989586621679050267 -> iF ((n_6989586621679050267 `mod` 2) == 0) "I love it" "I hate it") a) (\b c -> iF (((== 0) . (`mod` 2)) (b - a)) (("I hate that " ++) c) (("I love that " ++) c))
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

main = interact $ merge . flip take (cycle ["hate","love"]) . read
merge [f] = "I " ++ f ++ " it"
merge (f:fs) = "I " ++ f ++ " that " ++ merge fs

import System.IO
import Control.Monad
import Data.List

glwr = fmap (map read . words) getLine

main = do
  hSetBuffering stdout NoBuffering
  solve

solve :: IO ()
solve = do
  n:_ <- glwr

  putStrLn $ hulk n

hulk :: Int -> String
hulk n =  [1..n] >>= ko n

ko n i
  = "I "
  ++ ["love ", "hate "] !! fromEnum (odd i)
  ++ ["that ", "it "] !! fromEnum (n == i)

main = getLine >>= putStrLn . solve 0 . read

solve 0 n = "I hate " ++ solve 1 n
solve _ 1 = "it"
solve m n = if m `mod` 2 == 0
            then "that I hate " ++ solve (m + 1) (n - 1)
            else "that I love " ++ solve (m + 1) (n - 1)

module Main where
  import Data.List

  hateLove :: Integer -> String
  hateLove n
    | n `mod` 2 == 0 = "hate"
    | otherwise = "love"

  partialSolver :: Integer -> Integer -> [String] -> [String]
  partialSolver n i acc
    | n == i = acc
    | otherwise = partialSolver n (i + 1) $ (hateLove i):acc

  addIt :: String -> String
  addIt x = "I " ++ x ++ " it"

  addThat :: String -> String
  addThat x = "I " ++ x ++ " that"

  stringify :: [String] -> [String]
  stringify xs =
    let thatTail = addThat `map` (tail xs)
        itHead = addIt $ head xs
        in reverse $ itHead : thatTail

  solutionSolver :: Integer -> String
  solutionSolver n = intercalate " " $ stringify $ partialSolver n 0 []

  main :: IO ()
  main = do
    n <- getLine
    let i = read n :: Integer
    putStrLn $ solutionSolver i

-- Vicfred
-- https://codeforces.com/problemset/problem/705/A

hate :: Int -> String
hate 1 = "I hate it"
hate n = "I hate that " ++ love (n-1)

love :: Int -> String
love 1 = "I love it"
love n = "I love that " ++ hate (n-1)

main :: IO ()
main = readLn >>= putStrLn . hate

printer :: Int -> Int -> String
printer x y =
    if x == 1 then if y == 0 then "I hate it" else "I love it"
    else if y == 0 then "I hate that " ++ printer (x - 1) 1
    else "I love that " ++ printer (x - 1) 0

main = do
    xx <- getLine
    let x = read xx :: Int
    putStrLn (printer x 0)

main = do
    n <- readLn
    let talk 0 _ = " it"
	talk n love
	  | love	= " that I love" ++ talk (n-1) False
	  | otherwise	= " that I hate" ++ talk (n-1) True
    putStrLn $ "I hate"++talk (n-1) True

main :: IO ()
main = readLn >>= \n -> putStrLn $ addHateOrLove 1 n ""

addHateOrLove :: Int -> Int -> String -> String
addHateOrLove _ 0 _  = "it"
addHateOrLove c n xs
  | odd c     = "I hate " ++ xs ++ (addHateOrLove (c+1) (n-1) xs)
  | otherwise = "I love " ++ xs ++ (addHateOrLove (c+1) (n-1) xs)
  where
    xs = if n == 1 then "" else "that "

solve n = take (n+1) $ iterate (\x -> if (snd x) == n then (if (snd x) `mod` 2 == 1 then ("I hate it", (snd x)+1) else ("I love it", (snd x)+1))
                               else (if (snd x) `mod` 2 == 1 then ("I hate that ", (snd x)+1) else ("I love that ", (snd x)+1))
                               ) ("I hate it ", 1)
main = do
    line <- getLine
    let n = read line::Int in putStrLn $ concat $ map (fst) $ drop 1 $ solve n

main = do
 n <- getLine
 mapM_ putStr $ (take.read $ n) $ iterate (\str -> if str == "that I love " then "that I hate " else "that I love ") "I hate "
 putStr "it"

import Data.List
import System.IO

parseLine :: IO [String]
parseLine = fmap words getLine

parseInt :: IO [Int]
parseInt = fmap (map read . words) getLine

parseDouble :: IO [Double]
parseDouble = fmap (map read . words) getLine

solve :: Int -> Bool -> String
solve n isHate = if (n == 1) then (if isHate then "I hate it" else "I love it")
                 else (if isHate then "I hate that " else "I love that ") ++  (solve (n - 1) (not isHate))

main :: IO ()
main = do
  [n] <- parseInt

  putStrLn $ solve n True

import Control.Applicative
import Control.Monad
import Data.List

type I = Int

main :: IO ()
main = do
  n <- readi <$> getLine
  putStrLn $ solve n

solve :: Int -> String
solve n = intercalate " that " (map (\x -> if odd x then "I hate" else "I love") [1..n]) ++ " it"

--  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --

readi :: String -> I
readi = read

toTuple :: [a] -> (a, a)
toTuple [x, y] = (x, y)

toTriple :: [a] -> (a, a, a)
toTriple [x, y, z] = (x, y, z)

main = do
    n <- getLine
    putStrLn . g . stoi . words $ n

stoi :: [[Char]] -> [Int]
stoi []     = []
stoi (n:ns) = (read n::Int) : stoi ns

g :: [Int] -> [Char]
g (x:_)
    | x >= 1 = "I hate" ++ foo (x-1)

bar :: Int -> [Char]
bar n
    | n == 0    = " it"
    | otherwise = " that I hate" ++ foo (n-1)

foo :: Int -> [Char]
foo n
    | n == 0    = " it"
    | otherwise = " that I love" ++ bar (n-1)

solve :: Bool -> Int -> String
solve True  1 = "I hate it"
solve False 1 = "I love it"
solve True  n = "I hate that " ++ solve False (n - 1)
solve False n = "I love that " ++ solve True  (n - 1)
main = putStrLn . solve True . read =<< getLine

-- Hulk -> CodeForces

phrases :: Int -> [String]
phrases x = if x`mod`2==0
  then ["hate ", "love "]
  else ["love ", "hate "]

hulkSpeak :: [String] -> Int -> String
hulkSpeak ps 0 = "it"
hulkSpeak ps x = "I " ++ phrase ++ hulkSpeak ps (x-1)
  where
    phrase =
      if x > 1
        then ps !! (x`mod`2) ++ "that "
        else ps !! (x`mod`2)

main = do
  x <- readLn :: IO Int
  let ps = phrases x
  putStrLn $ hulkSpeak ps x

phrases :: [String]
phrases = ["hate ", "love "]

hulkSpeak :: Int -> Int -> String
hulkSpeak x y =
  if x == y
    then "it"
    else "I " ++ phrase ++ hulkSpeak (x+1) y
      where
        phrase = if x /= (y-1)
          then phrases !! (x`mod`2) ++ "that "
          else phrases !! (x`mod`2)

main = do
  x <- readLn :: IO Int
  putStrLn $ hulkSpeak 0 x

import Data.List (intersperse)

feelings :: Int -> String
feelings n = (concat
             $ intersperse " that "
             $ take n
             $ map (\i -> if i `mod` 2 == 0 then "I love" else "I hate") [1..]
             ) ++ " it"

main :: IO ()
main = do
    n <- read <$> getLine
    putStrLn $ feelings n

import Control.Applicative
import Control.Monad
import Data.List
import Data.Maybe
import Data.Array

main= do
		c<-  read <$>  getLine::IO Int
	   	let d = intercalate " that " $ take c $ cycle ["I hate" , "I love"]
           	putStrLn $ d++ " it"

main = do
  m <- readLn
  putStrLn $ hulk m
hulk :: Int -> String
hulk m = (drop 5 (foldl (\x y -> x ++ "that " ++ y) [] took)) ++ "it"
  where took = take m (cycle ["I hate ", "I love "])

solve :: Int -> String
solve x = solve' 1
    where
        start a = if a `mod` 2 == 0 then "I love " else "I hate "
        end a   = if a == x then "it " else "that "
        solve' a = if a > x then ""
            else start a ++ end a ++ solve' (a + 1)

main :: IO ()
main = putStrLn =<< solve . (read :: String -> Int) <$> getLine

main = do
    ln <- getLine
    x <- return $ (read ln :: Int) - 1
    putStrLn $ "I hate " ++ concat [ "that I " ++ (if u `mod` 2 == 0 then "hate " else "love ") | u <- [1..x] ] ++ "it"

--ghc 7.10

data Feel = Love | Hate deriving (Eq)

listFeeling :: Int -> Feel -> [String]
listFeeling 1 Love = ["I love it"]
listFeeling 1 Hate = ["I hate it"]
listFeeling n Love = "I love that ":listFeeling (n-1) Hate
listFeeling n Hate = "I hate that ":listFeeling (n-1) Love

hulkFeeling :: Int -> String
hulkFeeling n = concat $ listFeeling n Hate

main = do
    n <- getLine
    putStrLn . hulkFeeling . read $ n

import Data.List

process :: Int -> String
process source
    | mod source 2 == 1 = "I hate"
    | mod source 2 == 0 = "I love"

main :: IO ()
main = do
  text <- getLine
  let count = read text
  let result = intercalate " that " $ map process [1..count]
  putStrLn (result ++ " it")

import Data.List
main = interact $ express . read

express n = (intercalate " that " feelings) ++ " it"
    where feelings = fmap (\i -> if odd i then "I hate" else "I love") [1..n]

import Data.List
main :: IO ()
main = do
        interact $ express . read

express :: Int -> String
express n = (intercalate " that " feelings) ++ " it"
    where feelings = fmap (\i -> if odd i then "I hate" else "I love") [1..n]

import Data.List
main = interact $ express . read
express n = intercalate " that " (take n $ cycle ["I hate",  "I love"]) ++ " it"

import Data.List

solve n = intercalate " that " (take n $ concat (replicate n ms)) ++ " it"
    where ms = ["I hate", "I love"]

main = do
    n <- readLn :: IO Int
    putStrLn $ solve n

import Control.Applicative
import Control.Monad
import Data.STRef
import GHC.Float.RealFracMethods
main :: IO ()
main = do
  n <- getLine
  mapM_ (\x -> putStr$x++" ")$mood (read n) False
  putStrLn ""

mood :: Int -> Bool -> [String]
mood 1 x = ["I", if x then "love" else "hate", "it"]
mood a x = ["I", if x then "love" else "hate", "that"]++ (mood (a-1)$not x)

f 1 True = ["I love it"]
f 1 False = ["I Hate it"]
f n True = "I love that":(f (n-1) False)
f n False = "I hate that":(f (n-1) True)
fn x = unwords (f x False)
main = do
    n <- getLine
    putStrLn (fn (read n))

main = do
  n <- getLine
  let f (x, y) = if (x > 0) then (if y then "I hate" else "I love") ++ (if (x > 1) then " that " else "") ++  f(x - 1, not y) else " it"
  putStrLn( show $ f(read $ n, True) );

main :: IO ()
main = do
  layer <- readLn
  putStrLn ( hulk layer )

hulk :: Int -> String
hulk 1 = "I hate it"
hulk x = "I " ++ (if odd x then "hate" else "love") ++ " that " ++ ( hulk (x-1) )

{-# LANGUAGE FlexibleContexts, ScopedTypeVariables, BangPatterns #-}
{-# OPTIONS_GHC -O2 #-}

import Control.Applicative
import Control.Monad hiding ((<$!>))
import Control.Monad.ST.Safe
import Control.Monad.State hiding ((<$!>))
import Data.Array
-- import Data.Array.IArray
import Data.Array.IO.Safe
import Data.Array.MArray.Safe
import Data.Array.ST.Safe
-- import Data.Array.Unboxed
import qualified Data.ByteString.Char8 as B
import qualified Data.ByteString.Lazy.Builder as BB
import Data.Char
import qualified Data.Foldable as F
import Data.Function
import Data.Graph
import Data.Int
import Data.List
import Data.List.Split
import Data.Maybe
import Data.Monoid
import Data.Ratio
import qualified Data.Sequence as Seq
import Data.Sequence (Seq)
import Data.Set (Set)
import qualified Data.Set as Set
import Data.IntSet (IntSet)
import qualified Data.IntSet as IntSet
-- import Data.Tree
import Data.Tuple
import Data.Map (Map)
import qualified Data.Map as Map
import Data.IntMap (IntMap)
import qualified Data.IntMap as IntMap
-- import Debug.Trace
import System.IO

-- getInts = fmap (map read . words) getLine
getInts = unfoldr (B.readInt . B.dropWhile isSpace) <$> B.getLine

main = do
  n <- readLn

  putStrLn $ unwords $ take n $ concat $ repeat ["I hate it", "I love it"]

main = do
    n <- fmap read getLine :: IO Int
    putStrLn $ solve n

solve :: Int -> String
solve 1 = "I hate it"
solve n
    | odd n = "I hate that " ++ solve (n - 1)
    | otherwise = "I love that " ++ solve (n - 1)

{-# LANGUAGE BlockArguments #-}

import Control.Arrow

main = interact $
    lines >>> map (words >>> head >>> read >>> solve "I hate " 1 >>> show) >>> unlines

solve :: String -> Int -> Int -> String
solve s x y | x == y = s ++ "it"
            | mod x 2 == 0 = solve (s ++ "that I hate ") (x+1) y
            | mod x 2 == 1 = solve (s ++ "that I love ") (x+1) y

import Control.Applicative ((<$>))
import qualified Data.List as L

solve :: Int -> String
solve t = (L.intercalate " " seg) ++ " it"
  where
    seg     = foldl apd ["I hate"] [2..t]
    apd l n
      | even n    = l ++ ["that I love"]
      | otherwise = l ++ ["that I hate"]

main :: IO ()
main = do
  n <- read <$> getLine
  putStrLn . show $ solve n

f n | n == 1 = "I hate it"
    | n == 2 = "I hate that I love it"
    | otherwise = "I hate that I love that" ++ f (n - 2)

main = getLine >>= (putStrLn . f . read . head . words)

import Control.Monad

main = getInt >>= putStrLn . parse

getInt::IO Int
getInt = liftM read getLine

parse::Int -> String
parse n = start ++ " it"
  where start = foldr concat "I hate" [2..n]
        concat i str
          | n `mod` i == 0 = str ++ " that I love"
          | otherwise = str ++ " that I hate"

-- 2019-11-24 05:08:28.558047825 UTC
import Data.Maybe
import Control.Monad
import Text.Read
nat_para :: Integral i => i -> a -> (i -> a -> a) -> a
nat_para i x f = np (abs i)
             where np 0 = x
                   np i = let i' = i - 1
                           in f i' (np i')
hd :: [a] -> a
hd ([]) = error "empty head"
hd (a : as) = a
tl = drop 1
nat_cata :: Integral i => i -> a -> (a -> a) -> a
nat_cata i x f = nc (abs i)
             where nc 0 = x
                   nc i = f (nc (i - 1))
iF :: Bool -> a -> a -> a
iF (True) t f = t
iF (False) t f = f
list_para :: [b] -> a -> (b -> [b] -> a -> a) -> a
list_para ([]) x f = x
list_para (y : ys) x f = f y ys (list_para ys x f)
magiciF :: Bool -> String
magiciF b = if b then "EASY" else "HARD"
uncurry' = id
parser :: String -> Int
parser = read
solve = \a -> nat_para (flip (-) 1 a) ((\n_6989586621679050168 -> iF ((n_6989586621679050168 `mod` 2) == 0) "I love it" "I hate it") a) (\b c -> ("I hate that " ++) (nat_para b c (\_ _ -> ("I love that " ++) ((\n_6989586621679050168 -> iF ((n_6989586621679050168 `mod` 2) == 0) "I love it" "I hate it") a))))
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-11-24 05:05:04.834635846 UTC
import Data.Maybe
import Control.Monad
import Text.Read
nat_para :: Integral i => i -> a -> (i -> a -> a) -> a
nat_para i x f = np (abs i)
             where np 0 = x
                   np i = let i' = i - 1
                           in f i' (np i')
hd :: [a] -> a
hd ([]) = error "empty head"
hd (a : as) = a
tl = drop 1
nat_cata :: Integral i => i -> a -> (a -> a) -> a
nat_cata i x f = nc (abs i)
             where nc 0 = x
                   nc i = f (nc (i - 1))
iF :: Bool -> a -> a -> a
iF (True) t f = t
iF (False) t f = f
list_para :: [b] -> a -> (b -> [b] -> a -> a) -> a
list_para ([]) x f = x
list_para (y : ys) x f = f y ys (list_para ys x f)
magiciF :: Bool -> String
magiciF b = if b then "EASY" else "HARD"
uncurry' = id
parser :: String -> Int
parser = read
solve = \a -> nat_para (flip (-) 1 a) ((\n_6989586621679050168 -> iF ((n_6989586621679050168 `mod` 2) == 0) "I love it" "I hate it") a) (\b c -> ("I hate that " ++) (nat_para b c (\_ _ -> ("I love that " ++) ((\n_6989586621679050168 -> iF ((n_6989586621679050168 `mod` 2) == 0) "I love it" "I hate it") a))))
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-11-20 21:10:01.434033762 UTC
import Data.Maybe
import Control.Monad
import Text.Read
nat_para :: Integral i => i -> a -> (i -> a -> a) -> a
nat_para i x f = np (abs i)
             where np 0 = x
                   np i = let i' = i - 1
                           in f i' (np i')
hd :: [a] -> a
hd ([]) = error "empty head"
hd (a : as) = a
tl = drop 1
nat_cata :: Integral i => i -> a -> (a -> a) -> a
nat_cata i x f = nc (abs i)
             where nc 0 = x
                   nc i = f (nc (i - 1))
iF :: Bool -> a -> a -> a
iF (True) t f = t
iF (False) t f = f
list_para :: [b] -> a -> (b -> [b] -> a -> a) -> a
list_para ([]) x f = x
list_para (y : ys) x f = f y ys (list_para ys x f)
magiciF :: Bool -> String
magiciF b = if b then "EASY" else "HARD"
uncurry' = id
parser :: String -> Int
parser = read
solve = \a -> nat_para (flip (-) 1 a) ((\n_6989586621679051817 -> iF ((n_6989586621679051817 `mod` 2) == 0) "I love it" "I hate it") a) (\b c -> ("I hate that " ++) (iF (((== 0) . (`mod` 2)) b) c (("I love that " ++) ((\n_6989586621679051817 -> iF ((n_6989586621679051817 `mod` 2) == 0) "I love it" "I hate it") b))))
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-11-24 05:02:02.916891858 UTC
import Data.Maybe
import Control.Monad
import Text.Read
nat_para :: Integral i => i -> a -> (i -> a -> a) -> a
nat_para i x f = np (abs i)
             where np 0 = x
                   np i = let i' = i - 1
                           in f i' (np i')
hd :: [a] -> a
hd ([]) = error "empty head"
hd (a : as) = a
tl = drop 1
nat_cata :: Integral i => i -> a -> (a -> a) -> a
nat_cata i x f = nc (abs i)
             where nc 0 = x
                   nc i = f (nc (i - 1))
iF :: Bool -> a -> a -> a
iF (True) t f = t
iF (False) t f = f
list_para :: [b] -> a -> (b -> [b] -> a -> a) -> a
list_para ([]) x f = x
list_para (y : ys) x f = f y ys (list_para ys x f)
magiciF :: Bool -> String
magiciF b = if b then "EASY" else "HARD"
uncurry' = id
parser :: String -> Int
parser = read
solve = \a -> nat_para (flip (-) 1 a) ((\n_6989586621679050168 -> iF ((n_6989586621679050168 `mod` 2) == 0) "I love it" "I hate it") a) (\b c -> ("I hate that " ++) (iF (((== 0) . (`mod` 2)) b) c (("I love that " ++) ((\n_6989586621679050168 -> iF ((n_6989586621679050168 `mod` 2) == 0) "I love it" "I hate it") b))))
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-11-20 21:00:19.524922601 UTC
import Data.Maybe
import Control.Monad
import Text.Read
nat_para :: Integral i => i -> a -> (i -> a -> a) -> a
nat_para i x f = np (abs i)
             where np 0 = x
                   np i = let i' = i - 1
                           in f i' (np i')
hd :: [a] -> a
hd ([]) = error "empty head"
hd (a : as) = a
tl = drop 1
nat_cata :: Integral i => i -> a -> (a -> a) -> a
nat_cata i x f = nc (abs i)
             where nc 0 = x
                   nc i = f (nc (i - 1))
iF :: Bool -> a -> a -> a
iF (True) t f = t
iF (False) t f = f
list_para :: [b] -> a -> (b -> [b] -> a -> a) -> a
list_para ([]) x f = x
list_para (y : ys) x f = f y ys (list_para ys x f)
magiciF :: Bool -> String
magiciF b = if b then "EASY" else "HARD"
uncurry' = id
parser :: String -> Int
parser = read
solve = \a -> nat_para (flip (-) 1 a) ((\n_6989586621679050267 -> iF ((n_6989586621679050267 `mod` 2) == 0) "I love it" "I hate it") a) (\b c -> ("I hate that " ++) (iF (((== 0) . (`mod` 2)) b) c (("I love that " ++) ((\n_6989586621679050267 -> iF ((n_6989586621679050267 `mod` 2) == 0) "I love it" "I hate it") b))))
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-11-24 21:05:42.017908118 UTC
import Data.Maybe
import Control.Monad
import Text.Read
nat_para :: Integral i => i -> a -> (i -> a -> a) -> a
nat_para i x f = np (abs i)
             where np 0 = x
                   np i = let i' = i - 1
                           in f i' (np i')
hd :: [a] -> a
hd ([]) = error "empty head"
hd (a : as) = a
tl = drop 1
nat_cata :: Integral i => i -> a -> (a -> a) -> a
nat_cata i x f = nc (abs i)
             where nc 0 = x
                   nc i = f (nc (i - 1))
iF :: Bool -> a -> a -> a
iF (True) t f = t
iF (False) t f = f
list_para :: [b] -> a -> (b -> [b] -> a -> a) -> a
list_para ([]) x f = x
list_para (y : ys) x f = f y ys (list_para ys x f)
magiciF :: Bool -> String
magiciF b = if b then "EASY" else "HARD"
uncurry' = id
parser :: String -> Int
parser = read
solve = \a -> nat_para (flip (-) 1 a) ((\n_6989586621679051752 -> iF ((n_6989586621679051752 `mod` 2) == 0) "I love it" "I hate it") a) (\b c -> ("I hate that " ++) (nat_para b c (\_ _ -> ("I love that " ++) ((\n_6989586621679051752 -> iF ((n_6989586621679051752 `mod` 2) == 0) "I love it" "I hate it") a))))
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-11-24 19:56:37.495202571 UTC
import Data.Maybe
import Control.Monad
import Text.Read
nat_para :: Integral i => i -> a -> (i -> a -> a) -> a
nat_para i x f = np (abs i)
             where np 0 = x
                   np i = let i' = i - 1
                           in f i' (np i')
hd :: [a] -> a
hd ([]) = error "empty head"
hd (a : as) = a
tl = drop 1
nat_cata :: Integral i => i -> a -> (a -> a) -> a
nat_cata i x f = nc (abs i)
             where nc 0 = x
                   nc i = f (nc (i - 1))
iF :: Bool -> a -> a -> a
iF (True) t f = t
iF (False) t f = f
list_para :: [b] -> a -> (b -> [b] -> a -> a) -> a
list_para ([]) x f = x
list_para (y : ys) x f = f y ys (list_para ys x f)
magiciF :: Bool -> String
magiciF b = if b then "EASY" else "HARD"
uncurry' = id
parser :: String -> Int
parser = read
solve = \a -> nat_para (flip (-) 1 a) ((\n_6989586621679051926 -> iF ((n_6989586621679051926 `mod` 2) == 0) "I love it" "I hate it") a) (\b c -> ("I hate that " ++) (nat_para b c (\_ _ -> ("I love that " ++) ((\n_6989586621679051926 -> iF ((n_6989586621679051926 `mod` 2) == 0) "I love it" "I hate it") a))))
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-11-24 19:46:45.870399585 UTC
import Data.Maybe
import Control.Monad
import Text.Read
nat_para :: Integral i => i -> a -> (i -> a -> a) -> a
nat_para i x f = np (abs i)
             where np 0 = x
                   np i = let i' = i - 1
                           in f i' (np i')
hd :: [a] -> a
hd ([]) = error "empty head"
hd (a : as) = a
tl = drop 1
nat_cata :: Integral i => i -> a -> (a -> a) -> a
nat_cata i x f = nc (abs i)
             where nc 0 = x
                   nc i = f (nc (i - 1))
iF :: Bool -> a -> a -> a
iF (True) t f = t
iF (False) t f = f
list_para :: [b] -> a -> (b -> [b] -> a -> a) -> a
list_para ([]) x f = x
list_para (y : ys) x f = f y ys (list_para ys x f)
magiciF :: Bool -> String
magiciF b = if b then "EASY" else "HARD"
uncurry' = id
parser :: String -> Int
parser = read
solve = \a -> nat_para (flip (-) 1 a) ((\n_6989586621679050238 -> iF ((n_6989586621679050238 `mod` 2) == 0) "I love it" "I hate it") a) (\b c -> ("I hate that " ++) (iF (((== 0) . (`mod` 2)) b) c (("I love that " ++) ((\n_6989586621679050238 -> iF ((n_6989586621679050238 `mod` 2) == 0) "I love it" "I hate it") b))))
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-11-20 21:21:13.324129861 UTC
import Data.Maybe
import Control.Monad
import Text.Read
nat_para :: Integral i => i -> a -> (i -> a -> a) -> a
nat_para i x f = np (abs i)
             where np 0 = x
                   np i = let i' = i - 1
                           in f i' (np i')
hd :: [a] -> a
hd ([]) = error "empty head"
hd (a : as) = a
tl = drop 1
nat_cata :: Integral i => i -> a -> (a -> a) -> a
nat_cata i x f = nc (abs i)
             where nc 0 = x
                   nc i = f (nc (i - 1))
iF :: Bool -> a -> a -> a
iF (True) t f = t
iF (False) t f = f
list_para :: [b] -> a -> (b -> [b] -> a -> a) -> a
list_para ([]) x f = x
list_para (y : ys) x f = f y ys (list_para ys x f)
magiciF :: Bool -> String
magiciF b = if b then "EASY" else "HARD"
uncurry' = id
parser :: String -> Int
parser = read
solve = \a -> nat_para (flip (-) 1 a) "I hate it" (\b c -> ("I hate that " ++) (iF (((== 0) . (`mod` 2)) b) "I love it" (("I love that " ++) (iF (((== 0) . (`mod` 2)) b) c "I hate it"))))
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-11-24 05:14:36.021897447 UTC
import Data.Maybe
import Control.Monad
import Text.Read
nat_para :: Integral i => i -> a -> (i -> a -> a) -> a
nat_para i x f = np (abs i)
             where np 0 = x
                   np i = let i' = i - 1
                           in f i' (np i')
hd :: [a] -> a
hd ([]) = error "empty head"
hd (a : as) = a
tl = drop 1
nat_cata :: Integral i => i -> a -> (a -> a) -> a
nat_cata i x f = nc (abs i)
             where nc 0 = x
                   nc i = f (nc (i - 1))
iF :: Bool -> a -> a -> a
iF (True) t f = t
iF (False) t f = f
list_para :: [b] -> a -> (b -> [b] -> a -> a) -> a
list_para ([]) x f = x
list_para (y : ys) x f = f y ys (list_para ys x f)
magiciF :: Bool -> String
magiciF b = if b then "EASY" else "HARD"
uncurry' = id
parser :: String -> Int
parser = read
solve = \a -> nat_para (flip (-) 1 a) "I hate it" (\b c -> ("I hate that " ++) (iF (((== 0) . (`mod` 2)) b) "I love it" (("I love that " ++) (iF (((== 0) . (`mod` 2)) b) c "I hate it"))))
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-11-20 21:14:27.575368867 UTC
import Data.Maybe
import Control.Monad
import Text.Read
nat_para :: Integral i => i -> a -> (i -> a -> a) -> a
nat_para i x f = np (abs i)
             where np 0 = x
                   np i = let i' = i - 1
                           in f i' (np i')
hd :: [a] -> a
hd ([]) = error "empty head"
hd (a : as) = a
tl = drop 1
nat_cata :: Integral i => i -> a -> (a -> a) -> a
nat_cata i x f = nc (abs i)
             where nc 0 = x
                   nc i = f (nc (i - 1))
iF :: Bool -> a -> a -> a
iF (True) t f = t
iF (False) t f = f
list_para :: [b] -> a -> (b -> [b] -> a -> a) -> a
list_para ([]) x f = x
list_para (y : ys) x f = f y ys (list_para ys x f)
magiciF :: Bool -> String
magiciF b = if b then "EASY" else "HARD"
uncurry' = id
parser :: String -> Int
parser = read
solve = \a -> nat_para (flip (-) 1 a) ((\n_6989586621679051817 -> iF ((n_6989586621679051817 `mod` 2) == 0) "I love it" "I hate it") a) (\b c -> ("I hate that " ++) (iF (((== 0) . (`mod` 2)) b) c (("I love that " ++) ((\n_6989586621679051817 -> iF ((n_6989586621679051817 `mod` 2) == 0) "I love it" "I hate it") b))))
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-11-24 20:30:29.193048129 UTC
import Data.Maybe
import Control.Monad
import Text.Read
nat_para :: Integral i => i -> a -> (i -> a -> a) -> a
nat_para i x f = np (abs i)
             where np 0 = x
                   np i = let i' = i - 1
                           in f i' (np i')
hd :: [a] -> a
hd ([]) = error "empty head"
hd (a : as) = a
tl = drop 1
nat_cata :: Integral i => i -> a -> (a -> a) -> a
nat_cata i x f = nc (abs i)
             where nc 0 = x
                   nc i = f (nc (i - 1))
iF :: Bool -> a -> a -> a
iF (True) t f = t
iF (False) t f = f
list_para :: [b] -> a -> (b -> [b] -> a -> a) -> a
list_para ([]) x f = x
list_para (y : ys) x f = f y ys (list_para ys x f)
magiciF :: Bool -> String
magiciF b = if b then "EASY" else "HARD"
uncurry' = id
parser :: String -> Int
parser = read
solve = \a -> nat_para (flip (-) 1 a) ((\n_6989586621679051903 -> iF ((n_6989586621679051903 `mod` 2) == 0) "I love it" "I hate it") a) (\b c -> ("I hate that " ++) (nat_para b c (\_ _ -> ("I love that " ++) ((\n_6989586621679051903 -> iF ((n_6989586621679051903 `mod` 2) == 0) "I love it" "I hate it") a))))
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-11-24 20:04:12.95242109 UTC
import Data.Maybe
import Control.Monad
import Text.Read
nat_para :: Integral i => i -> a -> (i -> a -> a) -> a
nat_para i x f = np (abs i)
             where np 0 = x
                   np i = let i' = i - 1
                           in f i' (np i')
hd :: [a] -> a
hd ([]) = error "empty head"
hd (a : as) = a
tl = drop 1
nat_cata :: Integral i => i -> a -> (a -> a) -> a
nat_cata i x f = nc (abs i)
             where nc 0 = x
                   nc i = f (nc (i - 1))
iF :: Bool -> a -> a -> a
iF (True) t f = t
iF (False) t f = f
list_para :: [b] -> a -> (b -> [b] -> a -> a) -> a
list_para ([]) x f = x
list_para (y : ys) x f = f y ys (list_para ys x f)
magiciF :: Bool -> String
magiciF b = if b then "EASY" else "HARD"
uncurry' = id
parser :: String -> Int
parser = read
solve = \a -> nat_para (flip (-) 1 a) ((\n_6989586621679051927 -> iF ((n_6989586621679051927 `mod` 2) == 0) "I love it" "I hate it") a) (\b c -> ("I hate that " ++) (nat_para b c (\_ _ -> ("I love that " ++) ((\n_6989586621679051927 -> iF ((n_6989586621679051927 `mod` 2) == 0) "I love it" "I hate it") a))))
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-11-14 22:05:11.902524768 UTC
import Data.Maybe
import Control.Monad
import Text.Read
nat_para :: Integral i => i -> a -> (i -> a -> a) -> a
nat_para i x f = np (abs i)
             where np 0 = x
                   np i = let i' = i - 1
                           in f i' (np i')
hd :: [a] -> a
hd ([]) = error "empty head"
hd (a : as) = a
tl = drop 1
nat_cata :: Integral i => i -> a -> (a -> a) -> a
nat_cata i x f = nc (abs i)
             where nc 0 = x
                   nc i = f (nc (i - 1))
iF :: Bool -> a -> a -> a
iF (True) t f = t
iF (False) t f = f
list_para :: [b] -> a -> (b -> [b] -> a -> a) -> a
list_para ([]) x f = x
list_para (y : ys) x f = f y ys (list_para ys x f)
magiciF :: Bool -> String
magiciF b = if b then "EASY" else "HARD"
uncurry' = id
parser :: String -> Int
parser = read
solve = \a -> nat_para (flip (-) 1 a) "I hate it" (\b c -> ("I hate that " ++) (iF (((== 0) . (`mod` 2)) b) "I love it" (("I love that " ++) (iF (((== 0) . (`mod` 2)) b) c "I hate it"))))
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-11-24 19:59:56.006024558 UTC
import Data.Maybe
import Control.Monad
import Text.Read
nat_para :: Integral i => i -> a -> (i -> a -> a) -> a
nat_para i x f = np (abs i)
             where np 0 = x
                   np i = let i' = i - 1
                           in f i' (np i')
hd :: [a] -> a
hd ([]) = error "empty head"
hd (a : as) = a
tl = drop 1
nat_cata :: Integral i => i -> a -> (a -> a) -> a
nat_cata i x f = nc (abs i)
             where nc 0 = x
                   nc i = f (nc (i - 1))
iF :: Bool -> a -> a -> a
iF (True) t f = t
iF (False) t f = f
list_para :: [b] -> a -> (b -> [b] -> a -> a) -> a
list_para ([]) x f = x
list_para (y : ys) x f = f y ys (list_para ys x f)
magiciF :: Bool -> String
magiciF b = if b then "EASY" else "HARD"
uncurry' = id
parser :: String -> Int
parser = read
solve = \a -> nat_para (flip (-) 1 a) ((\n_6989586621679051926 -> iF ((n_6989586621679051926 `mod` 2) == 0) "I love it" "I hate it") a) (\b c -> ("I hate that " ++) (nat_para b c (\_ _ -> ("I love that " ++) ((\n_6989586621679051926 -> iF ((n_6989586621679051926 `mod` 2) == 0) "I love it" "I hate it") a))))
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-11-24 20:24:17.263832218 UTC
import Data.Maybe
import Control.Monad
import Text.Read
nat_para :: Integral i => i -> a -> (i -> a -> a) -> a
nat_para i x f = np (abs i)
             where np 0 = x
                   np i = let i' = i - 1
                           in f i' (np i')
hd :: [a] -> a
hd ([]) = error "empty head"
hd (a : as) = a
tl = drop 1
nat_cata :: Integral i => i -> a -> (a -> a) -> a
nat_cata i x f = nc (abs i)
             where nc 0 = x
                   nc i = f (nc (i - 1))
iF :: Bool -> a -> a -> a
iF (True) t f = t
iF (False) t f = f
list_para :: [b] -> a -> (b -> [b] -> a -> a) -> a
list_para ([]) x f = x
list_para (y : ys) x f = f y ys (list_para ys x f)
magiciF :: Bool -> String
magiciF b = if b then "EASY" else "HARD"
uncurry' = id
parser :: String -> Int
parser = read
solve = \a -> nat_para (flip (-) 1 a) ((\n_6989586621679051903 -> iF ((n_6989586621679051903 `mod` 2) == 0) "I love it" "I hate it") a) (\b c -> ("I hate that " ++) (iF (((== 0) . (`mod` 2)) b) c (("I love that " ++) ((\n_6989586621679051903 -> iF ((n_6989586621679051903 `mod` 2) == 0) "I love it" "I hate it") b))))
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-11-24 20:45:08.962334117 UTC
import Data.Maybe
import Control.Monad
import Text.Read
nat_para :: Integral i => i -> a -> (i -> a -> a) -> a
nat_para i x f = np (abs i)
             where np 0 = x
                   np i = let i' = i - 1
                           in f i' (np i')
hd :: [a] -> a
hd ([]) = error "empty head"
hd (a : as) = a
tl = drop 1
nat_cata :: Integral i => i -> a -> (a -> a) -> a
nat_cata i x f = nc (abs i)
             where nc 0 = x
                   nc i = f (nc (i - 1))
iF :: Bool -> a -> a -> a
iF (True) t f = t
iF (False) t f = f
list_para :: [b] -> a -> (b -> [b] -> a -> a) -> a
list_para ([]) x f = x
list_para (y : ys) x f = f y ys (list_para ys x f)
magiciF :: Bool -> String
magiciF b = if b then "EASY" else "HARD"
uncurry' = id
parser :: String -> Int
parser = read
solve = \a -> nat_para (flip (-) 1 a) ((\n_6989586621679051752 -> iF ((n_6989586621679051752 `mod` 2) == 0) "I love it" "I hate it") a) (\b c -> ("I hate that " ++) (iF (((== 0) . (`mod` 2)) b) c (("I love that " ++) ((\n_6989586621679051752 -> iF ((n_6989586621679051752 `mod` 2) == 0) "I love it" "I hate it") b))))
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-11-24 20:12:41.454933138 UTC
import Data.Maybe
import Control.Monad
import Text.Read
nat_para :: Integral i => i -> a -> (i -> a -> a) -> a
nat_para i x f = np (abs i)
             where np 0 = x
                   np i = let i' = i - 1
                           in f i' (np i')
hd :: [a] -> a
hd ([]) = error "empty head"
hd (a : as) = a
tl = drop 1
nat_cata :: Integral i => i -> a -> (a -> a) -> a
nat_cata i x f = nc (abs i)
             where nc 0 = x
                   nc i = f (nc (i - 1))
iF :: Bool -> a -> a -> a
iF (True) t f = t
iF (False) t f = f
list_para :: [b] -> a -> (b -> [b] -> a -> a) -> a
list_para ([]) x f = x
list_para (y : ys) x f = f y ys (list_para ys x f)
magiciF :: Bool -> String
magiciF b = if b then "EASY" else "HARD"
uncurry' = id
parser :: String -> Int
parser = read
solve = \a -> nat_para (flip (-) 1 a) ((\n_6989586621679051904 -> iF ((n_6989586621679051904 `mod` 2) == 0) "I love it" "I hate it") a) (\b c -> ("I hate that " ++) (nat_para b c (\_ _ -> ("I love that " ++) ((\n_6989586621679051904 -> iF ((n_6989586621679051904 `mod` 2) == 0) "I love it" "I hate it") a))))
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-11-14 21:46:04.815094948 UTC
import Data.Maybe
import Control.Monad
import Text.Read
nat_para :: Integral i => i -> a -> (i -> a -> a) -> a
nat_para i x f = np (abs i)
             where np 0 = x
                   np i = let i' = i - 1
                           in f i' (np i')
hd :: [a] -> a
hd ([]) = error "empty head"
hd (a : as) = a
tl = drop 1
nat_cata :: Integral i => i -> a -> (a -> a) -> a
nat_cata i x f = nc (abs i)
             where nc 0 = x
                   nc i = f (nc (i - 1))
iF :: Bool -> a -> a -> a
iF (True) t f = t
iF (False) t f = f
list_para :: [b] -> a -> (b -> [b] -> a -> a) -> a
list_para ([]) x f = x
list_para (y : ys) x f = f y ys (list_para ys x f)
magiciF :: Bool -> String
magiciF b = if b then "EASY" else "HARD"
uncurry' = id
parser :: String -> Int
parser = read
solve = \a -> nat_para (flip (-) 1 a) "I hate it" (\b c -> ("I hate that " ++) (iF (((== 0) . (`mod` 2)) b) "I love it" (("I love that " ++) (iF (((== 0) . (`mod` 2)) b) c "I hate it"))))
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-11-24 20:22:07.985374006 UTC
import Data.Maybe
import Control.Monad
import Text.Read
nat_para :: Integral i => i -> a -> (i -> a -> a) -> a
nat_para i x f = np (abs i)
             where np 0 = x
                   np i = let i' = i - 1
                           in f i' (np i')
hd :: [a] -> a
hd ([]) = error "empty head"
hd (a : as) = a
tl = drop 1
nat_cata :: Integral i => i -> a -> (a -> a) -> a
nat_cata i x f = nc (abs i)
             where nc 0 = x
                   nc i = f (nc (i - 1))
iF :: Bool -> a -> a -> a
iF (True) t f = t
iF (False) t f = f
list_para :: [b] -> a -> (b -> [b] -> a -> a) -> a
list_para ([]) x f = x
list_para (y : ys) x f = f y ys (list_para ys x f)
magiciF :: Bool -> String
magiciF b = if b then "EASY" else "HARD"
uncurry' = id
parser :: String -> Int
parser = read
solve = \a -> nat_para (flip (-) 1 a) ((\n_6989586621679051903 -> iF ((n_6989586621679051903 `mod` 2) == 0) "I love it" "I hate it") a) (\b c -> ("I hate that " ++) (iF (((== 0) . (`mod` 2)) b) c (("I love that " ++) ((\n_6989586621679051903 -> iF ((n_6989586621679051903 `mod` 2) == 0) "I love it" "I hate it") b))))
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-11-24 05:03:33.935721791 UTC
import Data.Maybe
import Control.Monad
import Text.Read
nat_para :: Integral i => i -> a -> (i -> a -> a) -> a
nat_para i x f = np (abs i)
             where np 0 = x
                   np i = let i' = i - 1
                           in f i' (np i')
hd :: [a] -> a
hd ([]) = error "empty head"
hd (a : as) = a
tl = drop 1
nat_cata :: Integral i => i -> a -> (a -> a) -> a
nat_cata i x f = nc (abs i)
             where nc 0 = x
                   nc i = f (nc (i - 1))
iF :: Bool -> a -> a -> a
iF (True) t f = t
iF (False) t f = f
list_para :: [b] -> a -> (b -> [b] -> a -> a) -> a
list_para ([]) x f = x
list_para (y : ys) x f = f y ys (list_para ys x f)
magiciF :: Bool -> String
magiciF b = if b then "EASY" else "HARD"
uncurry' = id
parser :: String -> Int
parser = read
solve = \a -> nat_para (flip (-) 1 a) ((\n_6989586621679050168 -> iF ((n_6989586621679050168 `mod` 2) == 0) "I love it" "I hate it") a) (\b c -> ("I hate that " ++) (iF (((== 0) . (`mod` 2)) b) c (("I love that " ++) ((\n_6989586621679050168 -> iF ((n_6989586621679050168 `mod` 2) == 0) "I love it" "I hate it") b))))
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-11-24 20:17:12.017523452 UTC
import Data.Maybe
import Control.Monad
import Text.Read
nat_para :: Integral i => i -> a -> (i -> a -> a) -> a
nat_para i x f = np (abs i)
             where np 0 = x
                   np i = let i' = i - 1
                           in f i' (np i')
hd :: [a] -> a
hd ([]) = error "empty head"
hd (a : as) = a
tl = drop 1
nat_cata :: Integral i => i -> a -> (a -> a) -> a
nat_cata i x f = nc (abs i)
             where nc 0 = x
                   nc i = f (nc (i - 1))
iF :: Bool -> a -> a -> a
iF (True) t f = t
iF (False) t f = f
list_para :: [b] -> a -> (b -> [b] -> a -> a) -> a
list_para ([]) x f = x
list_para (y : ys) x f = f y ys (list_para ys x f)
magiciF :: Bool -> String
magiciF b = if b then "EASY" else "HARD"
uncurry' = id
parser :: String -> Int
parser = read
solve = \a -> nat_para (flip (-) 1 a) ((\n_6989586621679051904 -> iF ((n_6989586621679051904 `mod` 2) == 0) "I love it" "I hate it") a) (\b c -> ("I hate that " ++) (nat_para b c (\_ _ -> ("I love that " ++) ((\n_6989586621679051904 -> iF ((n_6989586621679051904 `mod` 2) == 0) "I love it" "I hate it") a))))
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-11-24 19:44:21.332259381 UTC
import Data.Maybe
import Control.Monad
import Text.Read
nat_para :: Integral i => i -> a -> (i -> a -> a) -> a
nat_para i x f = np (abs i)
             where np 0 = x
                   np i = let i' = i - 1
                           in f i' (np i')
hd :: [a] -> a
hd ([]) = error "empty head"
hd (a : as) = a
tl = drop 1
nat_cata :: Integral i => i -> a -> (a -> a) -> a
nat_cata i x f = nc (abs i)
             where nc 0 = x
                   nc i = f (nc (i - 1))
iF :: Bool -> a -> a -> a
iF (True) t f = t
iF (False) t f = f
list_para :: [b] -> a -> (b -> [b] -> a -> a) -> a
list_para ([]) x f = x
list_para (y : ys) x f = f y ys (list_para ys x f)
magiciF :: Bool -> String
magiciF b = if b then "EASY" else "HARD"
uncurry' = id
parser :: String -> Int
parser = read
solve = \a -> nat_para (flip (-) 1 a) ((\n_6989586621679050238 -> iF ((n_6989586621679050238 `mod` 2) == 0) "I love it" "I hate it") a) (\b c -> ("I hate that " ++) (iF (((== 0) . (`mod` 2)) b) c (("I love that " ++) ((\n_6989586621679050238 -> iF ((n_6989586621679050238 `mod` 2) == 0) "I love it" "I hate it") b))))
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-11-24 19:43:28.27093953 UTC
import Data.Maybe
import Control.Monad
import Text.Read
nat_para :: Integral i => i -> a -> (i -> a -> a) -> a
nat_para i x f = np (abs i)
             where np 0 = x
                   np i = let i' = i - 1
                           in f i' (np i')
hd :: [a] -> a
hd ([]) = error "empty head"
hd (a : as) = a
tl = drop 1
nat_cata :: Integral i => i -> a -> (a -> a) -> a
nat_cata i x f = nc (abs i)
             where nc 0 = x
                   nc i = f (nc (i - 1))
iF :: Bool -> a -> a -> a
iF (True) t f = t
iF (False) t f = f
list_para :: [b] -> a -> (b -> [b] -> a -> a) -> a
list_para ([]) x f = x
list_para (y : ys) x f = f y ys (list_para ys x f)
magiciF :: Bool -> String
magiciF b = if b then "EASY" else "HARD"
uncurry' = id
parser :: String -> Int
parser = read
solve = \a -> nat_para (flip (-) 1 a) ((\n_6989586621679050238 -> iF ((n_6989586621679050238 `mod` 2) == 0) "I love it" "I hate it") a) (\b c -> ("I hate that " ++) (iF (((== 0) . (`mod` 2)) b) c (("I love that " ++) ((\n_6989586621679050238 -> iF ((n_6989586621679050238 `mod` 2) == 0) "I love it" "I hate it") b))))
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-11-24 20:08:12.229883881 UTC
import Data.Maybe
import Control.Monad
import Text.Read
nat_para :: Integral i => i -> a -> (i -> a -> a) -> a
nat_para i x f = np (abs i)
             where np 0 = x
                   np i = let i' = i - 1
                           in f i' (np i')
hd :: [a] -> a
hd ([]) = error "empty head"
hd (a : as) = a
tl = drop 1
nat_cata :: Integral i => i -> a -> (a -> a) -> a
nat_cata i x f = nc (abs i)
             where nc 0 = x
                   nc i = f (nc (i - 1))
iF :: Bool -> a -> a -> a
iF (True) t f = t
iF (False) t f = f
list_para :: [b] -> a -> (b -> [b] -> a -> a) -> a
list_para ([]) x f = x
list_para (y : ys) x f = f y ys (list_para ys x f)
magiciF :: Bool -> String
magiciF b = if b then "EASY" else "HARD"
uncurry' = id
parser :: String -> Int
parser = read
solve = \a -> nat_para (flip (-) 1 a) ((\n_6989586621679051947 -> iF ((n_6989586621679051947 `mod` 2) == 0) "I love it" "I hate it") a) (\b c -> ("I hate that " ++) (nat_para b c (\_ _ -> ("I love that " ++) ((\n_6989586621679051947 -> iF ((n_6989586621679051947 `mod` 2) == 0) "I love it" "I hate it") a))))
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-11-14 21:32:41.179068145 UTC
import Data.Maybe
import Control.Monad
import Text.Read
nat_para :: Integral i => i -> a -> (i -> a -> a) -> a
nat_para i x f = np (abs i)
             where np 0 = x
                   np i = let i' = i - 1
                           in f i' (np i')
hd :: [a] -> a
hd ([]) = error "empty head"
hd (a : as) = a
tl = drop 1
nat_cata :: Integral i => i -> a -> (a -> a) -> a
nat_cata i x f = nc (abs i)
             where nc 0 = x
                   nc i = f (nc (i - 1))
iF :: Bool -> a -> a -> a
iF (True) t f = t
iF (False) t f = f
list_para :: [b] -> a -> (b -> [b] -> a -> a) -> a
list_para ([]) x f = x
list_para (y : ys) x f = f y ys (list_para ys x f)
magiciF :: Bool -> String
magiciF b = if b then "EASY" else "HARD"
uncurry' = id
parser :: String -> Int
parser = read
solve = \a -> nat_para (flip (-) 1 a) ((\n_6989586621679121131 -> iF ((n_6989586621679121131 `mod` 2) == 0) "I love it" "I hate it") a) (\b c -> ("I hate that " ++) (iF (((== 0) . (`mod` 2)) b) c (("I love that " ++) ((\n_6989586621679121131 -> iF ((n_6989586621679121131 `mod` 2) == 0) "I love it" "I hate it") b))))
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-11-24 20:40:14.555540688 UTC
import Data.Maybe
import Control.Monad
import Text.Read
nat_para :: Integral i => i -> a -> (i -> a -> a) -> a
nat_para i x f = np (abs i)
             where np 0 = x
                   np i = let i' = i - 1
                           in f i' (np i')
hd :: [a] -> a
hd ([]) = error "empty head"
hd (a : as) = a
tl = drop 1
nat_cata :: Integral i => i -> a -> (a -> a) -> a
nat_cata i x f = nc (abs i)
             where nc 0 = x
                   nc i = f (nc (i - 1))
iF :: Bool -> a -> a -> a
iF (True) t f = t
iF (False) t f = f
list_para :: [b] -> a -> (b -> [b] -> a -> a) -> a
list_para ([]) x f = x
list_para (y : ys) x f = f y ys (list_para ys x f)
magiciF :: Bool -> String
magiciF b = if b then "EASY" else "HARD"
uncurry' = id
parser :: String -> Int
parser = read
solve = \a -> nat_para (flip (-) 1 a) ((\n_6989586621679051752 -> iF ((n_6989586621679051752 `mod` 2) == 0) "I love it" "I hate it") a) (\b c -> ("I hate that " ++) (iF (((== 0) . (`mod` 2)) b) c (("I love that " ++) ((\n_6989586621679051752 -> iF ((n_6989586621679051752 `mod` 2) == 0) "I love it" "I hate it") b))))
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-11-24 20:27:10.184609196 UTC
import Data.Maybe
import Control.Monad
import Text.Read
nat_para :: Integral i => i -> a -> (i -> a -> a) -> a
nat_para i x f = np (abs i)
             where np 0 = x
                   np i = let i' = i - 1
                           in f i' (np i')
hd :: [a] -> a
hd ([]) = error "empty head"
hd (a : as) = a
tl = drop 1
nat_cata :: Integral i => i -> a -> (a -> a) -> a
nat_cata i x f = nc (abs i)
             where nc 0 = x
                   nc i = f (nc (i - 1))
iF :: Bool -> a -> a -> a
iF (True) t f = t
iF (False) t f = f
list_para :: [b] -> a -> (b -> [b] -> a -> a) -> a
list_para ([]) x f = x
list_para (y : ys) x f = f y ys (list_para ys x f)
magiciF :: Bool -> String
magiciF b = if b then "EASY" else "HARD"
uncurry' = id
parser :: String -> Int
parser = read
solve = \a -> nat_para (flip (-) 1 a) ((\n_6989586621679051903 -> iF ((n_6989586621679051903 `mod` 2) == 0) "I love it" "I hate it") a) (\b c -> ("I hate that " ++) (nat_para b c (\_ _ -> ("I love that " ++) ((\n_6989586621679051903 -> iF ((n_6989586621679051903 `mod` 2) == 0) "I love it" "I hate it") a))))
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-11-24 20:33:27.153758054 UTC
import Data.Maybe
import Control.Monad
import Text.Read
nat_para :: Integral i => i -> a -> (i -> a -> a) -> a
nat_para i x f = np (abs i)
             where np 0 = x
                   np i = let i' = i - 1
                           in f i' (np i')
hd :: [a] -> a
hd ([]) = error "empty head"
hd (a : as) = a
tl = drop 1
nat_cata :: Integral i => i -> a -> (a -> a) -> a
nat_cata i x f = nc (abs i)
             where nc 0 = x
                   nc i = f (nc (i - 1))
iF :: Bool -> a -> a -> a
iF (True) t f = t
iF (False) t f = f
list_para :: [b] -> a -> (b -> [b] -> a -> a) -> a
list_para ([]) x f = x
list_para (y : ys) x f = f y ys (list_para ys x f)
magiciF :: Bool -> String
magiciF b = if b then "EASY" else "HARD"
uncurry' = id
parser :: String -> Int
parser = read
solve = \a -> nat_para (flip (-) 1 a) ((\n_6989586621679051903 -> iF ((n_6989586621679051903 `mod` 2) == 0) "I love it" "I hate it") a) (\b c -> ("I hate that " ++) (iF (((== 0) . (`mod` 2)) b) c (("I love that " ++) ((\n_6989586621679051903 -> iF ((n_6989586621679051903 `mod` 2) == 0) "I love it" "I hate it") b))))
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-11-24 19:49:16.331063502 UTC
import Data.Maybe
import Control.Monad
import Text.Read
nat_para :: Integral i => i -> a -> (i -> a -> a) -> a
nat_para i x f = np (abs i)
             where np 0 = x
                   np i = let i' = i - 1
                           in f i' (np i')
hd :: [a] -> a
hd ([]) = error "empty head"
hd (a : as) = a
tl = drop 1
nat_cata :: Integral i => i -> a -> (a -> a) -> a
nat_cata i x f = nc (abs i)
             where nc 0 = x
                   nc i = f (nc (i - 1))
iF :: Bool -> a -> a -> a
iF (True) t f = t
iF (False) t f = f
list_para :: [b] -> a -> (b -> [b] -> a -> a) -> a
list_para ([]) x f = x
list_para (y : ys) x f = f y ys (list_para ys x f)
magiciF :: Bool -> String
magiciF b = if b then "EASY" else "HARD"
uncurry' = id
parser :: String -> Int
parser = read
solve = \a -> nat_para (flip (-) 1 a) ((\n_6989586621679050238 -> iF ((n_6989586621679050238 `mod` 2) == 0) "I love it" "I hate it") a) (\b c -> ("I hate that " ++) (nat_para b c (\_ _ -> ("I love that " ++) ((\n_6989586621679050238 -> iF ((n_6989586621679050238 `mod` 2) == 0) "I love it" "I hate it") a))))
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-11-24 20:53:48.546217396 UTC
import Data.Maybe
import Control.Monad
import Text.Read
nat_para :: Integral i => i -> a -> (i -> a -> a) -> a
nat_para i x f = np (abs i)
             where np 0 = x
                   np i = let i' = i - 1
                           in f i' (np i')
hd :: [a] -> a
hd ([]) = error "empty head"
hd (a : as) = a
tl = drop 1
nat_cata :: Integral i => i -> a -> (a -> a) -> a
nat_cata i x f = nc (abs i)
             where nc 0 = x
                   nc i = f (nc (i - 1))
iF :: Bool -> a -> a -> a
iF (True) t f = t
iF (False) t f = f
list_para :: [b] -> a -> (b -> [b] -> a -> a) -> a
list_para ([]) x f = x
list_para (y : ys) x f = f y ys (list_para ys x f)
magiciF :: Bool -> String
magiciF b = if b then "EASY" else "HARD"
uncurry' = id
parser :: String -> Int
parser = read
solve = \a -> nat_para (flip (-) 1 a) ((\n_6989586621679051752 -> iF ((n_6989586621679051752 `mod` 2) == 0) "I love it" "I hate it") a) (\b c -> ("I hate that " ++) (nat_para b c (\_ _ -> ("I love that " ++) ((\n_6989586621679051752 -> iF ((n_6989586621679051752 `mod` 2) == 0) "I love it" "I hate it") a))))
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- Vicfred
-- https://codeforces.com/problemset/problem/705/A

hate :: Int -> String
hate 1 = "I hate it"
hate n = "I hate that " ++ love (n-1)

love :: Int -> String
love 1 = "I love it"
love n = "I love it that " ++ hate (n-1)

main :: IO ()
main = readLn >>= putStrLn . hate

main = do
    x <- getLine
    if x == "1" then putStrLn "I hate it"
    else if x == "2" then putStrLn "I hate that I love it"
    else putStrLn "I hate that I love that I hate it"

main = do
 n <- getLine
 mapM_ putStr $ (take.read $ n) $ iterate (\str -> if str == "I love that " then "I hate that " else "I love that ") "I hate that "

main = do
 n <- getLine
 mapM_ putStr $ (take.read $ n) $ iterate (\str -> if str == "I hate " then "that I love " else "that I hate ") "I hate "
 putStr "it"

import Data.List
import System.IO

parseLine :: IO [String]
parseLine = fmap words getLine

parseInt :: IO [Int]
parseInt = fmap (map read . words) getLine

parseDouble :: IO [Double]
parseDouble = fmap (map read . words) getLine

solve :: Int -> Bool -> String
solve n isHate = if (n == 1) then (if isHate then "I hate it" else "I love it")
                 else (if isHate then "I hate that " else "I love that") ++  (solve (n - 1) (not isHate))

main :: IO ()
main = do
  [n] <- parseInt

  putStrLn $ solve n True

import Control.Applicative
import Control.Monad
import Data.List

type I = Int

main :: IO ()
main = do
  n <- readi <$> getLine
  putStrLn $ solve n

solve :: Int -> String
solve n = intercalate " that " (map (\x -> if odd x then "I hate" else "I love") $ reverse [1..n]) ++ " it"

--  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --

readi :: String -> I
readi = read

toTuple :: [a] -> (a, a)
toTuple [x, y] = (x, y)

toTriple :: [a] -> (a, a, a)
toTriple [x, y, z] = (x, y, z)

phrases :: [String]
phrases = ["love", "hate"]

hulkSpeak :: Int -> String
hulkSpeak 0 = " it"
hulkSpeak x = " that I " ++ (phrases !! (x`mod`2)) ++ hulkSpeak (x-1)

main = do
  x <- readLn :: IO Int
  putStrLn ("I hate" ++ hulkSpeak (x-1))

phrases :: [String]
phrases = ["hate ", "love "]

hulkSpeak :: Int -> String
hulkSpeak 0 = "it"
hulkSpeak x = "I " ++ phrase ++ hulkSpeak (x-1)
  where
    phrase = if x > 1
      then phrases !! (x`mod`2) ++ "that "
      else phrases !! (x`mod`2)

main = do
  x <- readLn :: IO Int
  putStrLn $ hulkSpeak x

solve :: Int -> String
solve 1 = "I hate it"
solve x
    | even x = "I love that " ++ solve (x - 1)
    | otherwise = "I hate that " ++ solve (x - 1)

main :: IO ()
main = putStrLn =<< solve . (read :: String -> Int) <$> getLine

process :: Int -> String
process source
    | mod source 2 == 1 = "I hate it"
    | mod source 2 == 0 = "I love it"

main :: IO ()
main = do
  text <- getLine
  let count = read text
  let result = unwords $ map process [1..count]
  putStrLn (show result)

process :: Int -> String
process source
    | mod source 2 == 1 = "I hate it"
    | mod source 2 == 0 = "I love it"

main :: IO ()
main = do
  text <- getLine
  let count = read text
  let result = unwords $ map process [1..count]
  putStrLn result

import Data.List
main :: IO ()
main = do
        interact $ show . express . read

express :: Int -> String
express n = (intercalate " that " feelings) ++ " it"
    where feelings = fmap (\i -> if odd i then "I hate" else "I love") [1..n]


Vasya collects coins: he has exactly one coin for every year from 1 to n. Naturally, Vasya keeps all the coins in his collection in the order in which they were released. Once Vasya's younger brother made a change — he took all the coins whose release year dated from l to r inclusively and put them in the reverse order. That is, he took a certain segment [l, r] and reversed it. At that the segment's endpoints did not coincide. For example, if n = 8, then initially Vasya's coins were kept in the order 1 2 3 4 5 6 7 8. If Vasya's younger brother chose the segment [2, 6], then after the reversal the coin order will change to 1 6 5 4 3 2 7 8. Vasya suspects that someone else could have spoilt the permutation after his brother. Help him to find that out. Check if the given permutation can be obtained from the permutation 1 2 ... n using exactly one segment reversal. If it is possible, find the segment itself.

The first line contains an integer n (1 ≤ n ≤ 1000) which is the number of coins in Vasya's collection. The second line contains space-separated n integers which are the spoilt sequence of coins. It is guaranteed that the given sequence is a permutation, i.e. it contains only integers from 1 to n, and every number is used exactly 1 time.

If it is impossible to obtain the given permutation from the original one in exactly one action, print 0 0. Otherwise, print two numbers l r (1 ≤ l < r ≤ n) which are the endpoints of the segment that needs to be reversed to obtain from permutation 1 2 ... n the given one.

main = do interact (unwords . map show . gao . map read . tail . words)

gao a = if not (null b) && b == r c then [head c, last c] else [0, 0] where
	r = reverse
	f = r . dropWhile (uncurry (==))
	(b, c) = unzip $ f . f $ zip a [1 ..]

prob :: [Int] -> Int -> Maybe (Int, Int)
prob [] _ = Nothing
prob (x:xs) n
	| x == n = prob xs $ n+1
	| x < n = Nothing
	| otherwise = Just (n, x)

maybe_reverse :: [Int] -> Maybe (Int, Int) -> [Int]
maybe_reverse xs Nothing = []
maybe_reverse xs (Just (x, y)) =
	take (x-1) xs ++ (reverse $ take (y-x+1) $ drop (x-1) xs) ++ (drop y xs)

maybe_puts :: Maybe String -> IO ()
maybe_puts Nothing = return ()
maybe_puts (Just str) = putStrLn str

main = do
	n <- getLine >>= return . read :: IO Int
	lst <- getLine >>= return . (map read) . words :: IO [Int]
	if maybe_reverse lst (prob lst 1) == [1..n]
		then maybe_puts $ prob lst 1 >>= \(x, y) -> Just $ (show x) ++ " " ++ (show y)
		else putStrLn "0 0"

import Control.Applicative
import Text.Printf
import Data.Maybe
import Data.List

solve :: [Int] -> Maybe (Int, Int)
solve arr | (not$ null ix) && (and$ zipWith (<) arr' (tail arr')) = Just(l+1, r+1)
          | otherwise = Nothing
  where
    gs = zipWith (<) arr (tail arr)
    ix = elemIndices False gs
    l = head ix
    r = (last ix)+1
    arr' = (take l arr) ++
           (reverse$ take (r-l+1) $ drop l arr) ++
           (drop (r+1) arr)

main = do
  getLine
  arr <- (map read . words) <$> getLine
  case solve arr of
    Just (l, r) -> putStrLn (printf "%d %d" l r)
    Nothing -> putStrLn "0 0"

import Data.List

-- some readers
readInt :: String -> Int
readInt = read

readLL :: String -> [Int]
readLL = (map read) . words

-- main function
main = do
    n <- getLine >>= return . readInt
    xs <- getLine >>= return . readLL
    printRes $ solve n xs where

    solve n xs = case findIndex (\(x, y) -> y>x) pairs of
        Nothing -> [0, 0]
        Just b  -> case findIndex (\(x, y) -> y<x) (reverse pairs) of
            Nothing -> [0, 0]
            Just e  -> if (take b xs ++ reverse (drop b (take (n-e) xs)) ++ drop (n-e) xs) == [1..n]
                then [(b+1), (n-e)]
                else [0, 0]
        where
            pairs = zip [1..n] xs
    printRes [a, b] = putStrLn $ show a ++ " " ++ show b

import Maybe (fromMaybe)
import Monad (liftM)

solve :: [(Int, Int)] -> Maybe (Int, Int)
solve []  =  Nothing
solve ((n, x):xs)
  | n == x  =  solve xs
  | otherwise  =  solve2 (n,x) xs
  where
    solve2 _ []  =  Nothing
    solve2 (n,x) ((m,y):ys)
      | n + x /= m + y  =  Nothing
      | y == n  =  solve3 (n, m) ys
      | otherwise  =  solve2 (n, x) ys
    solve3 (n, m) []  =  Just (n, m)
    solve3 (n, m) ((k, z):zs)
      | k == z  =  solve3 (n, m) zs
      | otherwise  =  Nothing

main :: IO ()
main  =  do
    getLine
    xs  <-  liftM (map read . words) getLine
    let (a, b)  =  fromMaybe (0, 0) $ solve $ zip [1..] xs
    putStrLn $ show a ++ " " ++ show b

solve (n:xs) = (show a) ++ " " ++ (show b)
  where (a, b) = if origin == reverse rev && (not $ null origin) then
                   (head origin, last origin)
                 else
                   (0, 0)
        (origin, rev) = unzip $ filter (\(x, y) -> x /= y) $ zip [1..n] xs

main = interact (solve.map read.words)

import Prelude
import Data.Char
import Data.List
import Data.Functor

main = interact q

q = func . tail . map read . words

func::[Int]->String
func x = case solve x of
           Just (a, b) -> (show a) ++ " " ++ (show b)
           Nothing-> "Error occurred"

fileInteract func inf ouf = do file <- readFile inf
                               writeFile ouf (func file)

toInt::String->Int
toInt = read

asInteger::String->Integer
asInteger = read

toString::Int->String
toString = show

reverseTuple::(a,b)->(b,a)
reverseTuple (a,b) = (b,a)

isVailed::String->Bool
isVailed "" = False
isVailed "0" = True
isVailed ('0':_) = False
isVailed _ = True

solve::[Int]->Maybe (Int, Int)
solve [] = Just (0, 0)
solve a  = Just $ s' 0 a

s'::Int->[Int]->(Int, Int)
s' _ []     = (0, 0)
s' n (x:xs) | n + 1 == x = s' x xs
            | otherwise  = if left == -1 then (0,0)
                           else (left, x)
            where
              left = s'' x xs

s''::Int->[Int]->Int
s'' n []                     = n
s'' n (x:xs) | n - 1 == x    = s'' x xs
             | sorted (x:xs) = n
             | otherwise     = -1

sorted::[Int]->Bool
sorted []     = True
sorted (a:[]) = True
sorted (a:b:xs) | a + 1 == b = sorted (b:xs)
                | otherwise  = False

main = do getLine
          a <- fmap (map read . words) getLine
          let n = length a
              lst = [i | i<-[0..n-1], a!!i /= i+1]
              (i,j) = (head lst, last lst)
              swap i j a = take i a ++ reverse(take (j-i+1) (drop i a)) ++ drop (j+1) a
          if null lst
             then putStrLn "0 0"
             else if swap i j a == [1..n]
                     then putStrLn $ show (i+1) ++ " " ++ show (j+1)
                     else putStrLn "0 0"

main = do interact (unwords . map show . gao . map read . tail . words)

gao a = if not (null b) && b == r c then [head b, head c] else [0, 0] where
	r = reverse
	f = r . dropWhile (uncurry (==))
	(b, c) = unzip $ f . f $ zip a [1 ..]

import Control.Applicative
import Text.Printf
import Data.Maybe
import Data.List

solve :: [Int] -> Maybe (Int, Int)
solve arr | and$ take (r-l+1)$ drop l gs  = Nothing
          | otherwise = Just (l, r)
  where
    gs = zipWith (<) arr (tail arr)
    ix = elemIndices False gs
    nd = length$ group gs
    l = head ix
    r = (last ix)+1

main = do
  getLine
  arr <- (map read . words) <$> getLine
  case solve arr of
    Just (l, r) -> putStrLn (printf "%d %d" l r)
    Nothing -> putStrLn "0 0"

import Prelude
import Data.Char
import Data.List
import Data.Functor

main = interact q

q = func . tail . map read . words

func::[Int]->String
func x = case solve x of
           Just (a, b) -> (show a) ++ " " ++ (show b)
           Nothing-> "Error occurred"

fileInteract func inf ouf = do file <- readFile inf
                               writeFile ouf (func file)

toInt::String->Int
toInt = read

asInteger::String->Integer
asInteger = read

toString::Int->String
toString = show

reverseTuple::(a,b)->(b,a)
reverseTuple (a,b) = (b,a)

isVailed::String->Bool
isVailed "" = False
isVailed "0" = True
isVailed ('0':_) = False
isVailed _ = True

solve::[Int]->Maybe (Int, Int)
solve [] = Just (0, 0)
solve a  = Just $ s' 0 a

s'::Int->[Int]->(Int, Int)
s' _ []     = (0, 0)
s' n (x:xs) | n + 1 == x = s' x xs
            | otherwise  = if left == -1 then (0,0)
                           else (left, n)
            where
              left = s'' x xs

s''::Int->[Int]->Int
s'' n []                     = n
s'' n (x:xs) | n - 1 == x    = s'' x xs
             | sorted (x:xs) = n
             | otherwise     = -1

sorted::[Int]->Bool
sorted []     = True
sorted (a:[]) = True
sorted (a:b:xs) | a + 1 == b = sorted (b:xs)
                | otherwise  = False


Stepan likes to repeat vowel letters when he writes words. For example, instead of the word "pobeda" he can write "pobeeeedaaaaa".Sergey does not like such behavior, so he wants to write a program to format the words written by Stepan. This program must combine all consecutive equal vowels to a single vowel. The vowel letters are "a", "e", "i", "o", "u" and "y".There are exceptions: if letters "e" or "o" repeat in a row exactly 2 times, like in words "feet" and "foot", the program must skip them and do not transform in one vowel. For example, the word "iiiimpleeemeentatiioon" must be converted to the word "implemeentatioon".Sergey is very busy and asks you to help him and write the required program.

The first line contains the integer n (1 ≤ n ≤ 100 000) — the number of letters in the word written by Stepan. The second line contains the string s which has length that equals to n and contains only lowercase English letters — the word written by Stepan.

Print the single string — the word written by Stepan converted according to the rules described in the statement.

pobeda implemeentatioon aeiouyaeeioouy aoiuyeggghhh

convert x (y:"") = y:""

convert True s@(a1:a2:"") = if a1 == a2 && (a1 == 'a' || a1 == 'e' || a1 == 'i' || a1 == 'o' || a1 == 'u' || a1 == 'y') then a1:"" else s
convert False s@(a1:a2:"") = if a1 /= a2 || (a1 == 'o' || a1 == 'e') || (not (a1 == 'a' || a1 == 'e' || a1 == 'i' || a1 == 'o' || a1 == 'u' || a1 == 'y')) then s else a1:""

convert True (a:b:c) = if a == b && (a == 'a' || a == 'e' || a == 'i' || a == 'o' || a == 'u' || a == 'y') then convert True (b:c) else a:(convert False (b:c))
convert False s@(a:b:c:d)
    | a == b && a == c && (a == 'a' || a == 'e' || a == 'i' || a == 'o' || a == 'u' || a == 'y') = convert True (b:c:d)
    | a == b && a /= c && (a == 'a' || a == 'e' || a == 'i' || a == 'o' || a == 'u' || a == 'y') = if (a == 'o' || a == 'e') then a:b:(convert False (c:d)) else a:(convert False (c:d))
--    | otherwise = traceShow s $ undefined

convert x (y:ys) = y:(convert False ys)

solve n s = convert False s

main = do
    n <- getLine
    s <- getLine
    putStrLn $ solve (read n :: Int) s

import Data.List
main = interact $ process . last . lines

process x = concat$ map test $ group x

test x
  | notElem (head x) "aeiouy" = x
  | (head x == 'o') && (length x < 3) = x
  | (head x == 'e') && (length x < 3) = x
  | otherwise = [head x]

--ghc 7.10

import Data.List

t ['e', 'e'] = "ee"
t ['o', 'o'] = "oo"
t ('u':_) = ['u']
t ('y':_) = ['y']
t ('a':_) = ['a']
t ('i':_) = ['i']
t ('e':_) = ['e']
t ('o':_) = ['o']
t x = x

transform :: String -> String
transform s = concat (map t (group  s))

main = do
  n <- getLine
  s <- getLine
  --print (group s)
  putStrLn $ transform s

convert True (a:b:c) = if a == b then convert True (b:c) else convert False (a:b:c)
convert False (a:b:c:d) = if a == b && a == c then convert True (b:c:d) else a:(convert False (b:c:d))
convert x s = s

solve n s = convert False s

main = do
    n <- getLine
    s <- getLine
    putStrLn $ solve (read n :: Int) s

convert x (y:"") = y:""

convert True s@(a1:a2:"") = if a1 == a2 then a1:"" else s
convert False s@(a1:a2:"") = if a1 /= a2 || (a1 == 'o' || a1 == 'e') then s else a1:""

convert True (a:b:c) = if a == b then convert True (b:c) else a:(convert False (b:c))
convert False s@(a:b:c:d)
    | a == b && a == c = convert True (b:c:d)
    | a == b && a /= c = if (a == 'o' || a == 'e') then a:b:(convert False (c:d)) else a:(convert False (c:d))
--    | otherwise = traceShow s $ undefined

convert x (y:ys) = y:(convert False ys)

solve n s = convert False s

main = do
    n <- getLine
    s <- getLine
    putStrLn $ solve (read n :: Int) s


This is the easy version of the problem. The only difference is that in this version $$$q = 1$$$.You are given an array of integers $$$a_1, a_2, \ldots, a_n$$$.The cost of a subsegment of the array $$$[l, r]$$$, $$$1 \leq l \leq r \leq n$$$, is the value $$$f(l, r) = \operatorname{sum}(l, r) - \operatorname{xor}(l, r)$$$, where $$$\operatorname{sum}(l, r) = a_l + a_{l+1} + \ldots + a_r$$$, and $$$\operatorname{xor}(l, r) = a_l \oplus a_{l+1} \oplus \ldots \oplus a_r$$$ ($$$\oplus$$$ stands for bitwise XOR).You will have $$$q = 1$$$ query. Each query is given by a pair of numbers $$$L_i$$$, $$$R_i$$$, where $$$1 \leq L_i \leq R_i \leq n$$$. You need to find the subsegment $$$[l, r]$$$, $$$L_i \leq l \leq r \leq R_i$$$, with maximum value $$$f(l, r)$$$. If there are several answers, then among them you need to find a subsegment with the minimum length, that is, the minimum value of $$$r - l + 1$$$.

Each test consists of multiple test cases. The first line contains an integer $$$t$$$ ($$$1 \leq t \leq 10^4$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains two integers $$$n$$$ and $$$q$$$ ($$$1 \leq n \leq 10^5$$$, $$$q = 1$$$) — the length of the array and the number of queries. The second line of each test case contains $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ ($$$0 \leq a_i \leq 10^9$$$) — array elements. $$$i$$$-th of the next $$$q$$$ lines of each test case contains two integers $$$L_i$$$ and $$$R_i$$$ ($$$1 \leq L_i \leq R_i \leq n$$$) — the boundaries in which we need to find the segment. It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$2 \cdot 10^5$$$. It is guaranteed that $$$L_1 = 1$$$ and $$$R_1 = n$$$.

For each test case print $$$q$$$ pairs of numbers $$$L_i \leq l \leq r \leq R_i$$$ such that the value $$$f(l, r)$$$ is maximum and among such the length $$$r - l + 1$$$ is minimum. If there are several correct answers, print any of them.

NoteIn the first test case, $$$f(1, 1) = 0 - 0 = 0$$$.In the second test case, $$$f(1, 1) = 5 - 5 = 0$$$, $$$f(2, 2) = 10 - 10 = 0$$$. Note that $$$f(1, 2) = (10 + 5) - (10 \oplus 5) = 0$$$, but we need to find a subsegment with the minimum length among the maximum values of $$$f(l, r)$$$. So, only segments $$$[1, 1]$$$ and $$$[2, 2]$$$ are the correct answers.In the fourth test case, $$$f(2, 3) = (12 + 8) - (12 \oplus 8) = 16$$$. There are two correct answers in the fifth test case, since $$$f(2, 3) = f(3, 4)$$$ and their lengths are equal.

{-# LANGUAGE CPP #-}
{-# LANGUAGE BlockArguments #-}
{-# LANGUAGE DatatypeContexts #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NumericUnderscores #-}
{-# LANGUAGE OverloadedStrings #-}
#ifndef DEBUG
{-# LANGUAGE Safe #-}
#endif
{-# LANGUAGE Strict #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TupleSections #-}
{-# OPTIONS_GHC -O3 -funbox-strict-fields -fvia-C -optc-O3 #-}

import Control.Arrow ((>>>))
import Control.Monad (
    MonadPlus (mplus),
    foldM_,
    forM_,
    guard,
    join,
    replicateM,
    replicateM_,
 )
import qualified Control.Monad as M
import qualified Control.Monad.ST.Strict as ST
import qualified Control.Monad.State.Strict as S
import qualified Control.Monad.Trans.Class as T

import qualified Data.Array as A
import qualified Data.Array.MArray.Safe as MA
import qualified Data.Array.IO.Safe as IOA
import qualified Data.Array.ST.Safe as STA
import qualified Data.Array.Unboxed as UA

import Data.Bits
import qualified Data.ByteString.Char8 as B8
import Data.Char
import Data.Int

import Data.Function (on)
import Data.Functor ((<&>))
import Data.Bifunctor (bimap)
import Data.Maybe (fromJust, fromMaybe, isJust)
import qualified Data.Maybe as MB

import qualified Data.IntMap as IM
import qualified Data.IntSet as IS
import qualified Data.List   as L
import Data.List (
    elemIndices,
    find,
    findIndices,
    intersect,
    isPrefixOf,
    nub,
    sort,
    sortOn,
 )
import qualified Data.Map as M
import qualified Data.Set as S
import qualified Data.Ix as Ix
import qualified Data.Ratio as R

import Control.Monad.Cont (MonadIO (liftIO))
import Data.IORef (modifyIORef, newIORef, readIORef)
import GHC.IO.Handle (hDuplicateTo)
import System.IO (
    IOMode (ReadMode, WriteMode),
    openFile,
    stdin,
    stdout,
    hFlush
 )
import System.Posix.Internals (puts)
import Text.Printf (printf)
import qualified Data.Array.IO.Safe as UOA

#ifdef DEBUG
import Debug.Trace (trace, traceM, traceShowM)
debug = flip trace

tracing t x = trace (t ++ " = " ++ show x) x
debugging x t = tracing t x

tracingM t x = traceM $ t ++ " = " ++ show x

#else

debug x _ = x
trace _ x = x
tracing _ x = x
debugging x _ = x

traceM _ = pure ()
tracingM _ _ = pure ()
#endif

readIntB8 :: B8.ByteString -> Int
readIntB8 = B8.readInt >>> (fst . fromJust)

readIntB8s :: B8.ByteString -> [Int]
readIntB8s = B8.words >>> map (B8.readInt >>> (fst . fromJust))

readIntegerB8 :: B8.ByteString -> Integer
readIntegerB8 = B8.readInteger >>> (fst . fromJust)

readIntegerB8s :: B8.ByteString -> [Integer]
readIntegerB8s = B8.words >>> map (B8.readInteger >>> (fst . fromJust))

modifyArray :: (MA.MArray a e m, MA.Ix i) => a i e -> i -> (e -> e) -> m ()
modifyArray arr ix f = do
    value <- MA.readArray arr ix
    MA.writeArray arr ix $ f value

putsYesNo :: Bool -> IO ()
putsYesNo value = do
    let result :: String =
            if value
                then "YES"
                else "NO"
    printf "%s\n" result

{- END OF GENERAL -}

type SolutionState = (Int, UA.Array Int Int, UA.UArray Int Int, UA.UArray Int Int)

preSolve :: Int -> [Int] -> SolutionState
preSolve n as = (n, UA.listArray (1, n) as, prefixSumAs, prefixXorAs)
    where
        prefixSumAs = tracing "prefixSumAs" $ UA.listArray (0, n) . L.scanl (+) 0 $ as
        prefixXorAs = tracing "prefixXorAs" $ UA.listArray (0, n) . L.scanl xor 0 $ as

leftestBinarySearch :: (Int, Int) -> (Int -> Bool) -> Int
leftestBinarySearch (l, r) f = binarySearch' (l, r)
    where
        binarySearch' (l, r) | l == r = l
        binarySearch' (l, r) = if f c
                then binarySearch' (l, c)
                else binarySearch' (c + 1, r)
            where
                c = (l + r) `div` 2

solve :: (Int, Int) -> S.State SolutionState (Int, Int)
solve (l, r) = do
    (_, as, prefixSumAs, prefixXorAs) <- S.get
    let rIndices = trace ("as = " ++ show as) $ tracing "rIndices" $ [l .. r]
        rangeSum l r = tracing "rangeSum" $ trace ("l = " ++ show l ++ ", r = " ++ show r) $ (prefixSumAs UA.! r) - (prefixSumAs UA.! (l - 1))
        rangeXor l r = tracing "rangeSum" $ trace ("l = " ++ show l ++ ", r = " ++ show r) $ (prefixXorAs UA.! r) `xor` (prefixXorAs UA.! (l - 1))
        rangeF l r = tracing "rangeF" $ trace ("l = " ++ show l ++ ", r = " ++ show r) $ rangeSum l r - rangeXor l r

        isRangeGood :: (Int, Int) -> (Int, Int) -> Bool
        isRangeGood (l', r') (l, r) = rangeF l' r' == rangeF l r

        findBestR' :: Int -> Int
        findBestR' l' = leftestBinarySearch (l', r) $ (\r' -> isRangeGood (l', r) (l', r'))
        rankedRanges :: [(Int, (Int, Int))] = tracing "rankedRanges" $ L.map (\(l', r') -> (rangeF l' r', (l', r'))) . L.map (\l' -> (l', findBestR' l')) $ [l .. r]
        answer :: (Int, Int) = snd . L.minimumBy (compare `on` (\(f, (l, r)) -> (f, (r - l + 1), l))) . L.filter (\(f', _) -> f' == rangeF l r) $ rankedRanges

    return $ answer

main :: IO ()
main = do
    t <- B8.getLine <&> readIntB8
    replicateM_ t $ do
        [n, q] <- B8.getLine <&> readIntB8s
        as <- B8.getLine <&> readIntB8s
        let state = preSolve n as
        replicateM_ q $ do
            [l, r] <- B8.getLine <&> readIntB8s
            let (answerL, answerR) = S.evalState (solve (l, r)) state
            printf "%d %d\n" answerL answerR

{-# LANGUAGE CPP #-}
{-# LANGUAGE BlockArguments #-}
{-# LANGUAGE DatatypeContexts #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NumericUnderscores #-}
{-# LANGUAGE OverloadedStrings #-}
#ifndef DEBUG
{-# LANGUAGE Safe #-}
#endif
{-# LANGUAGE Strict #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TupleSections #-}
{-# OPTIONS_GHC -O3 -funbox-strict-fields -fvia-C -optc-O3 #-}

import Control.Arrow ((>>>))
import Control.Monad (
    MonadPlus (mplus),
    foldM_,
    forM_,
    guard,
    join,
    replicateM,
    replicateM_,
 )
import qualified Control.Monad as M
import qualified Control.Monad.ST.Strict as ST
import qualified Control.Monad.State.Strict as S
import qualified Control.Monad.Trans.Class as T

import qualified Data.Array as A
import qualified Data.Array.MArray.Safe as MA
import qualified Data.Array.IO.Safe as IOA
import qualified Data.Array.ST.Safe as STA
import qualified Data.Array.Unboxed as UA

import Data.Bits
import qualified Data.ByteString.Char8 as B8
import Data.Char
import Data.Int

import Data.Function (on)
import Data.Functor ((<&>))
import Data.Bifunctor (bimap)
import Data.Maybe (fromJust, fromMaybe, isJust)
import qualified Data.Maybe as MB

import qualified Data.IntMap as IM
import qualified Data.IntSet as IS
import qualified Data.List   as L
import Data.List (
    elemIndices,
    find,
    findIndices,
    intersect,
    isPrefixOf,
    nub,
    sort,
    sortOn,
 )
import qualified Data.Map as M
import qualified Data.Set as S
import qualified Data.Ix as Ix
import qualified Data.Ratio as R

import Control.Monad.Cont (MonadIO (liftIO))
import Data.IORef (modifyIORef, newIORef, readIORef)
import GHC.IO.Handle (hDuplicateTo)
import System.IO (
    IOMode (ReadMode, WriteMode),
    openFile,
    stdin,
    stdout,
    hFlush
 )
import System.Posix.Internals (puts)
import Text.Printf (printf)
import qualified Data.Array.IO.Safe as UOA

#ifdef DEBUG
import Debug.Trace (trace, traceM, traceShowM)
debug = flip trace

tracing t x = trace (t ++ " = " ++ show x) x
debugging x t = tracing t x

tracingM t x = traceM $ t ++ " = " ++ show x

#else

debug x _ = x
trace _ x = x
tracing _ x = x
debugging x _ = x

traceM _ = pure ()
tracingM _ _ = pure ()
#endif

readIntB8 :: B8.ByteString -> Int
readIntB8 = B8.readInt >>> (fst . fromJust)

readIntB8s :: B8.ByteString -> [Int]
readIntB8s = B8.words >>> map (B8.readInt >>> (fst . fromJust))

readIntegerB8 :: B8.ByteString -> Integer
readIntegerB8 = B8.readInteger >>> (fst . fromJust)

readIntegerB8s :: B8.ByteString -> [Integer]
readIntegerB8s = B8.words >>> map (B8.readInteger >>> (fst . fromJust))

modifyArray :: (MA.MArray a e m, MA.Ix i) => a i e -> i -> (e -> e) -> m ()
modifyArray arr ix f = do
    value <- MA.readArray arr ix
    MA.writeArray arr ix $ f value

putsYesNo :: Bool -> IO ()
putsYesNo value = do
    let result :: String =
            if value
                then "YES"
                else "NO"
    printf "%s\n" result

{- END OF GENERAL -}

type SolutionState = (Int, UA.Array Int Int, UA.UArray Int Int, UA.UArray Int Int)

preSolve :: Int -> [Int] -> SolutionState
preSolve n as = (n, UA.listArray (1, n) as, prefixSumAs, prefixXorAs)
    where
        prefixSumAs = tracing "prefixSumAs" $ UA.listArray (0, n) . L.scanl (+) 0 $ as
        prefixXorAs = tracing "prefixXorAs" $ UA.listArray (0, n) . L.scanl xor 0 $ as

solve :: (Int, Int) -> S.State SolutionState (Int, Int)
solve (l, r) = do
    (_, as, prefixSumAs, prefixXorAs) <- S.get
    let rIndices = trace ("as = " ++ show as) $ tracing "rIndices" $ [l .. r]
        rangeSum l r = tracing "rangeSum" $ trace ("l = " ++ show l ++ ", r = " ++ show r) $ (prefixSumAs UA.! r) - (prefixSumAs UA.! (l - 1))
        rangeXor l r = tracing "rangeSum" $ trace ("l = " ++ show l ++ ", r = " ++ show r) $ (prefixXorAs UA.! r) `xor` (prefixXorAs UA.! (l - 1))
        rangeF l r = tracing "rangeF" $ trace ("l = " ++ show l ++ ", r = " ++ show r) $ rangeSum l r - rangeXor l r
        solve' (l, r)
            | l == r = (l, r)
            | rangeF l (r - 1) == rangeF l r = solve' (l, r - 1)
            | rangeF (l + 1) r == rangeF l r = solve' (l + 1, r)
            | otherwise = (l, r)
        answer = solve' (l, r)

    return $ answer

main :: IO ()
main = do
    t <- B8.getLine <&> readIntB8
    replicateM_ t $ do
        [n, q] <- B8.getLine <&> readIntB8s
        as <- B8.getLine <&> readIntB8s
        let state = preSolve n as
        replicateM_ q $ do
            [l, r] <- B8.getLine <&> readIntB8s
            let (answerL, answerR) = S.evalState (solve (l, r)) state
            printf "%d %d\n" answerL answerR