When preparing a tournament, Codeforces coordinators try treir best to make the first problem as easy as possible. This time the coordinator had chosen some problem and asked $$$n$$$ people about their opinions. Each person answered whether this problem is easy or hard.If at least one of these $$$n$$$ people has answered that the problem is hard, the coordinator decides to change the problem. For the given responses, check if the problem is easy enough.

The first line contains a single integer $$$n$$$ ($$$1 \le n \le 100$$$) — the number of people who were asked to give their opinions. The second line contains $$$n$$$ integers, each integer is either $$$0$$$ or $$$1$$$. If $$$i$$$-th integer is $$$0$$$, then $$$i$$$-th person thinks that the problem is easy; if it is $$$1$$$, then $$$i$$$-th person thinks that the problem is hard.

Print one word: "EASY" if the problem is easy according to all responses, or "HARD" if there is at least one person who thinks the problem is hard.  You may print every letter in any register: "EASY", "easy", "EaSY" and "eAsY" all will be processed correctly.

NoteIn the first example the third person says it's a hard problem, so it should be replaced.In the second example the problem easy for the only person, so it doesn't have to be replaced.

-- 2019-11-23 23:22:29.126971691 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 = fromJust . parseIntListIgnoreSize
parseIntListIgnoreSize :: String -> Maybe ([Int])
parseIntListIgnoreSize i = do {let {ls = lines i};
                               when (length ls /= 2) Nothing;
                               let {[l1, l2] = ls};
                               n <- readMaybe l1 :: Maybe Int;
                               as <- mapM readMaybe $ words l2 :: Maybe ([Int]);
                               when (length as /= n) Nothing;
                               return as}
solve = \a -> list_para a "EASY" (\b _ d -> iF (b == 0) d "HARD")
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

main = do
  nPeople <- (fmap read getLine) :: IO Integer
  responses <- (map read . words) `fmap` getLine :: IO[Integer]
  let sumResponses = foldl (+) 0 responses
  putStrLn $ response sumResponses

response sumResponses
  | sumResponses /= 0 = "hard"
  | otherwise = "easy"

-- 2019-11-23 23:11:49.954360566 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 = fromJust . parseIntListIgnoreSize
parseIntListIgnoreSize :: String -> Maybe ([Int])
parseIntListIgnoreSize i = do {let {ls = lines i};
                               when (length ls /= 2) Nothing;
                               let {[l1, l2] = ls};
                               n <- readMaybe l1 :: Maybe Int;
                               as <- mapM readMaybe $ words l2 :: Maybe ([Int]);
                               when (length as /= n) Nothing;
                               return as}
solve = \a -> list_para a "EASY" (\b _ d -> iF (b == 0) d "HARD")
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-11-23 23:21:56.452908483 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 = fromJust . parseIntListIgnoreSize
parseIntListIgnoreSize :: String -> Maybe ([Int])
parseIntListIgnoreSize i = do {let {ls = lines i};
                               when (length ls /= 2) Nothing;
                               let {[l1, l2] = ls};
                               n <- readMaybe l1 :: Maybe Int;
                               as <- mapM readMaybe $ words l2 :: Maybe ([Int]);
                               when (length as /= n) Nothing;
                               return as}
solve = \a -> list_para a "EASY" (\b _ d -> iF (b == 0) d "HARD")
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

main = do
       e<-getLine
       e2<-getLine
       let xs=map read (words e2)::[Int]
       putStrLn $ if (last (scanl (+) 0 xs)==0) then "EASY" else "HARD"

-- 2019-11-23 23:07:29.980362266 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 = fromJust . parseIntListIgnoreSize
parseIntListIgnoreSize :: String -> Maybe ([Int])
parseIntListIgnoreSize i = do {let {ls = lines i};
                               when (length ls /= 2) Nothing;
                               let {[l1, l2] = ls};
                               n <- readMaybe l1 :: Maybe Int;
                               as <- mapM readMaybe $ words l2 :: Maybe ([Int]);
                               when (length as /= n) Nothing;
                               return as}
solve = \a -> list_para a "EASY" (\b _ d -> iF (b == 0) d "HARD")
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

module Main where

import qualified Data.List as L
import qualified System.IO as SIO

main :: IO ()
main =
  do
    _ <- SIO.getLine
    responses_str <- SIO.getLine
    let responses = L.words responses_str
    let binary_responses = [(read x) | x <- responses] :: [Int]
    let result = sum binary_responses
    case result == 0 of
      True -> putStrLn "EASY"
      False -> putStrLn "HARD"

-- 2019-10-03 02:36:21.881293103 UTC
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] -> Maybe a
hd ([]) = Nothing
hd (x : _) = Just x
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"
parser1 :: String -> (Int, [Int])
parser1 i = (n, as)
            where [l1, l2] = lines i
                  n = read l1
                  as = map read $ words l2
solve = \_ b -> iF (all (\c -> 1 /= c) b) "EASY" "HARD"
main = getContents >>= (\c -> putStrLn (uncurry solve (parser1 c)))

-- 2019-11-24 03:59:30.584799044 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 = fromJust . parseIntListIgnoreSize
parseIntListIgnoreSize :: String -> Maybe ([Int])
parseIntListIgnoreSize i = do {let {ls = lines i};
                               when (length ls /= 2) Nothing;
                               let {[l1, l2] = ls};
                               n <- readMaybe l1 :: Maybe Int;
                               as <- mapM readMaybe $ words l2 :: Maybe ([Int]);
                               when (length as /= n) Nothing;
                               return as}
solve = \a -> foldl (\b c -> iF (0 == c) b "HARD") "EASY" a
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

{-# LANGUAGE BlockArguments #-}

import Control.Arrow

main = do { x <- getLine; input <-getLine; putStrLn (solve (words input)) }

solve :: [String] -> String
solve [] = "easy"
solve ("1":xs) = "hard"
solve ("0":xs) = solve xs

main :: IO ()
main = do
    n <- (read :: String -> Int) <$> getLine
    hard <- (0<) . sum . map (read :: String -> Int) . words <$> getLine
    putStrLn $ if hard then "HARD" else "EASY"

-- 2019-11-13 22:14:19.578138644 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 = fromJust . parse3Input
parse3Input :: String -> Maybe ([Int])
parse3Input i = do {let {ls = lines i};
                    when (length ls /= 2) Nothing;
                    let {[l1, l2] = ls};
                    n <- readMaybe l1 :: Maybe Int;
                    as <- mapM readMaybe $ words l2 :: Maybe ([Int]);
                    when (length as /= n) Nothing;
                    return as}
solve = \a -> list_para a "EASY" (\b _ d -> nat_para b d (\_ _ -> "HARD"))
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-10-06 02:26:11.9000587 UTC
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] -> Maybe a
hd ([]) = Nothing
hd (x : _) = Just x
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"
parser1 :: String -> (Int, [Int])
parser1 i = (n, as)
            where [l1, l2] = lines i
                  n = read l1
                  as = map read $ words l2
solve = \_ b -> list_para b "EASY" (\c _ e -> nat_para c e (\_ _ -> "HARD"))
main = getContents >>= (\c -> putStrLn (uncurry solve (parser1 c)))

-- 2019-11-23 23:24:42.500017037 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 = fromJust . parseIntListIgnoreSize
parseIntListIgnoreSize :: String -> Maybe ([Int])
parseIntListIgnoreSize i = do {let {ls = lines i};
                               when (length ls /= 2) Nothing;
                               let {[l1, l2] = ls};
                               n <- readMaybe l1 :: Maybe Int;
                               as <- mapM readMaybe $ words l2 :: Maybe ([Int]);
                               when (length as /= n) Nothing;
                               return as}
solve = \a -> list_para a "EASY" (\b _ d -> iF (0 == b) d "HARD")
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-11-24 03:56:29.263993491 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 = fromJust . parseIntListIgnoreSize
parseIntListIgnoreSize :: String -> Maybe ([Int])
parseIntListIgnoreSize i = do {let {ls = lines i};
                               when (length ls /= 2) Nothing;
                               let {[l1, l2] = ls};
                               n <- readMaybe l1 :: Maybe Int;
                               as <- mapM readMaybe $ words l2 :: Maybe ([Int]);
                               when (length as /= n) Nothing;
                               return as}
solve = \a -> foldl (\b c -> iF (c == 0) b "HARD") "EASY" a
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-11-23 23:16:19.200716966 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 = fromJust . parseIntListIgnoreSize
parseIntListIgnoreSize :: String -> Maybe ([Int])
parseIntListIgnoreSize i = do {let {ls = lines i};
                               when (length ls /= 2) Nothing;
                               let {[l1, l2] = ls};
                               n <- readMaybe l1 :: Maybe Int;
                               as <- mapM readMaybe $ words l2 :: Maybe ([Int]);
                               when (length as /= n) Nothing;
                               return as}
solve = \a -> list_para a "EASY" (\b _ d -> iF (0 == b) d "HARD")
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-11-04 21:45:21.72355904 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 = fromJust . parse3Input
parse3Input :: String -> Maybe ([Int])
parse3Input i = do {let {ls = lines i};
                    when (length ls /= 2) Nothing;
                    let {[l1, l2] = ls};
                    n <- readMaybe l1 :: Maybe Int;
                    as <- mapM readMaybe $ words l2 :: Maybe ([Int]);
                    when (length as /= n) Nothing;
                    return as}
solve = \a -> list_para a "EASY" (\b _ d -> iF (0 >= b) d "HARD")
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-11-19 21:19:29.624234696 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 = fromJust . parseIntListIgnoreSize
parseIntListIgnoreSize :: String -> Maybe ([Int])
parseIntListIgnoreSize i = do {let {ls = lines i};
                               when (length ls /= 2) Nothing;
                               let {[l1, l2] = ls};
                               n <- readMaybe l1 :: Maybe Int;
                               as <- mapM readMaybe $ words l2 :: Maybe ([Int]);
                               when (length as /= n) Nothing;
                               return as}
solve = \a -> foldl (\b c -> iF ((== 1) c) "HARD" b) "EASY" a
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-10-01 02:38:09.697417264 UTC
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] -> Maybe a
hd ([]) = Nothing
hd (x : _) = Just x
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 :: [a] -> ([a] -> Bool) -> String
magiciF s f = if f s then "EASY" else "HARD"
solve = \a -> magiciF "1" (\b -> all (\c -> c /= b) (tail (words a)))
main = getContents >>= (\c -> putStrLn (solve c))

main = do
  _ <- getLine
  l <- words <$> getLine
  if all (== "0") l
     then putStrLn "EASY"
     else putStrLn "HArD"

-- 2019-11-13 22:13:47.073384219 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 = fromJust . parse3Input
parse3Input :: String -> Maybe ([Int])
parse3Input i = do {let {ls = lines i};
                    when (length ls /= 2) Nothing;
                    let {[l1, l2] = ls};
                    n <- readMaybe l1 :: Maybe Int;
                    as <- mapM readMaybe $ words l2 :: Maybe ([Int]);
                    when (length as /= n) Nothing;
                    return as}
solve = \a -> list_para a "EASY" (\b _ d -> iF (0 >= b) d "HARD")
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-11-23 23:14:50.473602452 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 = fromJust . parseIntListIgnoreSize
parseIntListIgnoreSize :: String -> Maybe ([Int])
parseIntListIgnoreSize i = do {let {ls = lines i};
                               when (length ls /= 2) Nothing;
                               let {[l1, l2] = ls};
                               n <- readMaybe l1 :: Maybe Int;
                               as <- mapM readMaybe $ words l2 :: Maybe ([Int]);
                               when (length as /= n) Nothing;
                               return as}
solve = \a -> list_para a "EASY" (\b _ d -> iF (0 == b) d "HARD")
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

main = do
        input <- getLine
        let n = read input :: Int
        input <- getLine
        let arr = map (read :: String -> Int) $ words input
        putStrLn $ cal arr
        return 0

cal :: [Int] -> String
cal xs
    | l > 0 = "HARD"
    | otherwise = "EASY"
    where l = length $ filter (==1) xs

-- 2019-10-11 20:02:50.923793535 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] -> Maybe a
hd ([]) = Nothing
hd (x : _) = Just x
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 = fromJust . parse3Input
parse3Input :: String -> Maybe ([Int])
parse3Input i = do {let {ls = lines i};
                    when (length ls /= 2) Nothing;
                    let {[l1, l2] = ls};
                    n <- readMaybe l1 :: Maybe Int;
                    as <- mapM readMaybe $ words l2 :: Maybe ([Int]);
                    when (length as /= n) Nothing;
                    return as}
solve = \a -> list_para a "EASY" (\b _ d -> nat_para b d (\_ _ -> "HARD"))
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

main = do
       e<-getLine
       e2<-getLine
       let xs=map read (words e2)::[Int]
       putStrLn $ if (last (scanl (+) 0 xs)==0) then "EASY" else "HARD"

main = do
  _ <- getLine
  l <- words <$> getLine
  if all (== "0") l
     then putStrLn "EASY"
     else putStrLn "HARD"

-- 2019-11-06 21:14:56.242895142 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 = fromJust . parse3Input
parse3Input :: String -> Maybe ([Int])
parse3Input i = do {let {ls = lines i};
                    when (length ls /= 2) Nothing;
                    let {[l1, l2] = ls};
                    n <- readMaybe l1 :: Maybe Int;
                    as <- mapM readMaybe $ words l2 :: Maybe ([Int]);
                    when (length as /= n) Nothing;
                    return as}
solve = \a -> list_para a "EASY" (\b _ d -> iF (0 >= b) d "HARD")
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

main = do
    n <- getLine
    input <- getLine
    let votes = map read $ words input
    putStrLn $ solve votes

solve :: [Integer] -> String
solve votes
    | any (> 0) votes = "HARD"
    | otherwise = "EASY"

-- 2019-11-24 04:00:30.34812506 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 = fromJust . parseIntListIgnoreSize
parseIntListIgnoreSize :: String -> Maybe ([Int])
parseIntListIgnoreSize i = do {let {ls = lines i};
                               when (length ls /= 2) Nothing;
                               let {[l1, l2] = ls};
                               n <- readMaybe l1 :: Maybe Int;
                               as <- mapM readMaybe $ words l2 :: Maybe ([Int]);
                               when (length as /= n) Nothing;
                               return as}
solve = \a -> list_para a "EASY" (\b _ d -> iF (b == 0) d "HARD")
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-11-04 21:43:28.148531088 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 = fromJust . parse3Input
parse3Input :: String -> Maybe ([Int])
parse3Input i = do {let {ls = lines i};
                    when (length ls /= 2) Nothing;
                    let {[l1, l2] = ls};
                    n <- readMaybe l1 :: Maybe Int;
                    as <- mapM readMaybe $ words l2 :: Maybe ([Int]);
                    when (length as /= n) Nothing;
                    return as}
solve = \a -> list_para a "EASY" (\b _ d -> iF (0 >= b) d "HARD")
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

main = do
  samples_input <- getLine
  answers_input <- getLine
  let answers = map (\x -> read x :: Int) (words answers_input)
  let samples = read samples_input :: Int
  let result = min (sum answers) 1
  putStrLn (["EASY", "HARD"] !! result)

-- 2019-10-06 00:35:52.210699935 UTC
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] -> Maybe a
hd ([]) = Nothing
hd (x : _) = Just x
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"
parser1 :: String -> (Int, [Int])
parser1 i = (n, as)
            where [l1, l2] = lines i
                  n = read l1
                  as = map read $ words l2
solve = \_ b -> list_para b "EASY" (\c _ e -> nat_para c e (\_ _ -> "HARD"))
main = getContents >>= (\c -> putStrLn (uncurry solve (parser1 c)))

-- 2019-11-19 21:21:39.785191564 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 = fromJust . parseIntListIgnoreSize
parseIntListIgnoreSize :: String -> Maybe ([Int])
parseIntListIgnoreSize i = do {let {ls = lines i};
                               when (length ls /= 2) Nothing;
                               let {[l1, l2] = ls};
                               n <- readMaybe l1 :: Maybe Int;
                               as <- mapM readMaybe $ words l2 :: Maybe ([Int]);
                               when (length as /= n) Nothing;
                               return as}
solve = \a -> list_para a "EASY" (\b _ d -> iF ((== 1) b) "HARD" d)
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-11-20 20:33:51.019807562 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 = fromJust . parseIntListIgnoreSize
parseIntListIgnoreSize :: String -> Maybe ([Int])
parseIntListIgnoreSize i = do {let {ls = lines i};
                               when (length ls /= 2) Nothing;
                               let {[l1, l2] = ls};
                               n <- readMaybe l1 :: Maybe Int;
                               as <- mapM readMaybe $ words l2 :: Maybe ([Int]);
                               when (length as /= n) Nothing;
                               return as}
solve = \a -> foldl (\b c -> iF (c == 0) b "HARD") "EASY" a
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-11-24 03:55:59.168789309 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 = fromJust . parseIntListIgnoreSize
parseIntListIgnoreSize :: String -> Maybe ([Int])
parseIntListIgnoreSize i = do {let {ls = lines i};
                               when (length ls /= 2) Nothing;
                               let {[l1, l2] = ls};
                               n <- readMaybe l1 :: Maybe Int;
                               as <- mapM readMaybe $ words l2 :: Maybe ([Int]);
                               when (length as /= n) Nothing;
                               return as}
solve = \a -> foldl (\b c -> iF (c == 0) b "HARD") "EASY" a
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

main :: IO ()
main = do
  line <- getLine
  let n = read line :: Int

  line <- getLine
  let a = map read $ words line :: [Int]

  let sum = foldl (+) 0 a

  if sum > 0 then
    putStrLn "HARD"
  else
    putStrLn "EASY"

-- 2019-11-04 21:26:45.273032124 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 = fromJust . parse3Input
parse3Input :: String -> Maybe ([Int])
parse3Input i = do {let {ls = lines i};
                    when (length ls /= 2) Nothing;
                    let {[l1, l2] = ls};
                    n <- readMaybe l1 :: Maybe Int;
                    as <- mapM readMaybe $ words l2 :: Maybe ([Int]);
                    when (length as /= n) Nothing;
                    return as}
solve = \a -> list_para a "EASY" (\b _ d -> nat_para b d (\_ _ -> "HARD"))
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- // hola son las 21:47
main = do
  _ <- getLine
  l <- words <$> getLine
  if all (== "0") l
     then putStrLn "EASY"
     else putStrLn "HARD"

-- import Debug.Trace
-- import System.IO.Unsafe
import System.IO
import Control.Monad

glwr = fmap (map read . words) getLine

main = do
  hSetBuffering stdout NoBuffering
  solve

solve :: IO ()
solve = do
  len:_ <- glwr
  ls    <- glwr
  putStrLn $ easyOrHard len ls

easyOrHard :: Int -> [Int] -> String
easyOrHard len ls
  | sum ls == 0 = "easy"
  | 0 < 1 = "hard"

module Main where

main = do
  _ <- getLine
  gradeLine <- getLine
  putStrLn $ if elem '1' gradeLine then "hard" else "easy"

-- 2019-10-11 21:33:46.798597895 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] -> Maybe a
hd ([]) = Nothing
hd (x : _) = Just x
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 = fromJust . parse3Input
parse3Input :: String -> Maybe ([Int])
parse3Input i = do {let {ls = lines i};
                    when (length ls /= 2) Nothing;
                    let {[l1, l2] = ls};
                    n <- readMaybe l1 :: Maybe Int;
                    as <- mapM readMaybe $ words l2 :: Maybe ([Int]);
                    when (length as /= n) Nothing;
                    return as}
solve = \a -> list_para a "EASY" (\b _ d -> nat_para b d (\_ _ -> "HARD"))
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

import Data.List
import System.IO

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

solve :: [Int] -> String
solve [] = "EASY"
solve a = if (head a) == 1 then "HARD"
          else solve (tail a)

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

  putStrLn $ solve a

main = interact $ (\l -> if any (=='1') ((last . lines) l) then "HARD" else "EASY")

-- 2019-10-11 20:56:21.867772429 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] -> Maybe a
hd ([]) = Nothing
hd (x : _) = Just x
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 = fromJust . parse3Input
parse3Input :: String -> Maybe ([Int])
parse3Input i = do {let {ls = lines i};
                    when (length ls /= 2) Nothing;
                    let {[l1, l2] = ls};
                    n <- readMaybe l1 :: Maybe Int;
                    as <- mapM readMaybe $ words l2 :: Maybe ([Int]);
                    when (length as /= n) Nothing;
                    return as}
solve = \a -> list_para a "EASY" (\b _ d -> nat_para b d (\_ _ -> "HARD"))
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-10-01 04:29:37.043146925 UTC
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] -> Maybe a
hd ([]) = Nothing
hd (x : _) = Just x
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"
solve = \a -> iF (all (\b -> "1" /= b) (tail (words a))) "EASY" "HARD"
main = getContents >>= (\c -> putStrLn (solve c))

main = do
  nPeople <- (fmap read getLine) :: IO Integer
  responses <- (map read . words) `fmap` getLine :: IO[Integer]
  let sumResponses = foldl (+) 0 responses
  putStrLn $ response sumResponses

response sumResponses
  | sumResponses /= 0 = "hard"
  | otherwise = "easy"

-- 2019-11-24 04:01:30.695094706 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 = fromJust . parseIntListIgnoreSize
parseIntListIgnoreSize :: String -> Maybe ([Int])
parseIntListIgnoreSize i = do {let {ls = lines i};
                               when (length ls /= 2) Nothing;
                               let {[l1, l2] = ls};
                               n <- readMaybe l1 :: Maybe Int;
                               as <- mapM readMaybe $ words l2 :: Maybe ([Int]);
                               when (length as /= n) Nothing;
                               return as}
solve = \a -> list_para a "EASY" (\b _ d -> iF (b == 0) d "HARD")
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-11-23 23:10:48.103290576 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 = fromJust . parseIntListIgnoreSize
parseIntListIgnoreSize :: String -> Maybe ([Int])
parseIntListIgnoreSize i = do {let {ls = lines i};
                               when (length ls /= 2) Nothing;
                               let {[l1, l2] = ls};
                               n <- readMaybe l1 :: Maybe Int;
                               as <- mapM readMaybe $ words l2 :: Maybe ([Int]);
                               when (length as /= n) Nothing;
                               return as}
solve = \a -> list_para a "EASY" (\b _ d -> iF (b == 0) d "HARD")
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-10-03 03:47:17.748642904 UTC
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] -> Maybe a
hd ([]) = Nothing
hd (x : _) = Just x
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"
parser1 :: String -> (Int, [Int])
parser1 i = (n, as)
            where [l1, l2] = lines i
                  n = read l1
                  as = map read $ words l2
solve = \_ b -> list_para b "EASY" (\c _ e -> nat_para c e (\_ _ -> "HARD"))
main = getContents >>= (\c -> putStrLn (uncurry solve (parser1 c)))

-- 2019-10-09 21:59:38.79617723 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] -> Maybe a
hd ([]) = Nothing
hd (x : _) = Just x
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 = fromJust . parse3Input
parse3Input :: String -> Maybe ([Int])
parse3Input i = do {let {ls = lines i};
                    when (length ls /= 2) Nothing;
                    let {[l1, l2] = ls};
                    n <- readMaybe l1 :: Maybe Int;
                    as <- mapM readMaybe $ words l2 :: Maybe ([Int]);
                    when (length as /= n) Nothing;
                    return as}
solve = \a -> list_para a "EASY" (\b _ d -> nat_para b d (\_ _ -> "HARD"))
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-10-07 23:56:35.040520874 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] -> Maybe a
hd ([]) = Nothing
hd (x : _) = Just x
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' = uncurry
parser :: String -> (Int, [Int])
parser = fromJust . parse1Input
parse1Input :: String -> Maybe (Int, [Int])
parse1Input i = do {let {ls = lines i};
                    when (length ls /= 2) Nothing;
                    let {[l1, l2] = ls};
                    n <- readMaybe l1 :: Maybe Int;
                    as <- mapM readMaybe $ words l2 :: Maybe ([Int]);
                    return (n, as)}
solve = \_ b -> list_para b "EASY" (\c _ e -> nat_para c e (\_ _ -> "HARD"))
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-10-03 02:36:21.881293103 UTC
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] -> Maybe a
hd ([]) = Nothing
hd (x : _) = Just x
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"
parser1 :: String -> (Int, [Int])
parser1 i = (n, as)
            where [l1, l2] = lines i
                  n = read l1
                  as = map read $ words l2
solve = \_ b -> iF (all (\c -> 1 /= c) b) "EASY" "HARD"
main = getContents >>= (\c -> putStrLn (uncurry solve (parser1 c)))

-- 2019-10-08 02:15:43.31370694 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] -> Maybe a
hd ([]) = Nothing
hd (x : _) = Just x
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' = uncurry
parser :: String -> (Int, [Int])
parser = fromJust . parse1Input
parse1Input :: String -> Maybe (Int, [Int])
parse1Input i = do {let {ls = lines i};
                    when (length ls /= 2) Nothing;
                    let {[l1, l2] = ls};
                    n <- readMaybe l1 :: Maybe Int;
                    as <- mapM readMaybe $ words l2 :: Maybe ([Int]);
                    return (n, as)}
solve = \_ b -> list_para b "EASY" (\c _ e -> nat_para c e (\_ _ -> "HARD"))
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

main = interact $ solve . map read . words
solve (n:is) | sum is > 0 = "HARD" | otherwise = "EASY"

module Main where

main = do
  _ <- getLine
  gradeLine <- getLine
  putStrLn $ if elem '1' gradeLine then "hard" else "easy"

import Control.Applicative
import Control.Monad
import Data.STRef
main :: IO ()
main = do
  n <- getLine
  s <- getLine
  putStr (if (0 <) $ sum $ fmap read $ words s then "HARD" else "EASY")

-- 2019-10-11 21:03:43.212175614 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] -> Maybe a
hd ([]) = Nothing
hd (x : _) = Just x
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 = fromJust . parse3Input
parse3Input :: String -> Maybe ([Int])
parse3Input i = do {let {ls = lines i};
                    when (length ls /= 2) Nothing;
                    let {[l1, l2] = ls};
                    n <- readMaybe l1 :: Maybe Int;
                    as <- mapM readMaybe $ words l2 :: Maybe ([Int]);
                    when (length as /= n) Nothing;
                    return as}
solve = \a -> list_para a "EASY" (\b _ d -> nat_para b d (\_ _ -> "HARD"))
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

{-# LANGUAGE BlockArguments #-}

import Control.Arrow

main = do { x <- getLine; input <-getLine; putStrLn (solve (words input)) }

solve :: [String] -> String
solve [] = "easy"
solve ("1":xs) = "hard"
solve ("0":xs) = solve xs

-- 2019-11-13 22:17:53.656556691 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 = fromJust . parse3Input
parse3Input :: String -> Maybe ([Int])
parse3Input i = do {let {ls = lines i};
                    when (length ls /= 2) Nothing;
                    let {[l1, l2] = ls};
                    n <- readMaybe l1 :: Maybe Int;
                    as <- mapM readMaybe $ words l2 :: Maybe ([Int]);
                    when (length as /= n) Nothing;
                    return as}
solve = \a -> list_para a "EASY" (\b _ d -> iF (0 >= b) d "HARD")
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-10-01 02:38:09.697417264 UTC
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] -> Maybe a
hd ([]) = Nothing
hd (x : _) = Just x
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 :: [a] -> ([a] -> Bool) -> String
magiciF s f = if f s then "EASY" else "HARD"
solve = \a -> magiciF "1" (\b -> all (\c -> c /= b) (tail (words a)))
main = getContents >>= (\c -> putStrLn (solve c))

process :: [Int] -> String
process source =
    let item = (length . filter (==1)) source
    in if (item > 0) then "HARD" else "EASY"

main :: IO ()
main = do
    source <- getLine
    let count = read source :: Int
    sources <- getLine
    let numbers = read <$> words sources :: [Int]
    let result = process numbers
    putStrLn (result)

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

main= do
           	getLine
		c<- map read <$> words<$> getLine::IO [Int]
	   	let d = length $ filter (>0) c
           	putStrLn $ if d>0 then "HARD" else "EASY"

main = interact $ solve . map read . tail . words

solve :: [Int] -> String
solve xs
    | elem 1 xs == True = "HARD"
    | otherwise         = "EASY"

main = getContents >>= putStrLn . solve . map read . words

solve (_:ls) = if any (== 1) ls then "HARD" else "EASY"

-- 2019-10-03 02:36:21.881293103 UTC
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] -> Maybe a
hd ([]) = Nothing
hd (x : _) = Just x
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"
parser1 :: String -> (Int, [Int])
parser1 i = (n, as)
            where [l1, l2] = lines i
                  n = read l1
                  as = map read $ words l2
solve = \_ b -> iF (all (\c -> 1 /= c) b) "EASY" "HARD"
main = getContents >>= (\c -> putStrLn (uncurry solve (parser1 c)))

-- 2019-11-06 21:29:52.665081313 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 = fromJust . parse3Input
parse3Input :: String -> Maybe ([Int])
parse3Input i = do {let {ls = lines i};
                    when (length ls /= 2) Nothing;
                    let {[l1, l2] = ls};
                    n <- readMaybe l1 :: Maybe Int;
                    as <- mapM readMaybe $ words l2 :: Maybe ([Int]);
                    when (length as /= n) Nothing;
                    return as}
solve = \a -> list_para a "EASY" (\b _ d -> iF (0 >= b) d "HARD")
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-10-06 02:57:40.250362307 UTC
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] -> Maybe a
hd ([]) = Nothing
hd (x : _) = Just x
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' = uncurry
parser :: String -> (Int, [Int])
parser i = (n, as)
           where [l1, l2] = lines i
                 n = read l1
                 as = map read $ words l2
solve = \_ b -> list_para b "EASY" (\c _ e -> nat_para c e (\_ _ -> "HARD"))
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-11-20 20:36:08.127152427 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 = fromJust . parseIntListIgnoreSize
parseIntListIgnoreSize :: String -> Maybe ([Int])
parseIntListIgnoreSize i = do {let {ls = lines i};
                               when (length ls /= 2) Nothing;
                               let {[l1, l2] = ls};
                               n <- readMaybe l1 :: Maybe Int;
                               as <- mapM readMaybe $ words l2 :: Maybe ([Int]);
                               when (length as /= n) Nothing;
                               return as}
solve = \a -> foldl (\b c -> iF (c == 0) b "HARD") "EASY" a
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-11-23 23:13:23.194025411 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 = fromJust . parseIntListIgnoreSize
parseIntListIgnoreSize :: String -> Maybe ([Int])
parseIntListIgnoreSize i = do {let {ls = lines i};
                               when (length ls /= 2) Nothing;
                               let {[l1, l2] = ls};
                               n <- readMaybe l1 :: Maybe Int;
                               as <- mapM readMaybe $ words l2 :: Maybe ([Int]);
                               when (length as /= n) Nothing;
                               return as}
solve = \a -> list_para a "EASY" (\b _ d -> iF (b == 0) d "HARD")
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-10-06 02:26:11.9000587 UTC
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] -> Maybe a
hd ([]) = Nothing
hd (x : _) = Just x
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"
parser1 :: String -> (Int, [Int])
parser1 i = (n, as)
            where [l1, l2] = lines i
                  n = read l1
                  as = map read $ words l2
solve = \_ b -> list_para b "EASY" (\c _ e -> nat_para c e (\_ _ -> "HARD"))
main = getContents >>= (\c -> putStrLn (uncurry solve (parser1 c)))

-- 2019-11-24 04:03:24.551872744 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 = fromJust . parseIntListIgnoreSize
parseIntListIgnoreSize :: String -> Maybe ([Int])
parseIntListIgnoreSize i = do {let {ls = lines i};
                               when (length ls /= 2) Nothing;
                               let {[l1, l2] = ls};
                               n <- readMaybe l1 :: Maybe Int;
                               as <- mapM readMaybe $ words l2 :: Maybe ([Int]);
                               when (length as /= n) Nothing;
                               return as}
solve = \a -> list_para a "EASY" (\b _ d -> iF (0 == b) d "HARD")
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

main = getLine >> getLine
       >>= putStrLn . decide . isHard . words

isHard::[String] -> Bool
isHard strs = any ((==) "1") strs

decide::Bool -> String
decide False = "easy"
decide _ = "hard"

module Main where

main = do
  _ <- getLine
  gradeLine <- getLine
  putStrLn $ if elem '1' gradeLine then "hard" else "easy"

main :: IO()
main = interact solve

solve :: String -> String
solve xs = if isEasy . convert $ xs
    then "EASY"
    else "HARD"
    where   convert = map (read :: String -> Int) . words . last . lines
            isEasy = notElem 0

main :: IO()
main = interact solve

solve :: String -> String
solve = show . isEasy . convert
    where convert = map (read :: String -> Int) . words . last . lines
          isEasy = notElem 0

parseInput :: String -> [Int]
parseInput input = xs where
    ls = lines input
    ys = words $ last ls
    xs = map read ys

solve :: [Int] -> String
solve xs = case sum xs of
    1 -> "HARD"
    _ -> "EASY"

main :: IO ()
main = do
    input <- getContents
    let xs = parseInput input
    putStrLn $ solve xs

-- 2019-10-28 19:24:49.961600764 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] -> Maybe a
hd ([]) = Nothing
hd (x : _) = Just x
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' = uncurry
parser :: String -> (Int, [Int])
parser = fromJust . parse1Input
parse1Input :: String -> Maybe (Int, [Int])
parse1Input i = do {let {ls = lines i};
                    when (length ls /= 2) Nothing;
                    let {[l1, l2] = ls};
                    n <- readMaybe l1 :: Maybe Int;
                    as <- mapM readMaybe $ words l2 :: Maybe ([Int]);
                    return (n, as)}
solve = \_ b -> list_para b [] (\_ _ e -> list_para e "EASY" (\_ _ _ -> "HARD"))
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-09-25 17:05:46.488714901 UTC
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] -> Maybe a
hd ([]) = Nothing
hd (x : _) = Just x
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)
solve = \a -> list_para (tail (tail (words a))) "EASY" (\_ _ _ -> "HARD")
main = getContents >>= (\c -> putStrLn (solve c))

-- 2019-10-06 03:28:30.215356196 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] -> Maybe a
hd ([]) = Nothing
hd (x : _) = Just x
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' = uncurry
parser :: String -> (Int, [Int])
parser = fromJust . parse1Input
parse1Input :: String -> Maybe (Int, [Int])
parse1Input i = do {let {ls = lines i};
                    when (length ls /= 2) Nothing;
                    let {[l1, l2] = ls};
                    n <- readMaybe l1 :: Maybe Int;
                    as <- mapM readMaybe $ words l2 :: Maybe ([Int]);
                    return (n, as)}
solve = \_ b -> list_para b [] (\_ _ e -> list_para e "EASY" (\_ _ _ -> "HARD"))
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-09-25 21:54:48.77091812 UTC
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] -> Maybe a
hd ([]) = Nothing
hd (x : _) = Just x
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)
solve = \a -> list_para (tail (tail (words a))) "EASY" (\_ _ _ -> "HARD")
main = getContents >>= (\c -> putStrLn (solve c))

-- 2019-11-13 22:14:00.096849974 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 = fromJust . parse3Input
parse3Input :: String -> Maybe ([Int])
parse3Input i = do {let {ls = lines i};
                    when (length ls /= 2) Nothing;
                    let {[l1, l2] = ls};
                    n <- readMaybe l1 :: Maybe Int;
                    as <- mapM readMaybe $ words l2 :: Maybe ([Int]);
                    when (length as /= n) Nothing;
                    return as}
solve = \a -> list_para a [] (\_ _ d -> list_para d "EASY" (\_ _ _ -> "HARD"))
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-10-03 03:45:21.930813419 UTC
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] -> Maybe a
hd ([]) = Nothing
hd (x : _) = Just x
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"
parser1 :: String -> (Int, [Int])
parser1 i = (n, as)
            where [l1, l2] = lines i
                  n = read l1
                  as = map read $ words l2
solve = \_ b -> (flip . flip foldr) "EASY" (tl (tl b)) (\_ _ -> "HARD")
main = getContents >>= (\c -> putStrLn (uncurry solve (parser1 c)))

-- 2019-09-24 08:17:18.695278578 UTC
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] -> Maybe a
hd ([]) = Nothing
hd (x : _) = Just x
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)
solve = \a -> list_para (tail (words (tail a))) "EASY" (\_ _ _ -> "HARD")
main = getContents >>= (\c -> putStrLn (solve c))

-- 2019-10-01 00:05:45.734775073 UTC
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] -> Maybe a
hd ([]) = Nothing
hd (x : _) = Just x
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)
solve = \a -> list_para (tail (tail (words a))) "EASY" (\_ _ _ -> "HARD")
main = getContents >>= (\c -> putStrLn (solve c))

-- 2019-11-06 21:46:30.628378932 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 = fromJust . parse3Input
parse3Input :: String -> Maybe ([Int])
parse3Input i = do {let {ls = lines i};
                    when (length ls /= 2) Nothing;
                    let {[l1, l2] = ls};
                    n <- readMaybe l1 :: Maybe Int;
                    as <- mapM readMaybe $ words l2 :: Maybe ([Int]);
                    when (length as /= n) Nothing;
                    return as}
solve = \a -> list_para a [] (\_ _ d -> list_para d "EASY" (\_ _ _ -> "HARD"))
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-11-04 21:25:41.851851017 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 = fromJust . parse3Input
parse3Input :: String -> Maybe ([Int])
parse3Input i = do {let {ls = lines i};
                    when (length ls /= 2) Nothing;
                    let {[l1, l2] = ls};
                    n <- readMaybe l1 :: Maybe Int;
                    as <- mapM readMaybe $ words l2 :: Maybe ([Int]);
                    when (length as /= n) Nothing;
                    return as}
solve = \a -> list_para a [] (\_ _ d -> list_para d "EASY" (\_ _ _ -> "HARD"))
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-11-04 20:44:58.646222915 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' = uncurry
parser :: String -> (Int, [Int])
parser = fromJust . parse1Input
parse1Input :: String -> Maybe (Int, [Int])
parse1Input i = do {let {ls = lines i};
                    when (length ls /= 2) Nothing;
                    let {[l1, l2] = ls};
                    n <- readMaybe l1 :: Maybe Int;
                    as <- mapM readMaybe $ words l2 :: Maybe ([Int]);
                    return (n, as)}
solve = \a b -> iF ((1 +) (hd b) >= a) "EASY" "HARD"
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-09-24 08:29:57.84019417 UTC
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] -> Maybe a
hd ([]) = Nothing
hd (x : _) = Just x
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)
solve = \a -> list_para (tail (tail (words a))) "EASY" (\_ _ _ -> "HARD")
main = getContents >>= (\c -> putStrLn (solve c))

-- 2019-11-23 23:14:20.167860167 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 = fromJust . parseIntListIgnoreSize
parseIntListIgnoreSize :: String -> Maybe ([Int])
parseIntListIgnoreSize i = do {let {ls = lines i};
                               when (length ls /= 2) Nothing;
                               let {[l1, l2] = ls};
                               n <- readMaybe l1 :: Maybe Int;
                               as <- mapM readMaybe $ words l2 :: Maybe ([Int]);
                               when (length as /= n) Nothing;
                               return as}
solve = \a -> list_para a "EASY" (\_ c d -> list_para c d (\_ _ _ -> "HARD"))
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-09-25 12:20:03.142943591 UTC
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] -> Maybe a
hd ([]) = Nothing
hd (x : _) = Just x
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)
solve = \a -> list_para (tail (tail (words a))) "EASY" (\_ _ _ -> "HARD")
main = getContents >>= (\c -> putStrLn (solve c))

-- 2019-10-03 02:38:15.398519482 UTC
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] -> Maybe a
hd ([]) = Nothing
hd (x : _) = Just x
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"
parser1 :: String -> (Int, [Int])
parser1 i = (n, as)
            where [l1, l2] = lines i
                  n = read l1
                  as = map read $ words l2
solve = \a _ -> iF (1 /= a) "HARD" "EASY"
main = getContents >>= (\c -> putStrLn (uncurry solve (parser1 c)))

-- 2019-10-11 21:02:55.152561032 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] -> Maybe a
hd ([]) = Nothing
hd (x : _) = Just x
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 = fromJust . parse3Input
parse3Input :: String -> Maybe ([Int])
parse3Input i = do {let {ls = lines i};
                    when (length ls /= 2) Nothing;
                    let {[l1, l2] = ls};
                    n <- readMaybe l1 :: Maybe Int;
                    as <- mapM readMaybe $ words l2 :: Maybe ([Int]);
                    when (length as /= n) Nothing;
                    return as}
solve = \a -> list_para a [] (\_ _ d -> list_para d "EASY" (\_ _ _ -> "HARD"))
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-09-25 20:37:24.881035611 UTC
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] -> Maybe a
hd ([]) = Nothing
hd (x : _) = Just x
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)
solve = \a -> list_para (tail (tail (words a))) "EASY" (\_ _ _ -> "HARD")
main = getContents >>= (\c -> putStrLn (solve c))

-- 2019-11-24 04:02:55.576589604 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 = fromJust . parseIntListIgnoreSize
parseIntListIgnoreSize :: String -> Maybe ([Int])
parseIntListIgnoreSize i = do {let {ls = lines i};
                               when (length ls /= 2) Nothing;
                               let {[l1, l2] = ls};
                               n <- readMaybe l1 :: Maybe Int;
                               as <- mapM readMaybe $ words l2 :: Maybe ([Int]);
                               when (length as /= n) Nothing;
                               return as}
solve = \a -> list_para a "EASY" (\_ c d -> list_para c d (\_ _ _ -> "HARD"))
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-10-01 05:14:33.9885935 UTC
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] -> Maybe a
hd ([]) = Nothing
hd (x : _) = Just x
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"
solve = \a -> (flip . flip foldr) "EASY" (tail (tail (words a))) (\_ _ -> "HARD")
main = getContents >>= (\c -> putStrLn (solve c))

-- 2019-10-01 00:14:47.755297214 UTC
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] -> Maybe a
hd ([]) = Nothing
hd (x : _) = Just x
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)
solve = \a -> list_para (tail (tail (words a))) "EASY" (\_ _ _ -> "HARD")
main = getContents >>= (\c -> putStrLn (solve c))

-- 2019-10-11 21:33:14.929681932 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] -> Maybe a
hd ([]) = Nothing
hd (x : _) = Just x
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 = fromJust . parse3Input
parse3Input :: String -> Maybe ([Int])
parse3Input i = do {let {ls = lines i};
                    when (length ls /= 2) Nothing;
                    let {[l1, l2] = ls};
                    n <- readMaybe l1 :: Maybe Int;
                    as <- mapM readMaybe $ words l2 :: Maybe ([Int]);
                    when (length as /= n) Nothing;
                    return as}
solve = \a -> list_para a [] (\_ _ d -> list_para d "EASY" (\_ _ _ -> "HARD"))
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-09-25 21:57:46.181864978 UTC
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] -> Maybe a
hd ([]) = Nothing
hd (x : _) = Just x
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)
solve = \a -> list_para (tail (tail (words a))) "EASY" (\_ _ _ -> "HARD")
main = getContents >>= (\c -> putStrLn (solve c))

-- 2019-11-23 23:24:21.809935304 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 = fromJust . parseIntListIgnoreSize
parseIntListIgnoreSize :: String -> Maybe ([Int])
parseIntListIgnoreSize i = do {let {ls = lines i};
                               when (length ls /= 2) Nothing;
                               let {[l1, l2] = ls};
                               n <- readMaybe l1 :: Maybe Int;
                               as <- mapM readMaybe $ words l2 :: Maybe ([Int]);
                               when (length as /= n) Nothing;
                               return as}
solve = \a -> list_para a "EASY" (\_ c d -> list_para c d (\_ _ _ -> "HARD"))
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-10-08 02:14:51.127227027 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] -> Maybe a
hd ([]) = Nothing
hd (x : _) = Just x
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' = uncurry
parser :: String -> (Int, [Int])
parser = fromJust . parse1Input
parse1Input :: String -> Maybe (Int, [Int])
parse1Input i = do {let {ls = lines i};
                    when (length ls /= 2) Nothing;
                    let {[l1, l2] = ls};
                    n <- readMaybe l1 :: Maybe Int;
                    as <- mapM readMaybe $ words l2 :: Maybe ([Int]);
                    return (n, as)}
solve = \_ b -> list_para b [] (\_ _ e -> list_para e "EASY" (\_ _ _ -> "HARD"))
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

main = do
    n <- getLine
    input <- getLine
    let votes = map read $ words input
    print $ solve votes

solve :: [Integer] -> String
solve votes
    | any (> 0) votes = "HARD"
    | otherwise = "EASY"

main = do
    n <- getLine
    m <- getLine
    let b = stoi . words $ m
    print . f $ b

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

f :: [Int] -> [Char]
f xs
    | elem 1 xs == True = "HARD"
    | otherwise         = "EASY"

main :: IO ()
main = do
    _ <- getLine
    isHard <- any (\a -> a == "1") <$> words <$> getLine
    print $ if isHard then "HARD" else "EASY"

main = do
  _ <- getLine
  l <- words <$> getLine
  if all (== "0") l
     then putStrLn "EASY"
     else putStrLn "HARsdsdfasdffasdfasD"

main = do
  _ <- getLine
  l <- words <$> getLine
  if all (== "0") l
     then putStrLn "EASY"
     else putStrLn "HAsdfasdfasdsRD"

list_para :: [b_0] -> a_1 -> (b_0 -> [b_0] -> a_1 -> a_1) -> a_1
list_para ([]) x_2 f_3 = x_2
list_para (y_4 : ys_5) x_6 f_7 = f_7 y_4 ys_5 (list_para ys_5 x_6 f_7)
solve = \a -> list_para (tail (tail (words a))) "EASY" (\_ _ _ -> "HARD")
main = getContents >>= \c -> putStrLn (solve c)

main = do
  _ <- getLine
  l <- words <$> getLine
  if all (== "0") l
     then putStrLn "EASY"
     else putStrLn "HARsdsaaaddsdfasD"

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] -> Maybe a
hd ([]) = Nothing
hd (x : _) = Just x
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)
solve = \a -> list_para (tail (tail (words a))) "EASY" (\_ _ _ -> "HARD")
main = getContents >>= (\c -> putStrLn (solve c))

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] -> Maybe a
hd ([]) = Nothing
hd (x : _) = Just x
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)
solve = \a -> list_para (tail (tail (words a))) "EASY" (\_ _ _ -> "HARD")
main = getContents >>= \c -> putStrLn (solve c)

list_para :: [b_0] -> a_1 -> (b_0 -> [b_0] -> a_1 -> a_1) -> a_1
list_para ([]) x_2 f_3 = x_2
list_para (y_4 : ys_5) x_6 f_7 = f_7 y_4 ys_5 (list_para ys_5 x_6 f_7)
solve = \a -> list_para (tail (tail (words a))) "EASY" (\_ _ _ -> "HARD")
main = return ()

main = do
  _ <- getLine
  l <- words <$> getLine
  if all (== "0") l
     then putStrLn "EASY"
     else putStrLn "HARsdsddffasdfasD"

main = do
  _ <- getLine
  l <- words <$> getLine
  if all (== "0") l
     then putStrLn "EASY"
     else putStrLn "HARsdfasdfasD"

main = do
  _ <- getLine
  l <- words <$> getLine
  if all (== "0") l
     then putStrLn "EASY"
     else putStrLn "HAsdfasRD"

main = do
  _ <- getLine
  l <- words <$> getLine
  if all (== "0") l
     then putStrLn "EASY"
     else putStrLn "HARsdsddsdfasD"

main = do
  nPeople <- (fmap read getLine) :: IO Integer
  responses <- (map read . words) `fmap` getLine :: IO[Integer]
  let sumResponses = foldl (+) 0 responses
  putStrLn $ response sumResponses nPeople

response sumResponses nPeople
  | nPeople - sumResponses > sumResponses = "hard"
  | otherwise = "easy"

main = do
  nPeople <- (fmap read getLine) :: IO Integer
  responses <- (map read . words) `fmap` getLine :: IO[Integer]
  let sumResponses = foldl (+) 0 responses
  putStrLn $ response sumResponses nPeople

response sumResponses nPeople
  | nPeople /= 0 = "hard"
  | otherwise = "easy"

-- 2019-10-01 01:37:59.817680291 UTC
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] -> Maybe a
hd ([]) = Nothing
hd (x : _) = Just x
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 :: [a] -> ([a] -> Bool) -> String
magiciF s f = if f s then "EASY" else "HARD"
solve = \a -> list_para (tail (tail (words a))) "EASY" (\_ _ _ -> "HARD")
main = getContents >>= (\c -> putStrLn (solve c))

-- 2019-11-13 22:21:14.093829589 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 = fromJust . parse3Input
parse3Input :: String -> Maybe ([Int])
parse3Input i = do {let {ls = lines i};
                    when (length ls /= 2) Nothing;
                    let {[l1, l2] = ls};
                    n <- readMaybe l1 :: Maybe Int;
                    as <- mapM readMaybe $ words l2 :: Maybe ([Int]);
                    when (length as /= n) Nothing;
                    return as}
solve = \a -> list_para a [] (\_ _ d -> list_para d "EASY" (\_ _ _ -> "HARD"))
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-11-13 22:14:53.31729885 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 = fromJust . parse3Input
parse3Input :: String -> Maybe ([Int])
parse3Input i = do {let {ls = lines i};
                    when (length ls /= 2) Nothing;
                    let {[l1, l2] = ls};
                    n <- readMaybe l1 :: Maybe Int;
                    as <- mapM readMaybe $ words l2 :: Maybe ([Int]);
                    when (length as /= n) Nothing;
                    return as}
solve = \a -> list_para a [] (\_ _ d -> list_para d "EASY" (\_ _ _ -> "HARD"))
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-10-03 02:41:17.760272331 UTC
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] -> Maybe a
hd ([]) = Nothing
hd (x : _) = Just x
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"
parser1 :: String -> (Int, [Int])
parser1 i = (n, as)
            where [l1, l2] = lines i
                  n = read l1
                  as = map read $ words l2
solve = \_ b -> list_para b [] (\_ _ e -> list_para e "EASY" (\_ _ _ -> "HARD"))
main = getContents >>= (\c -> putStrLn (uncurry solve (parser1 c)))

-- 2019-09-26 00:10:34.291401054 UTC
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] -> Maybe a
hd ([]) = Nothing
hd (x : _) = Just x
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)
solve = \a -> list_para (tail (tail (words a))) "EASY" (\_ _ _ -> "HARD")
main = getContents >>= (\c -> putStrLn (solve c))

-- 2019-11-23 23:12:26.495435438 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 = fromJust . parseIntListIgnoreSize
parseIntListIgnoreSize :: String -> Maybe ([Int])
parseIntListIgnoreSize i = do {let {ls = lines i};
                               when (length ls /= 2) Nothing;
                               let {[l1, l2] = ls};
                               n <- readMaybe l1 :: Maybe Int;
                               as <- mapM readMaybe $ words l2 :: Maybe ([Int]);
                               when (length as /= n) Nothing;
                               return as}
solve = \a -> list_para a "EASY" (\_ c d -> list_para c d (\_ _ _ -> "HARD"))
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-10-03 03:47:01.280872379 UTC
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] -> Maybe a
hd ([]) = Nothing
hd (x : _) = Just x
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"
parser1 :: String -> (Int, [Int])
parser1 i = (n, as)
            where [l1, l2] = lines i
                  n = read l1
                  as = map read $ words l2
solve = \_ b -> list_para b [] (\_ _ e -> list_para e "EASY" (\_ _ _ -> "HARD"))
main = getContents >>= (\c -> putStrLn (uncurry solve (parser1 c)))

-- 2019-09-25 19:32:10.467805643 UTC
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] -> Maybe a
hd ([]) = Nothing
hd (x : _) = Just x
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)
solve = \a -> list_para (tail (tail (words a))) "EASY" (\_ _ _ -> "HARD")
main = getContents >>= (\c -> putStrLn (solve c))

-- 2019-11-23 23:15:23.101742734 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 = fromJust . parseIntListIgnoreSize
parseIntListIgnoreSize :: String -> Maybe ([Int])
parseIntListIgnoreSize i = do {let {ls = lines i};
                               when (length ls /= 2) Nothing;
                               let {[l1, l2] = ls};
                               n <- readMaybe l1 :: Maybe Int;
                               as <- mapM readMaybe $ words l2 :: Maybe ([Int]);
                               when (length as /= n) Nothing;
                               return as}
solve = \a -> list_para a "EASY" (\_ c d -> list_para c d (\_ _ _ -> "HARD"))
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-10-01 00:17:14.71280252 UTC
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] -> Maybe a
hd ([]) = Nothing
hd (x : _) = Just x
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)
solve = \a -> list_para (tail (tail (words a))) "EASY" (\_ _ _ -> "HARD")
main = getContents >>= (\c -> putStrLn (solve c))

-- 2019-10-06 02:46:07.291032374 UTC
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] -> Maybe a
hd ([]) = Nothing
hd (x : _) = Just x
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"
parser :: String -> (Int, [Int])
parser i = (n, as)
           where [l1, l2] = lines i
                 n = read l1
                 as = map read $ words l2
uncurry' = uncurry
solve = \_ b -> list_para b [] (\_ _ e -> list_para e "EASY" (\_ _ _ -> "HARD"))
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-09-24 14:46:44.302580454 UTC
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] -> Maybe a
hd ([]) = Nothing
hd (x : _) = Just x
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)
solve = \a -> list_para (tail (words (tail a))) "EASY" (\_ _ _ -> "HARD")
main = getContents >>= (\c -> putStrLn (solve c))

-- 2019-10-09 21:48:30.637080605 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] -> Maybe a
hd ([]) = Nothing
hd (x : _) = Just x
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' = uncurry
parser :: String -> (Int, [Int])
parser = fromJust . parse1Input
parse1Input :: String -> Maybe (Int, [Int])
parse1Input i = do {let {ls = lines i};
                    when (length ls /= 2) Nothing;
                    let {[l1, l2] = ls};
                    n <- readMaybe l1 :: Maybe Int;
                    as <- mapM readMaybe $ words l2 :: Maybe ([Int]);
                    return (n, as)}
solve = \_ b -> list_para b [] (\_ _ e -> list_para e "EASY" (\_ _ _ -> "HARD"))
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-10-02 14:03:09.630539033 UTC
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] -> Maybe a
hd ([]) = Nothing
hd (x : _) = Just x
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"
solve = \a -> iF (all (\_ -> False) (tail (tail (words a)))) "EASY" "HARD"
main = getContents >>= (\c -> putStrLn (solve c))

-- 2019-11-23 23:23:10.625136247 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 = fromJust . parseIntListIgnoreSize
parseIntListIgnoreSize :: String -> Maybe ([Int])
parseIntListIgnoreSize i = do {let {ls = lines i};
                               when (length ls /= 2) Nothing;
                               let {[l1, l2] = ls};
                               n <- readMaybe l1 :: Maybe Int;
                               as <- mapM readMaybe $ words l2 :: Maybe ([Int]);
                               when (length as /= n) Nothing;
                               return as}
solve = \a -> list_para a "EASY" (\_ c d -> list_para c d (\_ _ _ -> "HARD"))
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-10-01 02:35:34.400537194 UTC
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] -> Maybe a
hd ([]) = Nothing
hd (x : _) = Just x
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 :: [a] -> ([a] -> Bool) -> String
magiciF s f = if f s then "EASY" else "HARD"
solve = \a -> magiciF "1" (\_ -> all (\_ -> False) (tail (tail (words a))))
main = getContents >>= (\c -> putStrLn (solve c))

-- 2019-10-05 23:23:16.134170485 UTC
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] -> Maybe a
hd ([]) = Nothing
hd (x : _) = Just x
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"
parser1 :: String -> (Int, [Int])
parser1 i = (n, as)
            where [l1, l2] = lines i
                  n = read l1
                  as = map read $ words l2
solve = \_ b -> list_para b [] (\_ _ e -> list_para e "EASY" (\_ _ _ -> "HARD"))
main = getContents >>= (\c -> putStrLn (uncurry solve (parser1 c)))

-- 2019-11-24 04:04:27.809142032 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 = fromJust . parseIntListIgnoreSize
parseIntListIgnoreSize :: String -> Maybe ([Int])
parseIntListIgnoreSize i = do {let {ls = lines i};
                               when (length ls /= 2) Nothing;
                               let {[l1, l2] = ls};
                               n <- readMaybe l1 :: Maybe Int;
                               as <- mapM readMaybe $ words l2 :: Maybe ([Int]);
                               when (length as /= n) Nothing;
                               return as}
solve = \a -> list_para a "EASY" (\_ c d -> list_para c d (\_ _ _ -> "HARD"))
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-10-01 05:16:59.174831115 UTC
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] -> Maybe a
hd ([]) = Nothing
hd (x : _) = Just x
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"
solve = \a -> (flip . flip foldr) "EASY" (tail (tail (words a))) (\_ _ -> "HARD")
main = getContents >>= (\c -> putStrLn (solve c))

-- 2019-09-24 14:48:18.126819755 UTC
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] -> Maybe a
hd ([]) = Nothing
hd (x : _) = Just x
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)
solve = \a -> maybe "EASY" (\_ -> "HARD") (hd (tail (tail (words a))))
main = getContents >>= (\c -> putStrLn (solve c))

-- 2019-09-26 00:54:57.953891474 UTC
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] -> Maybe a
hd ([]) = Nothing
hd (x : _) = Just x
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)
solve = \a -> list_para (tail (tail (words a))) "EASY" (\_ _ _ -> "HARD")
main = getContents >>= (\c -> putStrLn (solve c))

-- 2019-10-06 02:25:22.124397566 UTC
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] -> Maybe a
hd ([]) = Nothing
hd (x : _) = Just x
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"
parser1 :: String -> (Int, [Int])
parser1 i = (n, as)
            where [l1, l2] = lines i
                  n = read l1
                  as = map read $ words l2
solve = \_ b -> list_para b [] (\_ _ e -> list_para e "EASY" (\_ _ _ -> "HARD"))
main = getContents >>= (\c -> putStrLn (uncurry solve (parser1 c)))

-- 2019-10-01 03:12:09.794191354 UTC
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] -> Maybe a
hd ([]) = Nothing
hd (x : _) = Just x
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"
solve = \a -> list_para (tail (tail (words a))) "EASY" (\_ _ _ -> "HARD")
main = getContents >>= (\c -> putStrLn (solve c))

-- 2019-10-02 14:17:17.091929602 UTC
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] -> Maybe a
hd ([]) = Nothing
hd (x : _) = Just x
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"
solve = \a -> iF (all (\_ -> False) (tail (tail (words a)))) "EASY" "HARD"
main = getContents >>= (\c -> putStrLn (solve c))

-- 2019-09-24 14:46:28.584418232 UTC
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] -> Maybe a
hd ([]) = Nothing
hd (x : _) = Just x
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)
solve = \a -> list_para (tail (tail (words a))) "EASY" (\_ _ _ -> "HARD")
main = getContents >>= (\c -> putStrLn (solve c))

-- 2019-09-24 14:48:33.199504489 UTC
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] -> Maybe a
hd ([]) = Nothing
hd (x : _) = Just x
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)
solve = \a -> maybe "EASY" (\_ -> "HARD") (hd (tail (words (tail a))))
main = getContents >>= (\c -> putStrLn (solve c))

-- 2019-11-04 22:20:27.579787403 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' = uncurry
parser :: String -> (Int, [Int])
parser = fromJust . parse1Input
parse1Input :: String -> Maybe (Int, [Int])
parse1Input i = do {let {ls = lines i};
                    when (length ls /= 2) Nothing;
                    let {[l1, l2] = ls};
                    n <- readMaybe l1 :: Maybe Int;
                    as <- mapM readMaybe $ words l2 :: Maybe ([Int]);
                    return (n, as)}
solve = \a b -> iF (a == (1 +) (hd b)) "EASY" "HARD"
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-10-11 20:55:36.87799668 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] -> Maybe a
hd ([]) = Nothing
hd (x : _) = Just x
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 = fromJust . parse3Input
parse3Input :: String -> Maybe ([Int])
parse3Input i = do {let {ls = lines i};
                    when (length ls /= 2) Nothing;
                    let {[l1, l2] = ls};
                    n <- readMaybe l1 :: Maybe Int;
                    as <- mapM readMaybe $ words l2 :: Maybe ([Int]);
                    when (length as /= n) Nothing;
                    return as}
solve = \a -> list_para a [] (\_ _ d -> list_para d "EASY" (\_ _ _ -> "HARD"))
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-11-13 22:22:46.33961416 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 = fromJust . parse3Input
parse3Input :: String -> Maybe ([Int])
parse3Input i = do {let {ls = lines i};
                    when (length ls /= 2) Nothing;
                    let {[l1, l2] = ls};
                    n <- readMaybe l1 :: Maybe Int;
                    as <- mapM readMaybe $ words l2 :: Maybe ([Int]);
                    when (length as /= n) Nothing;
                    return as}
solve = \a -> list_para a [] (\_ _ d -> list_para d "EASY" (\_ _ _ -> "HARD"))
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-10-01 04:27:07.944223141 UTC
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] -> Maybe a
hd ([]) = Nothing
hd (x : _) = Just x
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"
solve = \a -> iF (all (\_ -> False) (tail (tail (words a)))) "EASY" "HARD"
main = getContents >>= (\c -> putStrLn (solve c))

-- 2019-10-05 23:17:03.975271777 UTC
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] -> Maybe a
hd ([]) = Nothing
hd (x : _) = Just x
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"
parser1 :: String -> (Int, [Int])
parser1 i = (n, as)
            where [l1, l2] = lines i
                  n = read l1
                  as = map read $ words l2
solve = \_ b -> list_para b [] (\_ _ e -> list_para e "EASY" (\_ _ _ -> "HARD"))
main = getContents >>= (\c -> putStrLn (uncurry solve (parser1 c)))

-- 2019-11-24 03:57:24.5143346 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 = fromJust . parseIntListIgnoreSize
parseIntListIgnoreSize :: String -> Maybe ([Int])
parseIntListIgnoreSize i = do {let {ls = lines i};
                               when (length ls /= 2) Nothing;
                               let {[l1, l2] = ls};
                               n <- readMaybe l1 :: Maybe Int;
                               as <- mapM readMaybe $ words l2 :: Maybe ([Int]);
                               when (length as /= n) Nothing;
                               return as}
solve = \a -> iF (0 == foldl (\_ c -> c) 0 a) "EASY" "HARD"
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-10-06 02:56:18.468766179 UTC
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] -> Maybe a
hd ([]) = Nothing
hd (x : _) = Just x
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' = uncurry
parser :: String -> (Int, [Int])
parser i = (n, as)
           where [l1, l2] = lines i
                 n = read l1
                 as = map read $ words l2
solve = \_ b -> list_para b [] (\_ _ e -> list_para e "EASY" (\_ _ _ -> "HARD"))
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-10-09 21:59:15.091828622 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] -> Maybe a
hd ([]) = Nothing
hd (x : _) = Just x
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 = fromJust . parse3Input
parse3Input :: String -> Maybe ([Int])
parse3Input i = do {let {ls = lines i};
                    when (length ls /= 2) Nothing;
                    let {[l1, l2] = ls};
                    n <- readMaybe l1 :: Maybe Int;
                    as <- mapM readMaybe $ words l2 :: Maybe ([Int]);
                    when (length as /= n) Nothing;
                    return as}
solve = \a -> list_para a [] (\_ _ d -> list_para d "EASY" (\_ _ _ -> "HARD"))
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-10-11 20:01:33.78305623 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] -> Maybe a
hd ([]) = Nothing
hd (x : _) = Just x
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 = fromJust . parse3Input
parse3Input :: String -> Maybe ([Int])
parse3Input i = do {let {ls = lines i};
                    when (length ls /= 2) Nothing;
                    let {[l1, l2] = ls};
                    n <- readMaybe l1 :: Maybe Int;
                    as <- mapM readMaybe $ words l2 :: Maybe ([Int]);
                    when (length as /= n) Nothing;
                    return as}
solve = \a -> list_para a [] (\_ _ d -> list_para d "EASY" (\_ _ _ -> "HARD"))
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-10-06 00:35:00.660503358 UTC
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] -> Maybe a
hd ([]) = Nothing
hd (x : _) = Just x
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"
parser1 :: String -> (Int, [Int])
parser1 i = (n, as)
            where [l1, l2] = lines i
                  n = read l1
                  as = map read $ words l2
solve = \_ b -> list_para b [] (\_ _ e -> list_para e "EASY" (\_ _ _ -> "HARD"))
main = getContents >>= (\c -> putStrLn (uncurry solve (parser1 c)))

-- 2019-09-25 20:41:26.399091769 UTC
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] -> Maybe a
hd ([]) = Nothing
hd (x : _) = Just x
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)
solve = \a -> list_para (tail (tail (words a))) "EASY" (\_ _ _ -> "HARD")
main = getContents >>= (\c -> putStrLn (solve c))

-- 2019-09-24 08:19:08.661753193 UTC
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] -> Maybe a
hd ([]) = Nothing
hd (x : _) = Just x
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)
solve = \a -> maybe "EASY" (\_ -> "HARD") (hd (tail (tail (words a))))
main = getContents >>= (\c -> putStrLn (solve c))

-- 2019-09-24 08:30:05.852335429 UTC
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] -> Maybe a
hd ([]) = Nothing
hd (x : _) = Just x
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)
solve = \a -> list_para (tail (words (tail a))) "EASY" (\_ _ _ -> "HARD")
main = getContents >>= (\c -> putStrLn (solve c))

-- 2019-10-11 20:02:22.636239392 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] -> Maybe a
hd ([]) = Nothing
hd (x : _) = Just x
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 = fromJust . parse3Input
parse3Input :: String -> Maybe ([Int])
parse3Input i = do {let {ls = lines i};
                    when (length ls /= 2) Nothing;
                    let {[l1, l2] = ls};
                    n <- readMaybe l1 :: Maybe Int;
                    as <- mapM readMaybe $ words l2 :: Maybe ([Int]);
                    when (length as /= n) Nothing;
                    return as}
solve = \a -> list_para a [] (\_ _ d -> list_para d "EASY" (\_ _ _ -> "HARD"))
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-09-25 23:56:20.774727456 UTC
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] -> Maybe a
hd ([]) = Nothing
hd (x : _) = Just x
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)
solve = \a -> list_para (tail (tail (words a))) "EASY" (\_ _ _ -> "HARD")
main = getContents >>= (\c -> putStrLn (solve c))

-- 2019-10-11 21:09:32.752972115 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] -> Maybe a
hd ([]) = Nothing
hd (x : _) = Just x
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 = fromJust . parse3Input
parse3Input :: String -> Maybe ([Int])
parse3Input i = do {let {ls = lines i};
                    when (length ls /= 2) Nothing;
                    let {[l1, l2] = ls};
                    n <- readMaybe l1 :: Maybe Int;
                    as <- mapM readMaybe $ words l2 :: Maybe ([Int]);
                    when (length as /= n) Nothing;
                    return as}
solve = \a -> list_para a [] (\_ _ d -> list_para d "EASY" (\_ _ _ -> "HARD"))
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-10-06 00:47:44.092015581 UTC
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] -> Maybe a
hd ([]) = Nothing
hd (x : _) = Just x
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"
parser1 :: String -> (Int, [Int])
parser1 i = (n, as)
            where [l1, l2] = lines i
                  n = read l1
                  as = map read $ words l2
solve = \_ b -> list_para b [] (\_ _ e -> list_para e "EASY" (\_ _ _ -> "HARD"))
main = getContents >>= (\c -> putStrLn (uncurry solve (parser1 c)))

-- 2019-09-24 08:16:41.82552366 UTC
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] -> Maybe a
hd ([]) = Nothing
hd (x : _) = Just x
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)
solve = \a -> list_para (tail (tail (words a))) "EASY" (\_ _ _ -> "HARD")
main = getContents >>= (\c -> putStrLn (solve c))

-- 2019-11-24 03:58:44.235789429 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 = fromJust . parseIntListIgnoreSize
parseIntListIgnoreSize :: String -> Maybe ([Int])
parseIntListIgnoreSize i = do {let {ls = lines i};
                               when (length ls /= 2) Nothing;
                               let {[l1, l2] = ls};
                               n <- readMaybe l1 :: Maybe Int;
                               as <- mapM readMaybe $ words l2 :: Maybe ([Int]);
                               when (length as /= n) Nothing;
                               return as}
solve = \a -> iF (0 == foldl (\_ c -> c) 0 a) "EASY" "HARD"
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-10-06 00:31:45.403807963 UTC
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] -> Maybe a
hd ([]) = Nothing
hd (x : _) = Just x
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"
parser1 :: String -> (Int, [Int])
parser1 i = (n, as)
            where [l1, l2] = lines i
                  n = read l1
                  as = map read $ words l2
solve = \_ b -> list_para b [] (\_ _ e -> list_para e "EASY" (\_ _ _ -> "HARD"))
main = getContents >>= (\c -> putStrLn (uncurry solve (parser1 c)))

-- 2019-10-03 02:36:03.114138878 UTC
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] -> Maybe a
hd ([]) = Nothing
hd (x : _) = Just x
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"
parser1 :: String -> (Int, [Int])
parser1 i = (n, as)
            where [l1, l2] = lines i
                  n = read l1
                  as = map read $ words l2
solve = \a _ -> iF (1 /= a) "HARD" "EASY"
main = getContents >>= (\c -> putStrLn (uncurry solve (parser1 c)))

-- 2019-10-28 19:17:01.276369534 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] -> Maybe a
hd ([]) = Nothing
hd (x : _) = Just x
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 = fromJust . parse3Input
parse3Input :: String -> Maybe ([Int])
parse3Input i = do {let {ls = lines i};
                    when (length ls /= 2) Nothing;
                    let {[l1, l2] = ls};
                    n <- readMaybe l1 :: Maybe Int;
                    as <- mapM readMaybe $ words l2 :: Maybe ([Int]);
                    when (length as /= n) Nothing;
                    return as}
solve = \a -> list_para a [] (\_ _ d -> list_para d "EASY" (\_ _ _ -> "HARD"))
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))

-- 2019-09-25 19:28:36.857215253 UTC
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] -> Maybe a
hd ([]) = Nothing
hd (x : _) = Just x
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)
solve = \a -> list_para (tail (tail (words a))) "EASY" (\_ _ _ -> "HARD")
main = getContents >>= (\c -> putStrLn (solve c))

-- 2019-10-06 02:32:49.8170885 UTC
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] -> Maybe a
hd ([]) = Nothing
hd (x : _) = Just x
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"
parser1 :: String -> (Int, [Int])
parser1 i = (n, as)
            where [l1, l2] = lines i
                  n = read l1
                  as = map read $ words l2
solve = \_ b -> list_para b [] (\_ _ e -> list_para e "EASY" (\_ _ _ -> "HARD"))
main = getContents >>= (\c -> putStrLn (uncurry solve (parser1 c)))

-- 2019-10-03 02:55:23.388257135 UTC
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] -> Maybe a
hd ([]) = Nothing
hd (x : _) = Just x
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"
parser1 :: String -> (Int, [Int])
parser1 i = (n, as)
            where [l1, l2] = lines i
                  n = read l1
                  as = map read $ words l2
solve = \_ b -> (flip . flip foldr) "EASY" (tl (tl b)) (\_ _ -> "HARD")
main = getContents >>= (\c -> putStrLn (uncurry solve (parser1 c)))

-- 2019-10-07 23:49:23.482847298 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] -> Maybe a
hd ([]) = Nothing
hd (x : _) = Just x
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' = uncurry
parser :: String -> (Int, [Int])
parser = fromJust . parse1Input
parse1Input :: String -> Maybe (Int, [Int])
parse1Input i = do {let {ls = lines i};
                    when (length ls /= 2) Nothing;
                    let {[l1, l2] = ls};
                    n <- readMaybe l1 :: Maybe Int;
                    as <- mapM readMaybe $ words l2 :: Maybe ([Int]);
                    return (n, as)}
solve = \_ b -> list_para b [] (\_ _ e -> list_para e "EASY" (\_ _ _ -> "HARD"))
main = getContents >>= (\c -> putStrLn (uncurry' solve (parser c)))