import Data.Char

main :: IO ()
main = putStrLn . concat . map (\x -> ['.', x]) . filter (not . flip elem "aeyiou") . map toLower =<< getLine

import Data.Char
main = do line <- getLine
          putStrLn (((foldl func "").(filter (\x -> not(x `elem` "aoyeui"))) . (map toLower)) line)
    where func str c = str ++ "." ++ [c]

import Data.List
import Data.Char
main = do
  s <- getLine
  putStrLn ("." ++ (intersperse '.' (map toLower (filter (\x -> not $ elem (toUpper x) "AOYEUI") s))))

import Data.Char
import Data.List

main = do
    line <- getLine
    let cons = (filter ((`notElem` "aeiouy")) $ map toLower line)
        ans = '.' : ( intersperse '.' cons )
    putStrLn  ans

import Data.Char

main = do
    line <- getLine
    let cons = (filter ((`notElem` "aeiouy")) $ map toLower line)
    putStrLn $ foldl (\acc b -> acc ++ ['.'] ++ [b]) "" cons

import Data.Char

letter :: Char -> String
letter l
  | elem l ['a', 'e', 'i', 'o', 'u', 'y'] = ""
  | otherwise = "." ++ [l]

task :: String -> String
task s = foldl (++) [] (map (letter . toLower) s)

main = do
  s <- getLine
  putStrLn . task $ s

import Data.Char

isVowel :: Char -> Bool
isVowel x =
  if x == 'a' || x == 'e' || x == 'i' || x == 'o' || x == 'u' || x == 'y'
  || x == 'A' || x == 'E' || x == 'I' || x == 'O' || x == 'U' || x == 'Y'
  then True else False

filterVowels :: [Char] -> [Char]
filterVowels xs = filter (not.isVowel) xs

insertConsonants :: [Char] -> [Char]
insertConsonants []   = []
insertConsonants (x:xs) =
  if (not.isVowel) x
  then ['.'] ++ [x] ++ insertConsonants xs
  else [x] ++ insertConsonants xs

replaceUpperConsonants :: [Char] -> [Char]
replaceUpperConsonants = map (\x -> if (not.isVowel) x then toLower x else x)

main = do
  line <- getLine
  putStr $ replaceUpperConsonants $ insertConsonants $ filterVowels line

import Data.Char

conv :: Char -> String
conv a
 | elem a "aoyeui" = ""
 | otherwise = ['.', a]

solve :: String -> String
solve (x:xs) = (conv $ toLower x) ++ solve xs
solve ""     = ""

readInt :: String -> Int
readInt = read

parseLogic :: String -> String
parseLogic = solve . head . words

main = interact parseLogic

module Main where

import Data.Char (toLower)

main :: IO ()
main = do
  inp <- getLine
  let word = fmap toLower inp
      woVowels = filter (`notElem` "aeiouy") word
      output = woVowels >>= (\x -> ['.', x])
  putStrLn output

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

import Data.Char

convert :: String -> String
convert target = concat [['.', x] | x <- (map toLower target), not(x `elem` "aeiouy")]

main = do
    s <- getLine
    putStrLn $ convert s

import Data.Char

check :: String -> String
check xs = g $ map toLower xs
    where
      g [] = []
      g (x : xs)
          | elem x ['a', 'o', 'y', 'e', 'u', 'i'] = g xs
          | otherwise = '.' : x : g xs

main :: IO ()
main = do cs <- getLine
          putStr $ check cs

import Data.Char

main = do
    line <- getLine
    putStrLn $ foldl (\a b -> a ++ ['.'] ++ [b]) "" $ (filter ((`notElem` "aeiouy")) $ map toLower line)

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

import Data.Char

convert c acc
    | (toLower c) `elem` "aeiouy" = acc
    | otherwise = '.':(toLower c):acc

main = do
    input <- getLine
    putStrLn $ foldr convert "" input

module Main where
import Data.Maybe
import Data.Char
main = getLine >>= \word -> putStrLn $ foldl (\acc c -> if toUpper c `notElem` ['A','O','Y','E','U','I'] then acc ++ "." ++ [toLower c] else acc) "" word

module Main where

import Data.Char

(|>) = flip (.)

isVowel :: Char -> Bool
isVowel c = (toLower c) `elem` ['a', 'e', 'i', 'o', 'u', 'y']

main = interact $
    takeWhile (\x -> x /= '\n')
    |> filter (not . isVowel)
    |> map toLower
    |> map (\x -> ['.',x])
    |> foldr (++) []

import Data.Char

expand :: String -> String
expand [] = []
expand (x : xs) = '.' : x : expand(xs)

main = do
	line <- getLine
	let x = expand $ filter ((`notElem` "aeiouy")) $ map toLower line
	putStrLn x

import Data.Char

main = do
	line <- getLine
	putStrLn $ answer line;

answer :: String -> String
answer a = foldr1 (++) $ zipWith (\a b -> (a : b : [])) (repeat '.') $ map toLower $ filter (not . isVowel) a

isVowel :: Char -> Bool
isVowel x = elem (toUpper x) ['A', 'E', 'I', 'O', 'U', 'Y']

module Main
where
import Data.Char
import Data.List

main = do
    interact process

process str =
    let
        inp = (lines str) !! 0
        lstr = [x | x <- (map toLower inp), x `notElem` "aeiouy"]
    in do
        (drop 1 . intersperse '.' $ ' ': lstr) ++ "\n"

import Data.Char (toLower)

is_vowel c = case c of
             'a' -> False
             'o' -> False
             'y' -> False
             'e' -> False
             'u' -> False
             'i' -> False
             _   -> True
add_dot :: Char -> [Char]
add_dot c = "." ++ [c]

main = do
    a <- getLine
    {-capitalize = map toUpper-}
    {-putStrLn $ filter is_vowel a-}
    {-putStrLn $ filter is_vowel $ map toLower $ a-}
    putStrLn $ concat $ map add_dot $ filter is_vowel $ map toLower $ a
    {-\cmap Char.toUpper "HELLO world"-}

import Data.Char
setLetter :: String
setLetter = "aoyuei"

f :: String -> String
f [] = []
f (x:xs)
    | (not( (toLower x) `elem` setLetter)) = (:) '.' $  (:) (toLower x) $ f xs
    | ((toLower x) `elem` setLetter) = f xs
    |  otherwise = (:) (toLower x)  $ f xs

main :: IO()
main = do
    a <- getLine
    putStrLn $ f a

import Data.Char (isUpper, toLower)
import Data.List (intersperse)

vowels = ['a','A','o','O','y','Y','e','E','u','U','i','I'] :: [Char]

fixUpper :: Char -> Char
fixUpper c = if isUpper c then toLower c else c

fixString :: String -> String
fixString s = '.' : intersperse '.' (map fixUpper $ filter (\x -> not $ elem x vowels) s)

main = do
  word <- getLine
  putStrLn $ fixString word

import Char

isVowel 'a' = True
isVowel 'i' = True
isVowel 'u' = True
isVowel 'e' = True
isVowel 'o' = True
isVowel 'y' = True
isVowel 'A' = True
isVowel 'I' = True
isVowel 'U' = True
isVowel 'E' = True
isVowel 'O' = True
isVowel 'Y' = True
isVowel x = False

addDot   [] = []
addDot (x:xs) = '.' : x : addDot xs

main = do
         input <- getLine
         putStrLn . map toLower . addDot . filter (not . isVowel ) $ input

import Data.Char

getAnswer :: String -> String
getAnswer line = change (map toLower line)

change :: String -> String
change [] = []
change (letter:rest) = if isVowel letter
                       then "" ++ (change rest)
                       else "." ++ [letter] ++ (change rest)

isVowel :: Char -> Bool
isVowel letter = elem letter "aoyeui"

main :: IO ()
main = do
  line <- getLine
  putStrLn $ getAnswer line

import Control.Monad
import Data.Char

main = do
    line <- getLine
    let result = solve line
    putStrLn result

solve :: String -> String
solve = foldr (\curr acc -> if (isVowel curr) then acc else '.':(toLower curr):acc) ""

isVowel :: Char -> Bool
isVowel = (`elem` "aeiouyAEIOUY")

import Data.Char
import Data.List

cons x = not (x `elem` "aeiouy")

main = do
    s <- getLine
    putStrLn $ ('.':) . intersperse '.' . filter cons . map toLower $ s

-- notice on hoogle that you can "hoogle"
-- function names which are similar ( or seemingly identical )
-- to certain C-language function names such as

-- isUpper
-- isLower
-- toUpper
-- toLower

import Data.Char
import Data.Array

convStr a b
  | (null a) = b
  | (head a) == 'A' || (head a) == 'a' ||
    (head a) == 'E' || (head a) == 'e' ||
    (head a) == 'I' || (head a) == 'i' ||
    (head a) == 'O' || (head a) == 'o' ||
    (head a) == 'U' || (head a) == 'u' ||
    (head a) == 'Y' || (head a) == 'y' = convStr (tail a) b
  | otherwise = convStr (tail a) (concat [b,['.'],[(toLower (head a))]])

main = do
  oi <- getLine
  let ans = convStr oi ""
  putStrLn ans

-- so i just found this.... lol
-- im still glad that i wrote my parsing function

-- page 84

--   The words function splits an input string on any whitespace. Its counterpart, unwords ,
-- uses a single space to join a list of words:

-- also Ctrl-Shift-p or Ctrl-Shift-n  hightlight... in emacs

import Data.Char

main = do
    s <- getLine
    putStrLn [j | i <- map toLower s, not $ elem i "aeiouy", j <- ['.', i]]

import Control.Monad
import Data.List
import Data.Char

isVowel :: Char -> Bool
isVowel x = elem x "AOYEUIaoyeui"

main :: IO ()
main = do
    line <- getLine
    let withoutVowels = filter (not . isVowel) line
    let lower = map toLower withoutVowels
    let withDots = map (\x -> "." ++ [x]) lower
    putStrLn $ foldl (++) [] withDots

import Data.Char

isVowel :: Char -> Bool
isVowel x = (toLower x) `elem` "aoyeui"

dotify :: String -> String
dotify "" = ""
dotify [x] = '.':[x]
dotify (x:xs) = '.':[x]++(dotify xs)

main :: IO()
main = do
    str <- getLine
    putStrLn $ dotify $ filter (\x -> not $ isVowel x) $ map toLower str

import Prelude
import Data.Char

f:: [Char]->[Char]
f []=[]
f (x:xs) = if (elem p ['a','o','u','y','i','e']) then (f xs) else (['.']++[p]++(f xs)) where p=toLower x

main = do
    input <- getLine
    putStrLn $ f input

import Data.Char

main = do
    line <- getLine
    putStrLn $ concat $ map (\x -> ['.', x]) $ filter (\x -> not $ elem x ['a', 'o', 'y', 'e', 'u', 'i']) (map (\x -> toLower x) line)

import Data.Char

myprocess :: [Char] -> [Char]
myprocess [] = []
myprocess (c:left) =
  if c `elem` ['a','e','i','o','u','y']
    then myprocess left
    else ['.',c] ++ myprocess left

main = do
  str <- getLine
  putStrLn $ myprocess $ map toLower str

import Data.Char

vowels = "aeiouy"

f1 :: String -> String
f1 [] = []
f1 (x:xs)
  | x `elem` vowels = f1 xs
  | otherwise       = (x:f1 xs)

f2 :: String -> String
f2 [] = []
f2 (x:xs) = ('.':x:f2 xs)

main = do
  a <- getLine
  putStrLn $ f2 $ f1 $ map toLower a

import Data.Char
main = interact $ concat . map (('.':) . (:[])) . filter (flip notElem "aeiouy \n") . map (toLower)

import Data.Char

g x
  | x < '0' || elem x "aoyeui" = ""
  | 1 > 0 = '.' : [x]

main = interact $ concatMap (g . toLower)

import Data.Char

main = do
    s <- fmap (map toLower) getLine

    let
        s' = concat $ map f s
        f 'a' = []
        f 'o' = []
        f 'y' = []
        f 'e' = []
        f 'u' = []
        f 'i' = []
        f c = ['.', c]

    putStrLn s'

import Data.Char

fs 'a' = []
fs 'o' = []
fs 'y' = []
fs 'e' = []
fs 'u' = []
fs 'i' = []
fs ' ' = []
fs '\n' = []
fs c = ['.', c]

main = interact $ concat . map (fs . toLower)

{-# LANGUAGE ViewPatterns #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE ScopedTypeVariables #-}

module Main where

--import Debug.Trace

import Control.Monad
import Control.Monad.ST
import Control.DeepSeq
import Data.Function
import Data.Maybe
import Data.Either
import Data.Ord
import qualified Data.Foldable as Foldable
import Data.Char
import Data.List
import Data.Array.IArray hiding ((!))
import Data.Array.MArray.Safe
import qualified Data.Array.Unboxed as UA
import qualified Data.Array.IO.Safe as IA
import Data.Map.Strict (Map)
import qualified Data.Map.Strict as Map
import Data.IntMap.Strict (IntMap)
import qualified Data.IntMap.Strict as IntMap
import Data.Set (Set)
import qualified Data.Set as Set

getWords  = words <$> getLine :: IO [String]
getInts   = map read <$> getWords :: IO [Int]
getDoubles = map read <$> getWords :: IO [Double]
getInt    = read <$> getLine :: IO Int
getDouble  = read <$> getLine :: IO Double
printLines :: Show a => [a] -> IO ()
printLines = mapM_ print
printStrs = mapM_ putStrLn :: [String] -> IO ()

---- Answer Code Section ----

process :: String -> String
process = lower . insertPeriod . noVowel where
    noVowel = filter (\c -> notElem c "AOYEUIaoyeui")
    insertPeriod [] = []
    insertPeriod x  = "." ++ intersperse '.' x
    lower = map toLower

main = do
    word <- getLine
    putStrLn $ process word

import Data.Text as T

toLowerS :: String -> String
toLowerS s = unpack $ toLower (pack s)

vovel :: Char -> Bool
vovel x
  | x == 'a' || x == 'o' || x == 'y' = True
  | x == 'e' || x == 'u' || x == 'i' = True
  | otherwise = False

solve word =
  Prelude.concat $ Prelude.map (\x -> '.':[x]) consonants
  where
    consonants = Prelude.filter (fmap not vovel) (toLowerS word)

main = do
  line <- getLine
  putStrLn (solve line)

import Data.Char

isVowel :: Char -> Bool
isVowel c = any (== c) ['a', 'o', 'y', 'e', 'u', 'i']

toLowerString :: String -> String
toLowerString = map toLower

calc :: String -> String
calc [] = ""
calc (c:cs) = if isVowel c
              then calc cs
              else '.' : c : calc cs

main = do s <- getLine
          putStrLn $ calc $ toLowerString s

import Data.Char
f c | elem c "aoyeui" || c < '0' = ""
	| otherwise 	             = '.' : [c]
main = interact $ concatMap (f . toLower)

import Data.Char

main :: IO()
main = interact fn
    where fn s = concat $ [if (isVowel c) then "" else ('.':c:"") | c<-(map toLower $ init s)]
          isVowel c = c `elem` "aeiouy"

import Data.Char
main :: IO ()
main = interact $
    unlines .
    fmap (concatMap (transform . toLower)) .
    lines

transform :: Char -> String
transform x
    | x `elem` "aoyeui" = ""
    | otherwise = '.' : [x]

import Data.Char

main = interact $ unlines . map solve . lines . map toLower

addDots = concat . (map $ ("."++) . (:[]))
vowelTest = not . (flip elem $ "aeiouy")
solve = addDots . filter vowelTest

import Data.Char
main :: IO ()
main = interact $ unlines . fmap transform . lines

transform :: String -> String
transform [] = []
transform (x : xs)
    | toLower x `elem` ['a', 'o', 'y', 'e', 'u', 'i'] = transform xs
    | otherwise = '.' : toLower x : transform xs

import Data.Char
main = putStrLn . concat . map (\x -> ['.', x]) . filter (not . flip elem "aoyeui") . map toLower =<< getLine

import Data.Char

isVowels   :: Char -> Bool
isVowels c = elem lowerC ['a','e','i','o','u','y']
    where lowerC = toLower c

isCons   :: Char -> Bool
isCons c = not $ isVowels c

convertStr    :: String -> String
convertStr [] = ""
convertStr (x:xs)
 | isCons x   = if isUpper x then '.' : toLower x : convertStr xs else '.' : x : convertStr xs
 | isVowels x = convertStr xs

main :: IO ()
main = do n <- getLine
          putStr $ convertStr n

import Data.Char
import Data.List
main = interact $ ('.':) . intersperse '.' . consonants . init . map toLower
vowels = "aeiouy\n"
consonants = filter (\x->not (elem x vowels))

import Data.List
import Data.Char

main =
	let func = (++) ['.'] . intersperse '.' . filter (/= ' ') . map (\c -> if [toLower c] `isInfixOf` "aeouyi" then ' ' else toLower c)
	in
		do
		 	string <- getLine
			putStrLn $ func string

import Data.List
import Data.Char

solve = (:) '.' .  intersperse '.' . filter vowelp . map toLower
        where
          vowelp x = notElem x "aeiouy"

main = do
  foo <- getLine
  putStrLn $ solve foo

import Data.Char
main = do
    s <- getLine
    putStrLn $ f s

f s = foldl1 (++) $ map (\x -> "." ++ [x]) $ filter (`notElem` "aoueyi") $ map toLower s

import Data.Char
main = do
  in1 <- getLine
  let in2 = dotto $ filter (not. (`elem` ['a', 'e', 'i', 'o', 'u', 'y'])) $ map toLower in1
  putStrLn in2
dotto :: String -> String
dotto = foldr (\x -> (('.' :).( x :))) []

import Data.Char

answer::[Char] -> [Char]
answer = concatMap (\x->['.',x]) . filter(`notElem` "aoyuei") . fmap toLower

someFunc :: IO()
someFunc = getLine >>= putStrLn . answer

main :: IO ()
main = someFunc

import Data.Char
import Data.List
vowels=['a', 'e', 'i', 'o', 'u', 'y']
main=getLine>>=(\x-> putStrLn$('.':)$intersperse '.'$filter (\c->not (c`elem`vowels))$map toLower$ x)

import Control.Applicative
import Data.Char

vow = "aiueoy"

main = getLine >>= putStrLn . solve

solve [] = []
solve (x:xs)
  | elem y vow = solve xs
  | otherwise = ['.', y] ++ solve xs
  where y = cap x

cap c
  | 'A' <= c && c <= 'Z' = chr (ord c - ord 'A' + ord 'a')
  | otherwise = c

module Main where

import           Data.Char

vowels :: String
vowels = "aeiouyAEIOUY"

isVowel :: Char -> Bool
isVowel c = elem c vowels

removeVowels :: String -> String
removeVowels = filter (not . isVowel)

lowerString :: String -> String
lowerString = map toLower

addDots :: String -> String
addDots = foldr (\x xs -> ['.', x] ++ xs) []

f :: String -> String
f = addDots . lowerString . removeVowels

main :: IO ()
main = f `fmap` getLine >>= putStrLn

import Data.Char
main=   readsolveprint::IO()
readsolveprint::IO()
readsolveprint= getLine >>= putStrLn.solve
solve :: String->String
solve x  = foldr (\a b -> case () of
                          _ | foldr (\ a1 b2 -> a==a1 || b2 ) False "AEYUIOaeyuio" -> b
                            | otherwise -> '.':(toLower (a):b)) [] x

import Data.Char (toLower)

process :: [Char] -> [Char]
process = concat.map (\c -> ['.',c]) . filter (`notElem` "aeiouy").map toLower

main :: IO ()
main = do
    s <- getLine
    putStrLn $ process s

toLow :: Char -> Char
toLow x | elem x ['A' .. 'Z'] = toEnum (fromEnum x + 32)
        | otherwise           = x

intercalate' :: [a] -> [[a]] -> [a]
intercalate' _ []       = []
intercalate' _ (x : []) = x
intercalate' s (x : xs) = x ++ s ++ intercalate' s xs

process :: String -> String
process "" = ""
process str =
  let vowls = "aeiouy"
      str'  = map toLow str
      str'' = [ [x] | x <- str', not (elem x vowls) ]
  in  "." ++ intercalate' "." str''

main :: IO ()
main = do
  input <- getLine
  putStrLn $ process input

import Data.Char

solve = concatMap (('.':) . return) . filter (flip notElem "aoyeui") . map toLower

main = interact $ unlines . map solve . lines

import Data.Char

main = interact $ solve . map toLower

solve = foldl (\acc x -> if x `elem` "aoyeiu\n" then acc ++ [] else acc ++ ['.'] ++ [x]) []

import Data.Char
solve :: String -> String
solve s = foldr (\l acc -> if (elem l "aoyeui\n") then acc else '.':l:acc) [] $ map toLower s
main = interact solve

import Control.Applicative
import Data.Char

vowels = "aeiouy"

main = do
  s <- transform <$> getLine
  putStrLn s

toLowerCase = map toLower
removeVowels = filter (`notElem` vowels)
appendDot = concatMap (\c -> ['.',c])

transform = appendDot . removeVowels . toLowerCase

import           Data.Char
import           Data.List

answer :: String -> String
answer i = "." ++ (intersperse ('.') $ filter (\c -> not $ c `elem` "aoyeui\n") $ filter (/='\n') $ filter (/='a') $ filter (/='o') $ filter (/='y') $ filter(/='e') $ filter (/='u') $ filter (/='i') $ (map (toLower) i))

main = do interact $ answer

import           Data.Char
import           Data.List

answer :: String -> String
answer i = "." ++ (intersperse ('.') $ filter (\c -> not $ c `elem` "aoyeui\n") $ (map (toLower) i))

main = do interact $ answer

import Data.Char

solve xs = ['.':x:[] | x <- xs, not (elem x "aoyeui")]

main = interact $ concat . solve . map toLower . init

import Data.Char

solve xs = ['.':(toLower x):[] | x <- xs, notElem x "aoyeuiAOYEUI"]

main = interact $ concat . solve . init

import Data.Char

task :: [Char] -> [Char]
task [] = []
task (x:xs)
    | x `elem` "aeiouy" = task(xs)
    | x == '\n'         = task(xs)
    | otherwise         = ['.']++[x]++task(xs)

main=interact$task.(map toLower)

import Data.Char

isNotVowel x = isAlpha x && x `notElem` "aeiouy"
dot :: String -> String
dot [] = []
dot (x:xs) = '.':x:dot xs
solve = dot . filter isNotVowel . map toLower
main = interact $ solve

import Control.Applicative
import Data.Char
import Data.List

main::IO ()
main=do
    x<-(intersperse '.'.filter(\z-> notElem z "aeiouy").map toLower)<$> getLine
    putStrLn ('.':x)

import Data.Char as Char

main = do
    str <- getLine
    putStrLn $ convert str

convert :: String -> String
convert target = concat [['.',x] | x <- (map Char.toLower target), not(x `elem` "aeiou")]

import Data.Char
main :: IO ()
main = interact $ transform

transform :: String -> String
transform (x : xs)
    | elem (toLower x) ['a', 'o', 'y', 'e', 'u', 'i'] = transform xs
    | otherwise = '.' : toLower x : transform xs
transform [] = []

import Data.Char
main = interact $ init . concatMap (\x->"."++[x]) . consonants . map toLower
vowels = "aeiouy"
consonants = filter (\x->not (elem x vowels))

import Data.List
import Data.Char

solve = (:) '.' .  intersperse '.' . filter vowelp . map toLower
        where
          vowelp x = notElem x "aeiouy"

main = do
  foo <- getLine
  print $ solve foo

import Data.Char
main = do
    s <- getLine
    putStrLn $ f s

f s = foldl1 (++) $ map (\x -> "." ++ [x]) $ filter (`notElem` "aoueui") $ map toLower s

import Data.Char (toLower)

vowels :: String
vowels = "aeouiy"

isVowel :: Char -> Bool
isVowel = flip elem vowels

stringTask :: String -> String
stringTask = concatMap (\x -> if isVowel x then "" else '.' : [toLower x])

main = do
	getLine >>= putStrLn . stringTask

import Data.List
import Data.Char
main = do
  s <- getLine
  putStrLn (intersperse '.' (map toLower (filter (\x -> not $ elem (toUpper x) "AOYEUI") s)))

import Data.Char

letter :: Char -> String
letter l
  | elem l ['a', 'e', 'i', 'o', 'u', 'y'] = ""
  | otherwise = "." ++ [l]

task :: String -> String
task s = foldl (++) [] (map (letter . toLower) s)

main = do
  s <- getLine
  print . task $ s

import Data.Char

isVowel :: Char -> Bool
isVowel x =
  if x == 'a' || x == 'e' || x == 'i' || x == 'o' || x == 'u'
  || x == 'A' || x == 'E' || x == 'I' || x == 'O' || x == 'U'
  then True else False

filterVowels :: [Char] -> [Char]
filterVowels xs = filter (not.isVowel) xs

insertConsonants :: [Char] -> [Char]
insertConsonants []   = []
insertConsonants (x:xs) =
  if (not.isVowel) x
  then ['.'] ++ [x] ++ insertConsonants xs
  else [x] ++ insertConsonants xs

replaceUpperConsonants :: [Char] -> [Char]
replaceUpperConsonants = map (\x -> if (not.isVowel) x then toLower x else x)

main = do
  line <- getLine
  putStr $ replaceUpperConsonants $ insertConsonants $ filterVowels line

import Data.Char

conv :: Char -> String
conv a
 | elem a "aoyeui" = ""
 | otherwise = ['.', a]

solve :: String -> String
solve (x:xs) = (conv $ toLower x) ++ solve xs
solve ""     = ""

readInt :: String -> Int
readInt = read

parseLogic :: String -> String
parseLogic = solve

main = interact parseLogic

import Data.Char

changeVowel :: Char -> String
changeVowel c
  | elem c "aiueoy" = ""
  | isLower c = ['.', c]
  | isUpper c = ['.', toLower c]

main :: IO ()
main = do
  cs <- getLine
  putStrLn $ foldr1 (++) $ map changeVowel cs

import Data.Char
import System.IO

procLine :: String -> String
procLine [] = []
procLine (x:xs) | x `elem` "aeiouAEIOU" = procLine xs
                | otherwise = ['.', (toLower x)] ++ procLine xs

main = do
  mainLoop

mainLoop :: IO ()
mainLoop = do
  ineof <- isEOF
  if ineof
     then return ()
    else
    do line <- getLine
       putStrLn $ procLine line
       mainLoop

import Data.Char

main :: IO ()
main = putStrLn . concat . map (\x -> ['.', x]) . filter (not . flip elem "aeiou") . map toLower =<< getLine

module Main where

import Data.Char (toLower)

main :: IO ()
main = do
  inp <- getLine
  let word = fmap toLower inp
      woVowels = filter (`notElem` "aeiou") word
      output = woVowels >>= (\x -> ['.', x])
  putStrLn output

module Main where
import Data.Maybe
import Data.Char
main = getLine >>= \word -> print $ foldl (\acc c -> if toUpper c `notElem` ['A','O','Y','E','U','I'] then acc ++ "." ++ [toLower c] else acc) "" word

import Data.List
import Data.Char
main = interact $ ('.' :) . intersperse '.' . filter (`notElem` "aeiouy") . map toLower

import Data.Char
import Data.List

main = do
	s <- getLine
	putStrLn (intersperse '.' (filter (\c -> not (elem c "aeiouy")) (map toLower s)))

module Main
where
import Data.Char
import Data.List

main = do
    interact process

process str =
    let
        inp = (lines str) !! 0
        lstr = [x | x <- (map toLower inp), x `notElem` "aeiou"]
    in do
        (drop 1 . intersperse '.' $ ' ': lstr) ++ "\n"

import Control.Monad
import Data.Char

main = do
    line <- getLine
    let result = solve line
    putStrLn result

solve :: String -> String
solve s = concat $ map ((\l -> if (isVowel l) then "" else ['.', l]) . toLower) s

isVowel :: Char -> Bool
isVowel = (`elem` "aeiou")

import Data.Char (toLower)
import Data.List (intersperse)
main = getLine >>= putStrLn . ('.' :) . intersperse '.' . map toLower . filter (`notElem` "aeiou")

import Data.Char (toLower)
import Data.List (intersperse)
main = getLine >>= putStrLn . ('.' :) . intersperse '.' . map toLower . filter (`notElem` "aeiouy")

{-# LANGUAGE Safe #-}
{-# Options_GHC -O3 #-}
import Data.ByteString.Builder
import Data.Monoid
import System.IO
import qualified Data.ByteString.Char8 as C
import Data.Char

ru, ri :: C.ByteString -> Int

ru = C.foldl' (\a c -> a * 10 - 48 + ord c) 0
ri s
  | C.head s == '-' = negate $ ru $ C.tail s
  | otherwise = ru s

vowel 'a' = True
vowel 'o' = True
vowel 'y' = True
vowel 'e' = True
vowel 'u' = True
vowel 'i' = True
vowel _ = False

main = hPutBuilder stdout . byteString . C.concatMap (\c -> C.pack ['.', c]) .  C.filter (not . vowel) . C.map toLower . head . C.lines =<< C.getContents

import Data.Char

main = do
    line <- getLine
    print $ concat $ map (\x -> ['.', x]) $ filter (\x -> not $ elem x ['a', 'o', 'y', 'e', 'u', 'i']) (map (\x -> toLower x) line)

import Data.Char

myprocess :: [Char] -> [Char]
myprocess [] = []
myprocess (c:left) =
  if c `elem` ['a','e','i','o','u']
    then myprocess left
    else ['.',c] ++ myprocess left

main = do
  str <- getLine
  putStrLn $ myprocess $ map toLower str

import Data.Char

vowels = "aeiouy"

f1 :: String -> String
f1 [] = []
f1 (x:xs)
  | x `elem` vowels = f1 xs
  | otherwise       = (x:f1 xs)

f2 :: String -> String
f2 [] = []
f2 (x:xs) = ('.':x:f2 xs)

main = do
  a <- getLine
  putStrLn $ f1 $ map toLower a
  putStrLn $ f2 $ f1 $ map toLower a

import Data.Char
main = interact $ concat . map (('.':) . (:[])) . filter (flip notElem "aeiouy") . map (toLower)

import Data.Char

f xs = concat [ ['.', x] | x <- xs, x `notElem` "aoyeui"]

main = interact $ f . map toLower

import Data.Char

f xs = concat [ ['.', x] | x <- xs, x `notElem` "aoyeui "]

main = interact $ f . map toLower

main = interact (\s -> concat (map (\c->if c `elem` "AOYEIUaoyeiu\n" then "" else '.':c:"") s) ++ "\n")

import Data.Char

isVowel :: Char -> Bool
isVowel c = any (== c) ['a', 'o', 'y', 'e', 'u', 'i']

toLowerString :: String -> String
toLowerString = map toLower

calc :: String -> String
calc [] = ""
calc (c:cs) = if isVowel c
              then calc cs
              else '.' : c : calc cs

main = do s <- getLine
          print $ calc $ toLowerString s

import Data.Char (toLower)

main = putStrLn . concatMap (\ (a,b) -> [a,b]) . zip (repeat '.') . filter (`notElem` "aeiou") . map toLower =<< getLine

import Data.Char

main = interact $ addDots . filter vowelTest . map toLower

addDots = concat . (map $ ("."++) . (:[]))
vowelTest = not . (flip elem $ "aeiouy")

import Data.Char

main = interact $ map toLower . unlines . map addDots . map (filter vowelTest) . lines

addDots = concat . (map $ ("."++) . (:[]))
vowelTest = not . (flip elem $ "aeiouy")

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

main= do
	w<-   getLine
	let w1 = map toLower $ filter (\z-> notElem z "AEIOUYaeiouy") w
	let w2 = intersperse '.' w1
	putStrLn w2

import           Data.Char                      ( toLower )

transform :: String -> String
transform = concat . map transform'
    where
    transform' :: Char -> String
    transform' c
        | toLower c `elem` ['a', 'e', 'i', 'o', 'u'] = ""
        | otherwise = ['.',toLower c]

main :: IO ()
main = transform <$> getLine >>= putStrLn

import Data.Char
import Data.List

main = interact $ ('.' :) . intersperse '.' . filter (`notElem` "aeiouy") . map toLower

import Data.Char
import Data.List
vowels=['a', 'e', 'i', 'o', 'u', 'y']
main=getLine>>=(\x-> print$('.':)$intersperse '.'$filter (\c->not (c`elem`vowels))$map toLower$ x)

import Data.Char
import Data.List
vowels=['a', 'e', 'i', 'o', 'u', 'y']
main=getLine>>=(\x-> print$('.':)$intersperse '.'$map toLower$filter (\c->not (c`elem`vowels)) x)

module Main where

import           Data.Char

vowels :: String
vowels = "aeiouAEIOU"

isVowel :: Char -> Bool
isVowel c = elem c vowels

removeVowels :: String -> String
removeVowels = filter (not . isVowel)

lowerString :: String -> String
lowerString = map toLower

addDots :: String -> String
addDots = foldr (\x xs -> ['.', x] ++ xs) []

f :: String -> String
f = addDots . lowerString . removeVowels

main :: IO ()
main = f `fmap` getLine >>= putStrLn

module Main (main) where

import Data.Char
import Data.List

main :: IO ()
main = do cont <- getContents
          putStrLn $ ('.' :) $ intersperse '.' $ filter (not . (`elem` "aoyeui")) $ fmap toLower cont

import Data.Char (toLower)

process :: [Char] -> [Char]
process = concat.map (\c -> ['.',c]) . filter (`notElem` ['a','e','i','o','u']).map toLower

main :: IO ()
main = do
    s <- getLine
    putStrLn $ process s

import Data.Char

main = interact $ solve . map toLower

solve = foldl (\acc x -> if x `elem` "aoyeiu" then acc ++ [] else acc ++ ['.'] ++ [x]) []

import Data.Char

getAnswer :: String -> String
getAnswer line = change (map toLower line)

change :: String -> String
change [] = []
change (letter:rest) = if isVowel letter
                       then "" ++ (change rest)
                       else "." ++ [letter] ++ (change rest)

isVowel :: Char -> Bool
isVowel letter = elem letter "aoyeui"

main :: IO ()
main = do
  line <- getLine
  print $ getAnswer line

import Data.Char as Char
main = interact $ foldr1 (++) . map (\c -> '.':[c]) . filter (\c -> not $ elem c "aeiou") . map Char.toLower

import Data.Char as Char
main = interact $ foldr1 (++) . map (\c -> '.':[c]) . filter (\c -> not $ elem c "aeiou\n") . map Char.toLower

import Data.Char
import Control.Monad
main = interact $ join . map p

p 'A' = ""
p 'E' = ""
p 'I' = ""
p 'O' = ""
p 'U' = ""
p 'a' = ""
p 'e' = ""
p 'i' = ""
p 'o' = ""
p 'u' = ""
p '\n' = ""
p x = '.' : toLower x : mempty

import Data.Char
import Control.Monad
main = interact $ join . map p

p 'A' = ""
p 'E' = ""
p 'I' = ""
p 'O' = ""
p 'U' = ""
p 'a' = ""
p 'e' = ""
p 'i' = ""
p 'o' = ""
p 'u' = ""
p x = '.' : toLower x : mempty

module Main where

import Control.Applicative

import Data.Char(isLower, toLower)

toInt :: String -> Int
toInt = read

isVowel :: Char -> Bool
isVowel = (`elem` "aeiou") . toLower

solve :: String -> String
solve (x:xs)
    | isVowel x =                     solve xs
    | isLower x = '.':        x:[] ++ solve xs
    | otherwise = '.':toLower x:[] ++ solve xs
solve "" = ""

main :: IO ()
main = putStrLn <$> solve =<< getLine

import Data.Char

check :: String -> String
check xs = g $ map toLower xs
    where
      g [] = []
      g (x : xs)
          | elem x ['a', 'o', 'y', 'e', 'u', 'i'] = g xs
          | otherwise = '.' : x : g xs

main :: IO ()
main = do cs <- getLine
          print $ check cs

module Main where

import Data.Char

(|>) = flip (.)

isVowel :: Char -> Bool
isVowel c = (toLower c) `elem` ['a', 'e', 'i', 'o', 'u']

main = interact $
    takeWhile (\x -> x /= '\n')
    |> filter (not . isVowel)
    |> map toLower
    |> map (\x -> ['.',x])
    |> foldr (++) []

module Main where

import Data.Char

(|>) = flip (.)

isVowel :: Char -> Bool
isVowel c = (toLower c) `elem` ['a', 'e', 'i', 'o', 'u']

main = interact $
    filter (not . isVowel)
    |> map toLower
    |> map (\x -> ['.',x])
    |> foldr (++) []

import Data.Char

main = do
	line <- getLine
	putStrLn $ answer line;

answer :: String -> String
answer a = foldr1 (++) $ zipWith (\a b -> (a : b : [])) (repeat '.') $ filter (not . isVowel) a

isVowel :: Char -> Bool
isVowel x = elem (toUpper x) ['A', 'E', 'I', 'O', 'U']

import Data.Char

main = do
	line <- getLine
	putStrLn $ answer line;

answer :: String -> String
answer a = foldr1 (++) $ zipWith (\a b -> (a : b : [])) (repeat '.') $ map toLower $ filter (not . isVowel) a

isVowel :: Char -> Bool
isVowel x = elem (toUpper x) ['A', 'E', 'I', 'O', 'U']

import Data.List
import Data.Char

removeVowel :: Char -> Bool
removeVowel s = not (s `elem` ['a','e','i','o','u'])

removeVowels :: String -> String
removeVowels str = filter (removeVowel) str

addDots :: String -> String
addDots str = intersperse '.' str

processStr :: String -> String
processStr str = let lstr = map toLower str in
                 let pstr = addDots $ removeVowels lstr in ['.'] ++ pstr

main = do
  str <- getLine
  putStrLn( processStr str  )

import Data.Char

main = interact $ solve []

solve acc [] = acc
solve acc (s:ss)
  | elem s "AOYEUIaoyeui" = solve acc ss
  | otherwise = solve (acc++"."++ [toLower s]) ss

import Data.Char

main = interact $ solve []

solve acc [] = acc
solve acc (s:ss)
  | elem s "AOYEUI aoyeui" = solve acc ss
  | otherwise = solve (acc++"."++ [toLower s]) ss

import Char
g x | elem x "aoyeui" = ""
    | 1 > 0           = '.':[x]
main = interact $ concatMap (g.toLower)

import Data.Char
import Data.List
rv []=[]
rv (x:xs)
	| elem x "aeiuo" = rv xs
	| otherwise = x: rv xs
f s=init$'.':intersperse '.' (rv$map toLower s)
main=interact$f

import Data.Char
import Data.List
rv []=[]
rv (x:xs)
	| elem x "aeiuo" = rv xs
	| otherwise = x: rv xs
f s='.':intersperse '.' (rv$map toLower (init s))
main=interact$f

import Data.Char
import Data.List

cons x = not (x `elem` "aeiou")

main = interact $ ('.':) . intersperse '.' . filter cons . map toLower

-- notice on hoogle that you can "hoogle"
-- function names which are similar ( or seemingly identical )
-- to certain C-language function names such as

-- isUpper
-- isLower
-- toUpper
-- toLower

import Data.Char
import Data.Array

convStr a b
  | (null a) = b
  | (head a) == 'A' || (head a) == 'a' ||
    (head a) == 'E' || (head a) == 'e' ||
    (head a) == 'I' || (head a) == 'i' ||
    (head a) == 'O' || (head a) == 'o' ||
    (head a) == 'U' || (head a) == 'u' = convStr (tail a) b
  | otherwise = convStr (tail a) (concat [b,['.'],[(toLower (head a))]])

main = do
  oi <- getLine
  let ans = convStr oi ""
  putStrLn ans

import Data.Char
import Data.List

isConsonant :: Char -> Bool
isConsonant c = (toLower c) `notElem` ['a', 'e', 'i', 'o', 'u']

periodize :: String -> String
periodize s = concat . transpose $ [replicate (length s) '.', s]

main = do
    line <- getLine
    print . periodize . map toLower . filter isConsonant $ line

import Data.Char
import Data.List

isConsonant :: Char -> Bool
isConsonant c = (toLower c) `notElem` ['a', 'e', 'i', 'o', 'u']

periodize :: String -> String
periodize s = concat . transpose $ [replicate (length s) '.', s]

main = do
    line <- getLine
    putStrLn . periodize . map toLower . filter isConsonant $ line

import Data.Char
prn [a]=do
            putChar a
            putChar '.'
prn (x:xs)=do
            prn [x]
            prn xs
f str=  do
        putChar '.'
        prn [x|x<-(map toLower str),not(elem x "aeiou")]

main=do
        str<-getLine
        f str

import Data.Char
prn [a]=do
            putChar '.'
            putChar a
prn (x:xs)=do
            prn [x]
            prn xs

main=do
        str<-getLine
        prn [x|x<-(map toLower str),not(elem x "aeiou")]

import Data.Char
prn [a]=do
            putChar '.'
            putChar a
prn (x:xs)=do
            prn [x]
            prn xs

main=do
        str<-getLine
        prn [x|x<-(map toUpper str),not(elem x "aeiou")]

import Data.Char
import Data.List
main=interact$("." ++).intersperse '.'.map toUpper.filter (`elem`"AOYEUI")

import Data.Char
import Data.List
main=interact$("." ++).intersperse '.'.filter (`elem`"aoyeui").map toLower

import Data.Char
import Data.List
main=interact$(\x->"." ++ x ++ ".").intersperse '.'.filter (`notElem`"aoyeui").map toLower

import Data.Char
import Data.List
main=interact$("." ++).intersperse '.'.filter (`elem`"aoyeui").map toUpper

import Data.Char
import Data.List
main=interact$("." ++).intersperse '.'.filter (`notElem`"aoyeui").map toLower

import Data.Char
f c | elem c "aoyeui" = ""
	| otherwise 	  = '.' : [c]
main = interact $ concatMap (f . toLower)

import Data.Char

main :: IO()
main = interact fn
    where fn s = concat $ [if (isVowel c) then "" else ('.':c:"") | c<-(map toLower $ init s)]
          isVowel c = c `elem` "aeiou"

import Data.Char

main :: IO()
main = interact fn
    where fn s = concat $ [if (isVowel c) then "" else ('.':c:"") | c<-(map toLower s)]
          isVowel c = c `elem` "aeiou"

import Data.Char

isVowels   :: Char -> Bool
isVowels c = elem lowerC ['a','e','i','o','u']
    where lowerC = toLower c

isCons   :: Char -> Bool
isCons c = not $ isVowels c

convertStr    :: String -> String
convertStr [] = ""
convertStr (x:xs)
 | isCons x   = if isUpper x then '.' : toLower x : convertStr xs else '.' : x : convertStr xs
 | isVowels x = convertStr xs

main :: IO ()
main = do n <- getLine
          putStr $ convertStr n

import Data.List
import Data.Char

main =
	let func = (++) ['.'] . intersperse '.' . filter (/= ' ') . map (\c -> if [toLower c] `isInfixOf` "aeouy" then ' ' else toLower c)
	in
		do
		 	string <- getLine
			putStrLn $ func string

import Data.List
import Data.Char

main =
	let func = (++) ['.'] . intersperse '.' . filter (/= ' ') . map (\c -> if [c] `isInfixOf` "aeouy" then ' ' else toLower c)
	in
		do
		 	string <- getLine
			putStrLn $ func string

import Data.Char (toLower)

main = do
  f <- getLine
  putStrLn $ encode f

vowels = ['a', 'e', 'i', 'o', 'u']

encode :: String -> String
encode (x:xs) = if x `elem` vowels
                   then encode xs
                   else '.':(toLower x):encode xs
encode [] = []

import Data.Char (toLower)

main = do
  f <- getLine
  putStrLn $ encode f

vowels = ['a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U']

encode :: String -> String
encode (x:xs) = if x `elem` vowels
                   then encode xs
                   else '.':(toLower x):encode xs
encode [] = []

import Control.Applicative
import Data.Char

vow = "aiueo"

main = getLine >>= putStrLn . solve

solve [] = []
solve (x:xs)
  | elem y vow = solve xs
  | otherwise = ['.', y] ++ solve xs
  where y = cap x

cap c
  | 'A' <= c && c <= 'Z' = chr (ord c - ord 'A' + ord 'a')
  | otherwise = c

module Main where

import Control.Applicative
import Control.Monad
import Data.Char           (toLower)
import Data.List           (intersperse)

vowels :: String
vowels = "aoyeui"

process :: String -> String
process input = show $ solve word
  where
    word = map toLower input
    solve word = '.' : intersperse '.' (filter (`notElem` vowels) word)

main :: IO ()
main = interact process

toLow :: Char -> Char
toLow x | elem x ['A' .. 'Z'] = toEnum (fromEnum x + 32)
        | otherwise           = x

intercalate' :: [a] -> [[a]] -> [a]
intercalate' _ []       = []
intercalate' _ (x : []) = x
intercalate' s (x : xs) = x ++ s ++ intercalate' s xs

process :: String -> String
process "" = ""
process str =
  let vowls = "aeiou"
      str'  = map toLow str
      str'' = [ [x] | x <- str', not (elem x vowls) ]
  in  "." ++ intercalate' "." str''

main :: IO ()
main = do
  input <- getLine
  putStrLn $ process input

import Data.Char
solve :: String -> String
solve s = foldr (\l acc -> if (elem l "aoyeui") then acc else '.':l:acc) [] $ map toLower s
main = interact solve

import Control.Applicative
import qualified Data.ByteString.Char8 as B
import Data.Char

vowels = "aeiouy"

main = do
  s <- transform <$> B.getLine
  B.putStrLn s

toLowerCase = B.map toLower
removeVowels = B.filter (`notElem` vowels)
appendDot = B.concatMap (\c -> B.pack $ '.':c:[])

transform = appendDot . removeVowels . toLowerCase

import           Data.Char
import           Data.List

answer :: String -> String
answer i = intersperse ('.') $ filter (/='a') $ filter (/='o') $ filter (/='y') $ filter(/='e') $ filter (/='u') $ filter (/='i') $ (map (toLower) i)

main = do interact $ answer

import Data.Char (toLower)
import Data.List (intersperse)

main = do
  input <- getLine
  let vowels = ['a', 'e', 'i', 'o', 'u']
  putStrLn $
    (('.':) .
    intersperse '.' .
    filter (`notElem` vowels) .
    map toLower) input

import Data.Char (toLower)

main = do
  input <- getLine
  let vowels = ['a', 'e', 'i', 'o', 'u']
  putStrLn $
    (foldr (\c acc -> '.':c:acc) [] .
    filter (`notElem` vowels) .
    map toLower) input

import Data.Char

solve xs = ['.':x:[] | x <- xs, not (elem x "aoyeui")]

main = interact $ concat . solve . map toLower

import Data.Char

task :: [Char] -> [Char]
task [] = []
task (x:xs)
    | x `elem` "aeiouy" = task(xs)
    | otherwise         = ['.']++[x]++task(xs)

main=interact$task.(map toLower)

import Data.Char

isNotVowel x = isAlpha x && x `notElem` "aeiou"
dot :: String -> String
dot [] = []
dot (x:xs) = '.':x:dot xs
solve = dot . filter isNotVowel . map toLower
main = interact $ solve

import Data.Char

isNotVowel x = x `notElem` "aeiou"
dot :: String -> String
dot [] = []
dot (x:xs) = '.':x:dot xs
solve = dot . filter isNotVowel . map toLower
main = interact $ solve

import Control.Applicative
import Data.Char
import Data.List

main::IO ()
main=do
    x<-(intersperse '.'.filter(\z-> notElem z "aeiou").map toLower)<$> getLine
    putStrLn ('.':x)

import Data.Char
main = interact $ (foldl func "").(filter (\x -> not(x `elem` "aoyeui"))) . (map toLower)
    where func str c = str ++ "." ++ [c]


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

type Case = Int

solve :: Case -> String
solve n = show ans
  where
    lim = 1 + n

    gcd 0 n = n
    gcd m n
      | m > n =
        let n' = m `mod` n
        in gcd n' n
      | otherwise =
          let n' = n `mod` m
          in gcd n' m

    ans = sum [ 1 | u<-takeWhile (\u->u*u<lim) [2..],
                v<-[1..u-1], u*u+v*v<lim, gcd u v == 1, (u-v) `mod` 2 /= 0,
                i<-takeWhile (\i -> i*(u*u+v*v)<lim) [1..]]

    mmum = n
    bruteforce = [ (a,b,c) | a<-[1..mmum], b<-[a..mmum], c<-[b..mmum], a^2+b^2==c^2 ]

main = do
  n <- read <$> getLine
  putStrLn $ solve n

--  304A

import Data.Array.ST
import Data.Array.Unboxed

sqrt's :: UArray Int Bool
sqrt's  =  runSTUArray $ do
    array  <-  newArray (1, n^2) False
    sequence
      [writeArray array (i^2) True
        | i <- [1  .. n]]
    return array
  where
    n  =  10^4 + 1

sqrtInt :: Int -> Int
sqrtInt  =  round . sqrt . fromIntegral

isSqrt :: Int -> Bool
isSqrt n  =  sqrt's ! n

solve :: Int -> Int
solve n  =  length
    [1 | a <- [1 .. (n * 100) `div` 141],
         b <- [a+1 .. sqrtInt (n^2 - a^2)],
         isSqrt (a^2 + b^2)]

main :: IO ()
main  =  readLn >>= print . solve

expand :: Int -> (Int, Int, Int) -> [(Int, Int, Int)]
expand n t@(x,y,z)
    | any (>n) [x,y,z] = []
    | otherwise = t : concatMap (expand n) (map fromMat matrices)
    where fromMat x = case map (mul3ple t) x of [u,v,w] -> (u,v,w)
matrices = [[( 1,-2, 2),( 2,-1, 2),( 2,-2, 3)]
           ,[( 1, 2, 2),( 2, 1, 2),( 2, 2, 3)]
           ,[(-1 ,2 ,2),(-2 ,1 ,2),(-2 ,2 ,3)]]
mul3ple (u,v,w) (i,j,k) = u*i + v*j + w*k
solve n = sum . map cnt $ expand n (3,4,5)
    where cnt t@(x,y,z) = n `div` maximum [x,y,z]
main = putStrLn . show . solve . read =<< getLine

import Control.Applicative
import Data.List

main=do
	n<-read<$> getLine:: IO   Int
	print $ length[1|a<-[1..n-1],b<-[a..n-1], let c2=   a*a+b*b, c2 <=n*n , let d= floor (sqrt (fromIntegral c2)), d*d ==c2 ]

{-# OPTIONS -O2 #-}
import qualified Data.Set as S
main = fmap (solve.read) getLine >>= print

solve :: Int -> Int
solve n = length [ () | a <- [1..n], b <- [a+1..n], fm (a*a+b*b)]
   where fm v = v <= n*n && c*c == v
            where c = truncate $ sqrt $ (fromIntegral v :: Float)


main = readsolveprint
readsolveprint =  interact $ solve "". head.take 1 . lines
  where
      solve "1111111" _  ="YES"
      solve "0000000"  _  ="YES"
      solve _ "" ="NO"
      solve _ (y:ys)= solve (take 7 (y:ys)) ys

module Main where

import Data.List

main = do
    str <- getLine
    putStrLn $ if isInfixOf (replicate 7 '0') str || isInfixOf (replicate 7 '1') str then "YES" else "NO"

import Data.List (groupBy)
import Data.Bool (bool)

main = interact $
  bool "YES" "NO" . null . filter (>=7) . map length . groupBy (==)

import Data.List
main=interact$(\x-> if (isInfixOf "1111111" x || isInfixOf "0000000" x) then "YES" else "NO")

import Data.List
f x
    | (isInfixOf "0000000" x) || (isInfixOf "1111111" x) = "YES"
    | otherwise = "NO"
main=interact$f

import Data.List

showYN True  = "YES"
showYN False = "NO"

main = interact $ showYN . any (>=7) . map length . group

-- vim: set expandtab:

import Data.List

dangerous lst
  | (null lst) = False
  | (length (head lst)) > 6= True
  | otherwise = dangerous (tail lst)

main = do
  gg <- getLine
  let ss = group gg
  if (dangerous ss)
    then putStrLn "YES"
    else putStrLn "NO"

-- Snippet: partitionWith
partitionWith1 eq (a1 : an)
    | not (null an) && eq a1 (head an) = (a1 : r, aLeft)
    | otherwise = ([a1], an)
    where (r, aLeft) = partitionWith1 eq an

partitionWith eq a
    | null a = []
    | otherwise = r : partitionWith eq aLeft
    where (r, aLeft) = partitionWith1 eq a

main = do
    s <- getLine
    let p = (partitionWith (==) s)
    putStrLn $ if any ((>= 7) . length) p then "YES" else "NO"

import Data.List

findSub sub xs = findIndex (isPrefixOf sub ) (tails xs)

solve [s]
    | findSub "0000000" s /=  Nothing  || findSub "1111111" s /= Nothing   = "YES"
    | otherwise = "NO"

main = interact $ solve . words

import Data.List

main = do
    s <- getLine
    putStrLn $
        if any (\l -> length l >= 7) $ group s then "YES" else "NO"

import Data.List

main :: IO ()
main = do
    teams <- getLine
    putStrLn (if isInfixOf "1111111" teams || (isInfixOf "0000000" teams) then "YES" else "NO" )

solve [] = []
solve (x : []) = [1]
solve (x : xs)
    | x == (head xs) = (head $ solve xs) + 1 : (tail $ solve xs)
    | otherwise = 1 : solve xs

main = do
    s <- getLine
    putStrLn $ if (maximum $ solve s) >= 7 then "YES" else "NO"

import Data.List

main = do
  s <- getLine
  putStrLn $ if isInfixOf "0000000" s || isInfixOf "1111111" s then "YES" else "NO"

import Data.List as L
import Data.Char

main = do
	string <- getLine
	putStrLn $ if (L.any ((>=7).length) $ group string) then "YES" else "NO"

main = getLine >>= putStrLn . fnc

fnc :: String -> String
fnc pstn = if ( thrd (dangpos pstn) >= 7) then "YES" else "NO"

dangpos :: String -> (Char,Int,Int)
dangpos xs = foldl ( \ (acc,n,m) x   -> if x==acc then (acc, n+1 ,maximum [n+1,m]) else (x,1,m )) ('0',1,1) xs

thrd (a,b,c) = c;

import Prelude hiding (any)

isPrefixOf [] _ = True
isPrefixOf _ [] = False
isPrefixOf (x:xs) (y:ys) = x == y && isPrefixOf xs ys

any'' p = or . map p

any' _ [] = False
any' p (x:xs) = p x || any' p xs

tails' :: [a] -> [[a]]
tails' [] = []
tails' (x:xs) = (x:xs) : tails' xs

isInfixOf' :: Eq a => [a] -> [a] -> Bool
isInfixOf' xs ys = any' (isPrefixOf xs) (tails' ys)

football xs
    | isInfixOf' "0000000" xs || isInfixOf' "1111111" xs = "YES"
    | otherwise                                          = "NO"

main = interact$football

main = interact $ f1 0 ' ' . head . lines
f1 a b [] = "NO"
f1 a b (c:d) = if b==c then (if a+1>=7 then "YES" else f1 (a+1) b d) else f1 1 c d

import Data.Maybe
import Data.List

main = interact $ (answer.isJust.find (7<=).map length.group)
  where answer True  = "YES"
        answer False = "NO"

import Data.Function

main = do
	teams <- getLine
	let danger = calcDanger teams 1 1
	putStrLn $ if danger >= 7 then "YES" else "NO"

calcDanger::String -> Int -> Int -> Int
calcDanger teams index res = if res >= 7 || length teams == index
								then res
							 else if teams !! (index - 1) == teams !! index
							 	then calcDanger teams (index + 1) (res + 1)
							 else
							 	calcDanger teams (index + 1) 1

import Data.List

main = do
	teams <- getLine
	putStrLn $ if isInfixOf "0000000" teams || isInfixOf "1111111" teams
					then "YES"
					else "NO"

dangerousImpl 7 _ _ = "YES"
dangerousImpl x _ [] = "NO"
dangerousImpl x p (l:ls)
  | p==l = dangerousImpl (x+1) l ls
  | otherwise = dangerousImpl 1 l ls

dangerous [] = "NO"
dangerous (l:ls) = dangerousImpl 1 l ls

main = do
    l <- getLine
    putStrLn (dangerous l)

isDangerous "1111111" = True
isDangerous "0000000" = True
isDangerous a | length a > 7 = isDangerous (take 7 a) || isDangerous (tail a)
              | otherwise = False
caps a = putStrLn $ if isDangerous a then "YES" else "NO"
main = getLine >>= caps

import Data.List

main = do
  input <- getLine
  putStrLn $ id $ danger input

danger ::[Char] -> String
danger x
  |isInfixOf "0000000" x = "YES"
  |isInfixOf "1111111" x = "YES"
  |otherwise = "NO"

main = interact go

go (c:cs) = go' 6 c cs

go' 0 _ _ = "YES\n"
go' _ _ [] = "NO\n"
go' n c0 (c:cs)
  | c0 == c = go' (n-1) c cs
  | otherwise = go' 6 c cs

module Main where
import Data.List

solve :: String -> String
solve x =
    if (length $ filter (>=7) $ map length $ group x) > 0
    then "YES"
    else "NO"

main = do
    line <- getLine
    putStrLn $ solve line

import Data.List

main::IO ()
main=do
    a<-getLine
    putStrLn $ if isInfixOf "0000000" a || isInfixOf "1111111" a then "YES" else "NO"

import Data.List
main = interact $ (\x -> if (any (`isInfixOf` x) ["1111111","0000000"]) then "YES" else "NO")

import Data.List (group)

main :: IO ()
main = getLine >>= putStrLn . solve

solve :: String -> String
solve cs = if any ((>=7) . length) (group cs) then "YES" else "NO"

import Data.List (group)

solve :: (Eq a) => [a] -> Bool
solve = any ((>=7).length) . group

main = do players <- getLine
          case solve players of True -> putStrLn "YES"
                                _ -> putStrLn "NO"

module Main where

import Data.List (group)

solve :: (Eq a) => [a] -> Bool
solve l = any (>=7) . map length $ group l

main = do players <- getLine
          case solve players of True -> putStrLn "YES"
                                False -> putStrLn "NO"

import Data.List

run str = if (>=7) $ maximum $ map length $ group str
          then "YES"
          else "NO"

main = interact run

main = interact (\s -> if dangerous s then "YES" else "NO")
dangerous s | length s < 7 = False
            | otherwise = (all (\x -> x == head s) $ take 7 s) || (dangerous $ tail s)

import Data.List

main :: IO()
main = do
	t <- getLine
	putStr $ getAnswer t

getAnswer xs = gA xs 0 (head xs)
		where
			gA []     cnt _
				| cnt >= 7	= "YES"
				| otherwise	= "NO"
			gA (x:xs) cnt l
				| cnt >= 7	= "YES"
				| x == l	= gA xs (cnt + 1) x
				| otherwise	= gA xs 1 x

module Main where

longestSeq :: Int -> Int -> Char -> String -> Int
longestSeq res _ _ [] = res
longestSeq res count prev (x:xs)
  | prev == x = let biggerCount = count + 1 in
      longestSeq (max res biggerCount) biggerCount x xs
  | otherwise = longestSeq (max res count) 1 x xs

main :: IO ()
main = do
  pos <- getLine
  let lengthSeq = longestSeq 1 1 ' ' pos
      output = if lengthSeq >= 7 then "YES" else "NO"
  putStrLn output

module Main where

longestSeq :: Int -> Int -> Char -> String -> Int
longestSeq res _ _ [] = res
longestSeq res count prev (x:xs)
  | prev == x = longestSeq (max res (count + 1)) (count + 1) x xs
  | otherwise = longestSeq (max res count) 1 x xs

main :: IO ()
main = do
  pos <- getLine
  let lengthSeq = longestSeq 1 1 ' ' pos
      output = if lengthSeq >= 7 then "YES" else "NO"
  putStrLn output

import Prelude
import List
import Char

main = interact q

q = func

func::String->String
func = solve

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

toInt::String->Int
toInt = read

asInteger::String->Integer
asInteger = read

toString::Int->String
toString = show

solve::[Char]->String
solve a | ans a     = "YES"
        | otherwise = "NO"

ans::[Char]->Bool
ans = (> 6) . maximum . map length . group

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

import Data.List

solve :: String -> Bool
solve = any ((>= 7) . length) . group

main = do
    s <- getLine
    putStrLn $ if solve s then "YES" else "NO"

module Main where
import Data.List
main = getLine >>= \l -> putStrLn $ if isInfixOf "0000000" l || isInfixOf "1111111" l then "YES" else  "NO"

import Data.Char

h :: String -> Int -> Char -> Bool
h [] cnt _ =
    if (cnt >= 7)
    then True
    else False
h (x:xs) acc unit
    | (acc >= 7) = True
    | otherwise =
        if x == unit
        then h xs (acc + 1) unit
        else h xs 1 x

main :: IO()
main = do
    a <- getLine
    if (h (tail a) 1 (a!!0))
    then putStrLn "YES"
    else putStrLn "NO"

import Data.List

main = interact $ \s -> if isDangerous s then "YES" else "NO"

isDangerous :: String -> Bool
isDangerous = any (>=7) . map length . group

solve :: [Char] -> [Char]
solve ('0' : '0' : '0' : '0' : '0' : '0' : '0' : xy) = "YES"
solve ('1' : '1' : '1' : '1' : '1' : '1' : '1' : xy) = "YES"
solve ('0' : '0' : xs) = solve ('0':xs)
solve ('1' : '0' : xs) = solve ('0':xs)
solve ('0' : '1' : xs) = solve ('1':xs)
solve ('1' : '1' : xs) = solve ('1':xs)
solve _ = "NO"

main :: IO()
main = do
    s <- getLine
--    contents <- getContents
--    let input = map ((\(a:b:_) -> (a, b)) . map (read :: String -> Int) . words) $ lines contents
    putStr(solve s)

import Data.List
main = do
    a <- getLine
    case filter ((>=7).length) $ group a of
        [] -> putStrLn "NO"
        otherwise -> putStrLn "YES"

module Main where

import Data.List
import Data.Int
import Data.Char

readInt :: String -> Int64
readInt = read

check :: String -> Char -> Int -> Bool
check _ _ 7 = True
check [] _ _ = False
check (s:ss) last cnt = if s == last then check ss last (cnt + 1) else check ss s 1

main :: IO ()
main = do
    s <- getLine
    putStrLn $ if check s '2' 0 == True then "YES" else "NO"

import Data.List
main = do n<-getLine
          putStrLn $ if (all (<7).map length.group) n then
                         "NO"
                     else
                         "YES"

import Data.List
main=interact$f.any ((>6).length).group
f a|a="YES"|1>0="NO"

import List
p b|b="YES"|1>0="NO"
main=interact$p.any((>6).length).group

import Data.List (group)

main :: IO ()
main = do
    players <- getLine
    putStrLn $ if null $ dropWhile (\l -> length l < 7) $ group players
                then "NO"
                else "YES"
    return ()

import Control.Applicative
import Data.List
main= do
	w<-getLine
	let x=take 1 $ filter (\z1-> (snd z1 >=7) ) $ map (\z->(z, length z)) $ group w
	putStrLn $ if length x ==1 then "YES" else "NO"

{-
A. Football
============
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Petya loves football very much. One day, as he was watching a football match, he was writing the players' current positions on a piece of paper. To simplify the situation he depicted it as a string consisting of zeroes and ones. A zero corresponds to players of one team; a one corresponds to players of another team. If there are at least 7 players of some team standing one after another, then the situation is considered dangerous. For example, the situation 00100110111111101 is dangerous and 11110111011101 is not. You are given the current situation. Determine whether it is dangerous or not.

Input
-----
The first input line contains a non-empty string consisting of characters "0" and "1", which represents players. The length of the string does not exceed 100 characters. There's at least one player from each team present on the field.

Output
------
Print "YES" if the situation is dangerous. Otherwise, print "NO".

Sample test(s)
---------------
input
```
001001
```
output
```
NO
```

input
```
1000000001
```
output
```
YES
```
-}
import Data.List (group)

boolToStr :: Bool -> String
boolToStr True = "YES"
boolToStr False = "NO"

isDangerous :: String -> Bool
isDangerous s = 7 <= (maximum . map length $ group s)

main = do
  input <- getLine
  (putStrLn . boolToStr . isDangerous) input

import Data.List
main = interact $ \x -> if isInfixOf "0000000" x || isInfixOf "1111111" x then "YES" else "NO"

import Data.List
main = interact work

work :: String -> String
work input = if (maximum . map length . group) input >= 7 then "YES" else "NO"

import Data.List

main = getLine >>= putStrLn.answer.all (<7).map length.group

answer :: Bool -> String
answer True  = "NO"
answer False = "YES"

import Data.List

ans str=if any (\x->length x>6) $ group str then "YES" else "NO"

main = interact ans

import Data.List
main :: IO ()
main = getLine >>= putStrLn . yn . sol

sol :: String -> Bool
sol = any (>= 7) . map  length . group

yn :: Bool -> String
yn res
    | res = "YES"
    | otherwise = "NO"

import Data.List

work :: String -> String
work input
    | maximum  (map length (group input)) >= 7 = "YES"
    | otherwise = "NO"

main :: IO ()
main = interact work

import Data.List

main = interact $ (\x -> if x then "YES" else "NO") . any ((> 6) . length) . group

import Data.List

solve x
    | isInfixOf "1111111" x = "YES"
    | isInfixOf "0000000" x = "YES"
    | otherwise        = "NO"
main = putStrLn . solve =<< getLine

module Main where

isDanger :: [Char] -> Char -> Int -> Bool
isDanger (x:xs) curChar howMuch | howMuch == 7 = True
                              | length xs == 0 = curChar == x && howMuch == 6
                              | curChar == x = isDanger xs x (howMuch + 1)
                              | otherwise = isDanger xs x 1

main = do
    line <- getLine
    putStrLn (if isDanger line '_' 0 then "YES" else "NO")

conseq [x] cur m = m+1
conseq (x:y:xs) cur m
  | x == y = conseq (y:xs) (cur+1) (max (cur+1) m)
  | otherwise = conseq (y:xs) 0 m

main = do
  bs <- getLine
  putStrLn $ if conseq bs 0 0 >= 7 then "YES" else "NO"

main = interact $ solve

solve :: [Char] -> [Char]
solve str = solve' str '0' 0

solve' :: [Char] -> Char -> Int -> [Char]
solve' _ _ 7 = "YES"
solve' "" _ _ = "NO"
solve' (c:str) char count
    | c == char = solve' str char (count+1)
    | otherwise = solve' str c 1

module Main (main)
    where

import Data.List (group)

main :: IO ()
main = putStrLn . toYesNo . check =<< getLine
    where check = (>6) . maximum . map length . group
          toYesNo True  = "YES"
          toYesNo False = "NO"

import Data.List
go l = if maximum(map length $ group l)>=7 then "YES" else "NO"
main = interact go

import Data.List
solve :: String -> Bool
solve l = (maximum $ map length $ group l) >= 7

main = do
    l <- getLine
    let r = solve l
    putStrLn $ if r then "YES" else "NO"

allsame s
    | (length s) <= 1 = True
    | head s /= (s !! 1) = False
    | otherwise = allsame (tail s)

solve s
    | (length s) < 7 = "NO"
    | allsame (take 7 s) = "YES"
    | otherwise = solve (tail s)

main = do
    s <- getLine
    putStrLn (solve s)

isDangerous :: String -> Bool
isDangerous [] = False
isDangerous (x:xs) = helper x xs 1
  where helper :: Char -> String -> Int -> Bool
        helper _ _ 7 = True
        helper _ [] _ = False
        helper c (x:xs) count
         | x == c    = helper c xs (count + 1)
         | otherwise = helper x xs 1

solution :: String -> String
solution string
  | isDangerous string = "YES"
  | otherwise = "NO"

main :: IO ()
main = do
  line <- getLine
  putStrLn (solution line)

risk [] val
    | val >= 7 = "YES"
    | val < 7 = "NO"

risk (x:y:[]) val
    | x == y = risk [] (val + 1)
    | x /= y = risk [] 1

risk (x:y:z) val
    | val >= 7 = "YES"
    | x == y = risk (y:z) (val + 1)
    | x /= y = risk (y:z) 1

main = do
  s <- getLine
  putStrLn $ risk s 0

risk [] val
    | val >= 7 = "YES"
    | val < 7 = "NO"

risk (x:y:z) val
    | z == [] && val < 7 = "NO"
    | val > 6 = "YES"
    | x == y = risk (y:z) (val + 1)
    | x /= y = risk (y:z) 0

main = do
  s <- getLine
  putStrLn $ risk s 0

risk [] val
    | val >= 7 = "YES"
    | val < 7 = "NO"

risk (x:y:z) val
    | z == [] && val < 7 = "NO"
    | val > 6 = "YES"
    | x == y = risk (y:z) (val + 1)
    | x /= y = risk (y:z) 1

main = do
  s <- getLine
  putStrLn $ risk s 0

import Data.List
main=interact$show.(\x-> if (isInfixOf "1111111" x || isInfixOf "0000000" x) then "YES" else "NO")

import Data.List
f x
    | (isInfixOf "0000000" x) || (isInfixOf "111111" x) = "YES"
    | otherwise = "NO"
main=interact$f

import Data.List as L
import Data.Char

main = do
	string <- getLine
	putStrLn $ if (L.any ((>7).length) $ group string) then "YES" else "NO"

import Data.Char

solve :: Eq a => [a] -> Bool
solve []     = False
solve (x:xs) = let cnt = length $ takeWhile (== x) xs
               in cnt >= 7 || solve xs

ans True  = "YES"
ans False = "NO"

main = do
  s <- getLine
  putStrLn $ ans $ solve s

import Data.List
import Data.Bits

solve :: String -> String
solve s | any (\x -> length x > 6) $ group s = "YES"
        | True = "NO"

main :: IO ()
main = do
    s <- getLine
    print $ solve s

import Prelude hiding (any)

isPrefixOf [] _ = True
isPrefixOf _ [] = False
isPrefixOf (x:xs) (y:ys) = x == y && isPrefixOf xs ys

any'' p = or . map p

any' _ [] = False
any' p (x:xs) = p x || any' p xs

tails' :: [a] -> [[a]]
tails' [] = []
tails' (x:xs) = xs : tails' xs

isInfixOf' :: Eq a => [a] -> [a] -> Bool
isInfixOf' xs ys = any' (isPrefixOf xs) (tails' ys)

football xs
    | isInfixOf' "0000000" xs || isInfixOf' "1111111" xs = "YES"
    | otherwise                                       = "NO"

main = interact$football

main = interact $ f2 . f1 0 0 . head . lines
f1 a b [] = (a,b)
f1 a b (c:d) = if c == '0' then f1 (a+1) b d else f1 a (b+1) d
f2 (a,b) = if abs (a-b) >= 7 then "YES" else "NO"

dangerousImpl 7 _ _ = "YES"
dangerousImpl x _ [] = "NO"
dangerousImpl x p (l:ls)
  | p==l = dangerousImpl (x+1) l ls
  | otherwise = dangerousImpl 1 l ls

dangerous [] = "NO"
dangerous (l:ls) = dangerousImpl 1 l ls

main = do
    l <- getLine
    print (dangerous l)

import Data.List

main = do
  input <- getLine
  if (danger input) then (print "YES") else print "NO"

danger x
  |isInfixOf x "0000000" = True
  |isInfixOf x "1111111" = True
  |otherwise = False

import Data.List

main = do
  input <- getLine
  putStrLn $ id $ danger input

danger ::[Char] -> String
danger x
  |isInfixOf x "0000000" = "YES"
  |isInfixOf x "1111111" = "YES"
  |otherwise = "NO"

module Main where
import Data.List

solve :: String -> String
solve x =
    if (length $ filter (>=7) $ map length $ group x) > 0
    then "YES"
    else "NO"

main = do
    line <- getLine
    print $ solve line

import Data.List

main::IO ()
main=do
    a<-getLine
    print $ if isInfixOf "0000000" a || isInfixOf "1111111" a then "YES" else "NO"

-- State Monad Practise --

newtype State s a = State {runState :: s -> (a, s)}
instance Monad (State s) where
    return a = State $ \s -> (a, s)
    --(>>=) :: (State s a) -> (a -> (State s b)) -> State s b
    m >>= f = State $ \s ->
              let (a, s')   = runState m s
                  (a', s'') = runState (f a) s'
              in (a', s'')

get :: State s s
get = State $ \s -> (s, s)

put :: s -> State s ()
put s = State $ \_ -> ((), s)

evalState :: State s a -> s -> a
evalState s a = fst(runState s a)

fib :: State (Integer, Integer, Int) Integer
fib = get >>= \(fstValue, sndValue, n) -> case n == 0 of
                                          True  -> return sndValue
                                          False -> (put (sndValue, fstValue + sndValue, n - 1) >> fib)
football :: [Char] -> State (Char, Int) String
football (x:xs) = get >>= \(lastNum, count) -> case lastNum == x of
                                                    True  -> case count == 6 of
                                                                  True  -> return "YES"
                                                                  False -> put(lastNum, count + 1) >> football xs
                                                    False -> put(x, 1) >> football xs

football x = return "NO"

main = do
    str <- getLine
    print $ evalState (football str) (str!!0, 1)

main = interact (\s -> if dangerous s then "YES" else "NO")
dangerous s | length s < 7 = False
            | otherwise = all (\x -> x == '1' || x == '0') $ take 7 s

import Data.List

main :: IO()
main = do
	t <- getLine
	putStr $ show $ getAnswer t

getAnswer xs = gA xs 0 (head xs)
		where
			gA []     cnt _
				| cnt >= 7	= "YES"
				| otherwise	= "NO"
			gA (x:xs) cnt l
				| cnt >= 7	= "YES"
				| x == l	= gA xs (cnt + 1) x
				| otherwise	= gA xs 1 x

module Main where

longestSeq :: Int -> Int -> Char -> String -> Int
longestSeq res _ _ [] = res
longestSeq res count prev (x:xs)
  | prev == x = longestSeq res (count + 1) x xs
  | otherwise = longestSeq (max res count) 1 x xs

main :: IO ()
main = do
  pos <- getLine
  let lengthSeq = longestSeq 1 1 ' ' pos
      output = if lengthSeq >= 7 then "YES" else "NO"
  putStrLn output

import Data.Char

h :: String -> Int -> Char -> Bool
h [] _ _ = False
h (x:xs) acc unit
    | (acc > 7) = True
    | otherwise =
        if x == unit
        then h xs (acc + 1) unit
        else h xs 1 x

main :: IO()
main = do
    a <- getLine
    if (h (tail a) 1 (a!!0))
    then putStrLn "YES"
    else putStrLn "NO"

import Data.Char

h :: String -> Int -> Char -> Bool
h [] _ _ = False
h (x:xs) acc unit
    | (acc >= 7) = True
    | otherwise =
        if x == unit
        then h xs (acc + 1) unit
        else h xs 1 x

main :: IO()
main = do
    a <- getLine
    if (h (tail a) 1 (a!!0))
    then putStrLn "YES"
    else putStrLn "NO"

import Data.Char

h :: String -> Int -> Char -> Bool
h [] cnt _ =
    if (cnt >= 7)
    then True
    else False
h (x:xs) acc unit
    | (acc > 7) = True
    | otherwise =
        if x == unit
        then h xs (acc + 1) unit
        else h xs 1 x

main :: IO()
main = do
    a <- getLine
    if (h (tail a) 1 (a!!0))
    then putStrLn "YES"
    else putStrLn "NO"

import Data.List

main = interact $ \s -> if isDangerous s then "YES" else "NO"

isDangerous :: String -> Bool
isDangerous = any (>7) . map length . group

import Data.List
main = do
    a <- getLine
    case filter ((>7).length) $ group a of
        [] -> putStrLn "NO"
        otherwise -> putStrLn "YES"

import Data.List
main = do
  n <- getLine
  if ((isInfixOf "1111111" n) || (isInfixOf "0000000" n)) then putStrLn "Yes" else putStrLn "No"

import Data.List

main = getLine >>= putStrLn.answer.any (>7).map length.group

answer :: Bool -> String
answer True  = "YES"
answer False = "NO"

main = interact $ show . length . (\(d:x) -> [a | a <- [1..d], any (\t -> a `mod` t == 0) x]) . reverse . map read . words

import Data.List
main = interact $ (\x -> if x then "YES" else "NO").or.map ((3<).length).group


import Control.Applicative
import Control.Monad
import Control.Arrow
import Data.List
import Data.Maybe
import Data.Char
import Text.Printf

main = do
	k <- readLn
	as <- concat <$> replicateM 4 getLine

	putStrLn $ if any ( \c -> c /= '.' && k * 2 < length ( filter ( == c ) as ) ) as then "NO" else "YES"

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

main = do
    n <- read <$> getLine
    inp <- concat <$> replicateM 4 getLine
    putStrLn $ if all (<= 2*n) (map length $ group $ sort $ filter (`elem` "0123456789")inp)
                then "YES" else "NO"

import Data.Array
import Data.Array.MArray.Safe
import Data.Array.ST.Safe
import Data.Char
import Data.List
import Control.Monad
import Control.Monad.ST.Safe
-- import Debug.Trace

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

main = do
  k <- readLn
  s <- fmap concat (replicateM 4 getLine)

  putStrLn $ if all (<= 2*k) $ elems $ accumArray (+) 0 ('1', '9') $ zip (filter (/= '.') s) (repeat 1)
             then "YES"
             else "NO"

import Control.Applicative ((<$>), (<*>))
import Data.Char (isDigit)
import Data.List (group, sort)

main :: IO ()
main = putStrLn <$> yesno =<< solve <$> readLn <*> getContents

solve :: Int -> String -> Bool
solve k = all (<=2*k) . map length . group . filter isDigit . sort

yesno :: Bool -> String
yesno True = "YES"
yesno _ = "NO"

#!/usr/bin/env runghc
import Data.List
main = getContents >>= mapM_ putStrLn . solve . lines
solve [] = [] ::[String]
solve (k:cs) = (:solve r)$ f (read k) . map length . group . sort . filter (/='.') . concat $ t
  where (t,r) = splitAt 4 cs
f k t
  | null t || k*2>=maximum t = "YES"
  | otherwise = "NO"

-- Codeforces 373A
main = interact $ output . solve . input
input = lines
output = id
solve (x:xs) = if and [(k * 2 >=) . length $ filter (i ==) ys | i <- ['1'..'9']]
    then "YES" else "NO"
    where
        k = read x :: Int
        ys = concat xs

import Data.Tuple
import Data.List
import Data.Char

increlist :: Int -> [Int] -> [Int]
increlist n ls = let (x,k:ys) = splitAt n ls
  in x ++ (k+1) : ys

calHistogram :: String -> [Int] -> [Int]
calHistogram ns ls
  | ns == [] = ls
  | (head ns) == '.' = calHistogram (tail ns) ls
  | otherwise = calHistogram (tail ns) newls
       where newls = increlist (digitToInt (head ns)) ls

cal :: [String] -> String
cal ins =
  let k = read $ head ins
      ns = concat $ tail ins
      zeros = repeat 0
      histogram = calHistogram ns ( take 10 zeros )
      val = maximum histogram
  in if val <= 2*k then "YES" else "NO"

main = interact ( cal . lines)

import Data.List
import Data.Char
import Data.Maybe
import Data.Tuple
import Debug.Trace
import Control.Arrow
import Foreign.Marshal.Array
import qualified Data.ByteString.Char8 as B

debug x = trace (show x) x
(|>) x f = f x; infixl 1 |>
(||>) mx f = mx >>= (return . f); infixl 1 ||>
ref = (!!)

readInt = fst.fromJust.B.readInt
toDigit n = chr (48 + n)

main = do
  ls <- getContents ||> lines
  n  <- head ls |> readIO :: IO Int
  --[n,k] <- head ls |> words |> map read |> return :: IO [Int]
  ls1 <- (ref ls 1) |> return
  ls2 <- (ref ls 2) |> return
  ls3 <- (ref ls 3) |> return
  ls4 <- (ref ls 4) |> return
  ls1 ++ ls2 ++ ls3 ++ ls4 |> f |> (\m -> if m <= 2*n then "YES" else "NO") |> putStrLn

  where
    count x ls = length $ filter (== x) ls

    f ls =
      foldl max 0 (map (\i -> count (toDigit i) ls) [1..9])

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

main = do
    n <- read <$> getLine
    inp <- concat <$> replicateM 4 getLine
    putStrLn $ if all (<= 2*n) (init $ map length $ group $ sort $ inp)
                then "YES" else "NO"


{-# LANGUAGE BangPatterns #-}
{-# OPTIONS_GHC -O2 #-}

import Data.Int

factor :: Int64 -> [Int64]
factor a
  | a <= 1 = []
  | otherwise = twos a
  where twos a = if even a then [2] ++ twos (quot a 2)
                           else oddprimes 3 a
        oddprimes p a | p*p > a      = [a]
                      | rem a p == 0 = [p] ++ oddprimes p (quot a p)
                      | otherwise    = oddprimes (p+2) a

solve :: Int64 -> Int64 -> Int64
solve a b
  | b <= 0 = 0
  | a <= 1 = b
solve a b = solve' 0 (factor a) a b

solve' :: Int64 -> [Int64] -> Int64 -> Int64 -> Int64
solve' !c []  _ b = b+c
solve' !c [p] a b = let (q,r) = quotRem b p in q+r+c
solve' !c ps  a b
  | g > 1        = solve' c (divide g ps) (quot a g) (quot b g)
  | otherwise    = solve' (1+c) ps a (b-1)
    where g = gcd a b

divide :: Int64 -> [Int64] -> [Int64]
divide g ps | g <= 1 = ps
divide g (p:ps) | rem g p == 0 = divide (quot g p) ps
divide g (p:ps) = p : divide g ps

main = do
  (a : b : _ ) <- fmap (map read . words) getContents
  print $ solve a b

{-# LANGUAGE BangPatterns #-}

import Data.Int

factor :: Int64 -> [Int64]
factor a
  | a <= 1 = []
  | otherwise = twos a
  where twos a = if even a then [2] ++ twos (quot a 2)
                           else oddprimes 3 a
        oddprimes p a | p*p > a      = [a]
                      | rem a p == 0 = [p] ++ oddprimes p (quot a p)
                      | otherwise    = oddprimes (p+2) a

solve :: Int64 -> Int64 -> Int64
solve a b
  | b <= 0 = 0
  | a <= 1 = b
solve a b = solve' 0 (factor a) a b

solve' :: Int64 -> [Int64] -> Int64 -> Int64 -> Int64
solve' !c []  _ b = b+c
solve' !c [p] a b = let (q,r) = quotRem b p in q+r+c
solve' !c ps  a b
  | g > 1        = solve' c (divide g ps) (quot a g) (quot b g)
  | otherwise    = solve' (1+c) ps a (b-1)
    where g = gcd a b

divide :: Int64 -> [Int64] -> [Int64]
divide g ps | g <= 1 = ps
divide g (p:ps) | rem g p == 0 = divide (quot g p) ps
divide g (p:ps) = p : divide g ps

main = do
  (a : b : _ ) <- fmap (map read . words) getContents
  print $ solve a b

import Data.List

primeFactors :: Integer -> [Integer]
primeFactors n = primeFactors' 2 n
 where
  primeFactors' _ 1 = []
  primeFactors' oszto x
   | x > 100 && round (sqrt $ fromInteger x) + 10 < oszto = [x]
   | mod x oszto == 0 = oszto : primeFactors' oszto (div x oszto)
   | otherwise = primeFactors' (oszto + 1) x

solution _ 0 = 0
solution factors b =
 case sort $ map (\tenyezo -> (mod b tenyezo, tenyezo)) factors of
  ((0,elso_oszto):tobbi) -> solution (map snd tobbi) (div b elso_oszto)
  [] -> b
  _ -> (b - ln) + solution factors ln where ln = maximum $ map (\szam -> div b szam * szam) factors

main = do
 [a, b] <- fmap (map read . words) getLine
 print $ solution (primeFactors a) b


import Data.List (sort)

process :: Int -> [Int] -> Int
process k as = if n > 12 then -1 else n
    where n = length.takeWhile (<k).scanl (+) 0.reverse.sort $ as

readInt :: String -> Int
readInt = read

main :: IO ()
main = do
    k <- fmap readInt getLine
    as <- fmap (map readInt.words) getLine
    print $ process k as

import Data.List
import Control.Monad
main = replicateM 2 getLine >>= putStrLn.show.check.judge
judge ["0", months] = -1
judge [t, months] = length.takeWhile (< read t).scanl1 (+).reverse.sort.map read.words $ months
check 12 = -1
check i = succ i

import Data.List
main = do
    kS <- getLine
    let k = read kS
    aStr <- getLine
    let
        as :: [Int]
        as = take 12 $ (map read $ words aStr)
    putStrLn.show $ solve k as

solve k (a:as)
    | k == 0 = 0
    | sum (a:as) < k = -1
    | otherwise =
        [n | n <- [1..12], sum (take n (reverse.sort $ (a:as))) >= k]!!0

import Data.List

main :: IO ()
main = do
        k:as <- getReadAll
        print $ solve k as

solve :: Int -> [Int] -> Int
solve 0 _ = 0
solve k xs = if total < k then -1 else months
    where
        months = (+1).length . takeWhile (< k) . scanl1 (+) . sortBy (flip compare) $ xs
        total = sum xs

getReadAll :: (Read a) => IO [a]
getReadAll = fmap (fmap read. words) getContents

import Data.List
main = do l1 <- getLine
          l2 <- getLine
          let k = read l1
              xs = map read.words $ l2
          print $ f k $ xs
f k xs = let ls = reverse.scanr (+) 0.sort $ xs
         in if last ls < k
            then -1
            else length.takeWhile (<k) $ ls

import Data.List

solve :: [Int] -> Int -> Int
solve (d:ays) sz =
    if sz <= 0
    then 0
    else 1 + solve ays (sz - d)
solve [] _ = 0

main = do
  sz <- (getLine >>= return . (read::String->Int))
  days <- (getLine >>= return . map (read::String->Int) . words)
  print $ if (sum days < sz) then (-1) else solve (reverse $ sort days) sz

import Data.List
main = do
	k<-getLine
	r<-getLine
	let m=map read $ words r
	let l = length m
	putStrLn $ show $ solve (read k) (reverse(sort m)) 0 l

solve k m acc l | acc>l = -1
solve k m acc l= if sum (take acc m ) >=k then acc else solve k m (acc+1) l

import Data.List

conv lst oo
  | (null lst) = reverse oo
  | otherwise = conv (tail lst) (((read (head lst))::Int) : oo)

countmonths lst k months
  | (k <= 0) = months
  | (null lst) && (k > 0) = -1
  | otherwise = countmonths (tail lst) (k - (head lst)) (succ months)

main = do
  rr <- getLine
  ww <- getLine

  let k = (read rr)::Int
      aa = reverse (sort (conv (words ww) []))

      months = countmonths aa k 0

  putStrLn (show months)

import Control.Monad
import Data.List
main = do
  k <- (liftM read) getLine
  m <- (liftM $ reverse . sort . (map read) . words) getLine
  putStrLn . show $ if sum m < k then -1 else length . takeWhile (< k) $ scanl (+) 0 m

import Data.List

main = do
  k <- readLn
  a <- fmap (map read . words) getLine

  let
    a' = takeWhile (< k) $ scanl1 (+) $ reverse $ sort a

  print $ if k == 0 then 0 else if sum a < k then -1 else length a' + 1

import Data.List

solve :: [Int] -> Int
solve (k:lst) = if rk > 0 then -1 else answer
    where
        (rk, answer) = foldl (find) (k, 0) $ sortBy (\a b -> compare b a) lst
        find (k, ans) a = (k - a, ans + (if k > 0 then 1 else 0))

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

import List
myget a | a==[] = -1
        | otherwise = length$last a
getAns a = myget$takeWhile ((>=(head a)).sum)$tails$sort$tail a
main=interact$show.getAns.(map read).words

import Data.List
import Data.Tree
import Data.Int
import Data.Maybe
import Data.Char
import Data.Functor
import Control.Monad
import Control.Monad.ST.Safe
import Control.Arrow
import Data.Array
import Data.Array.ST.Safe
import Data.STRef
import qualified Data.Map as Map
import qualified Data.Set as Set
import qualified Data.ByteString.Char8 as C
main=   readsolveprint
readsolveprint::IO()
readsolveprint = solve.concat =<< forM [1..2] (\i-> map (fst.fromJust.C.readInt).C.words<$>C.getLine)
solve (x:xs) = print $ slv1 x $ sortBy (\a b-> b `compare` a) xs
slv1 x xs = let b= map (\a-> if a>=x then 1 else 0) $ scanl (+) 0 xs in fromMaybe (-1) $ elemIndex 1 b

import List

readWords :: IO [String]
readWords = getLine >>= return . words

reads :: Read a => IO [a]
reads = readWords >>= return . (map read)

solve :: Int -> [Int] -> Int
solve k ms = solve' k (reverse (sort ms)) 0
  where
    solve' k ms n
      | k <= 0     =  n
      | null ms    =  -1
      | otherwise  =  solve' (k - head ms) (tail ms) (n + 1)

main :: IO ()
main = do
    k <- readLn
    ms <- Main.reads
    print (solve k ms)

import Control.Applicative
import Data.List (sortBy)
main = do
  k <- read <$> getLine
  xs <- sortBy (flip compare) . map read . words <$> getLine
  if k == 0 then print 0 else do
  let ltk [] = -1
      ltk ((i,x):xs)
        | x >= k    = i
        | otherwise = ltk xs
  print . ltk . zip [1..] . scanl1 (+) $ xs

import List

solve (k:ms)
  | last ts >= k = length $ takeWhile (< k) ts
  | True = -1
  where ts = scanl (+) 0 $ reverse $ sort ms

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

module Main where
import Data.List (sortBy)

readi :: String -> Int
readi = read

parseMonths months = sortBy (\x y -> compare y x) (map readi $ words months)

parseSolve :: String -> String -> Int
parseSolve v months =
    solve (readi v) (parseMonths months) 0

solve v [] acc = if v < 1 then acc else -1
solve v (mh:mt) acc =
    if v < 1
    then acc
    else solve (v-mh) mt (acc+1)

main = do
    v <- getLine
    months <- getLine
    print $ parseSolve v months

import Control.Applicative
import Data.List

process q1 n | last q1 <n = -1
             | q2==[] && n==0 = 0
             | q2==[] = 1
             | otherwise = (length q2) + 1
        where q2 = takeWhile (<n) q1

main = do
  n<- read <$> getLine ::IO Int
  q1<- scanl1 (+) <$> reverse <$> sort <$> map read  <$>   words  <$> getLine ::IO [Int]
  print $ process q1 n

import Data.List (sort)

main :: IO ()
main = getContents >>= print . solve . map (map read . words) . lines

solve :: [[Int]] -> Int
solve [[k], as] = head ([ i | (i, b) <- zip [0..] (scanl (+) 0 (reverse (sort as))), b >= k ] ++ [-1])

import Data.List
main = do
  k <- readLn
  as <- fmap (reverse . sort . map read . words) getLine
  if sum as < k
     then print (-1)
     else print $ length $ takeWhile (<k) $ scanl (+) 0 as

import Data.List
solve :: Int -> [Int] -> Maybe Int
solve k = f k . reverse . sort
f :: Int -> [Int] -> Maybe Int
f k _ | k <= 0 = Just 0
f k [] = Nothing
f k (x:xs) | x >= k = Just 1
           | otherwise = fmap (+1) $ f (k-x) xs
main = do
    k <- readLn
    a <- fmap (map read . words) getLine
    print $ case solve k a of
        Just x -> x
        Nothing -> -1

import Control.Applicative
import Data.List(sort)

main = do k <- read <$> getLine
          xs <- map read <$> words <$> getLine
          print $ solve k xs

solve :: Int -> [Int] -> Int
solve k xs
  | k == 0 = 0
  | sum xs < k = -1
  | otherwise = (13-) $ length $ dropWhile (<k) $ scanl1 (+) $ reverse $ sort xs

import Data.List
import Data.Ord
--import Control.Applicative

sortDesc :: Ord a => [a] -> [a]
sortDesc = sortBy (comparing Down)

minMonths :: Int -> [Int] -> Int
minMonths 0 _ = 0
minMonths k xs
  | sum xs < k = -1
  | m >= k = 1
  | otherwise = 1 + minMonths (k-m) ms
  where (m:ms) = sortDesc xs

main = do
  k <- readLn
  m <- getLine
  let ms = map read (words m) :: [Int]
  print $ minMonths k ms

import Data.List

sums = scanl (+) 0.reverse.sort

result [[k],ms]
	|sum ms < k = -1
	|otherwise = length.takeWhile (<k).sums$ms

main=interact$show.result.map (map read.words).lines

import Data.List
import Control.Monad

main = do
    k <- liftM read getLine
    l <- liftM (map read . words) getLine

    let ans = length $ takeWhile (< k) $ scanl (+) 0 $ reverse $ sort l

    putStrLn $
       if ans == 13 then "-1"
                    else show ans

import Control.Applicative
import Data.List
import Data.Maybe

main=do

	c<- read <$> getLine::IO Int
	s<- reverse. sort. map read. words <$> getLine :: IO [Int]
	let s1 = scanl (+) 0 s
	let s2 =  length $ takeWhile (<c) s1
	print $ if length s1 == s2 then (-1) else s2

import Data.List
main = do
	k<-getLine
	r<-getLine
	let m=map read $ words r
	let l = length m
	putStrLn $ show $ solve (read k) (reverse(sort m)) 1 l

solve k m acc l | acc>l = -1
solve k m acc l= if sum (take acc m ) >=k then acc else solve k m (acc+1) l

import Data.List

conv lst oo
  | (null lst) = reverse oo
  | otherwise = conv (tail lst) (((read (head lst))::Int) : oo)

countmonths lst k months
  | (null lst) || (k <= 0) = months
  | otherwise = countmonths (tail lst) (k - (head lst)) (succ months)

main = do
  rr <- getLine
  ww <- getLine

  let k = (read rr)::Int
      aa = reverse (sort (conv (words ww) []))

      months = countmonths aa k 0

  putStrLn (show months)

import Data.List

solve :: [Int] -> Int
solve (k:lst) = if rk > 0 then -1 else answer
    where
        (rk, answer) = foldl (find) (k, 0) $ sort lst
        find (k, ans) a = (k - a, ans + (if k > 0 then 1 else 0))

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

module Main where
import Data.List (sortBy)

readi :: String -> Int
readi = read

parseMonths months = sortBy (\x y -> compare y x) (map readi $ words months)

parseSolve :: String -> String -> Int
parseSolve v months =
    solve (readi v) (parseMonths months) 0

solve _ [] _ = -1
solve v (mh:mt) acc =
    if v < 1
    then acc
    else solve (v-mh) mt (acc+1)

main = do
    v <- getLine
    months <- getLine
    print $ parseSolve v months

import Control.Applicative
import Data.List

main = do
  n<- read <$> getLine ::IO Int
  q1<- scanl1 (+) <$> reverse <$> sort <$> map read  <$>   words  <$> getLine ::IO [Int]
  let q2=  takeWhile (<=n) q1
  print $ if q2==[] then (if n==0 then 0 else 1) else ((length q2) + (if last q2==n then 0 else 1))

import Control.Applicative
import Data.List

process q1 n | sum q1 <n = -1
             | q2==[] && n==0 = 0
             | q2==[] = 1
             | last q2 == n = length q2
             | otherwise = (length q2) + 1
        where q2 = takeWhile (<=n) q1

main = do
  n<- read <$> getLine ::IO Int
  q1<- scanl1 (+) <$> reverse <$> sort <$> map read  <$>   words  <$> getLine ::IO [Int]
  print $ process q1 n

import Control.Applicative
import Data.List

main = do
  n<- read <$> getLine ::IO Int
  q1<- scanl1 (+) <$> reverse <$> sort <$> map read  <$>   words  <$> getLine ::IO [Int]
  let q2=  takeWhile (<=n) q1
  print $ if q2==[] then 0 else ((length q2) + (if last q2==n then 0 else 1))

import Control.Applicative
import Data.List

main = do
  n<- read <$> getLine ::IO Int
  q1<- scanl1 (+) <$> reverse <$> sort <$> map read  <$>   words  <$> getLine ::IO [Int]
  print $ length $ takeWhile (<=n) q1

import Control.Applicative
import Data.List

process q1 n | last q1 <n = -1
             | q2==[] && n==0 = 0
             | q2==[] = 1
             | last q2 == n = length q2
             | otherwise = (length q2) + 1
        where q2 = takeWhile (<=n) q1

main = do
  n<- read <$> getLine ::IO Int
  q1<- scanl1 (+) <$> reverse <$> sort <$> map read  <$>   words  <$> getLine ::IO [Int]
  print $ process q1 n

import Data.List (sort)

main :: IO ()
main = getContents >>= print . solve . map (map read . words) . lines

solve :: [[Int]] -> Int
solve [[k], as] = head [ i | (i, b) <- zip [1..] (scanl1 (+) (reverse (sort as))), b >= k ]

import Data.List (sort)

main :: IO ()
main = getContents >>= print . solve . map (map read . words) . lines

solve :: [[Int]] -> Int
solve [[k], as] = 1 + length (takeWhile (<k) (scanl1 (+) (reverse (sort as))))

import Control.Applicative
import Data.List
import Data.Maybe

main=do

	c<- read <$> getLine::IO Int
	s<- reverse. sort. map read. words <$> getLine :: IO [Int]
	let s1 = scanl (+) 0 s
	print $ length $ takeWhile (<c) s1

import Data.List
import Control.Monad
main = replicateM 2 getLine >>= putStrLn.show.check.judge
judge [t, months] = length.takeWhile (< read t).scanl1 (+).reverse.sort.map read.words $ months
judge ["0", months] = -1
check 12 = -1
check i = succ i

import Data.List
import Control.Monad
main = replicateM 2 getLine >>= putStrLn.show.check.judge
judge [t, months] = length.takeWhile (< read t).scanl1 (+).reverse.sort.map read.words $ months
--
check 12 = -1
check i = succ i

import Data.List
main = do
	kS <- getLine
	let k = read kS
	aStr <- getLine
	let
		as :: [Int]
		as = take 12 $ (map read $ words aStr)
	putStrLn.show $ solve k as

solve k (a:as)
	| sum (a:as) < k = -1
	| sum (a:as) == k = 12
	| otherwise =
		[n | n <- [1..12], sum (take n (reverse.sort $ (a:as))) >= k]!!0

import Data.List
main = do
	kS <- getLine
	let k = read kS
	aStr <- getLine
	let
		as :: [Int]
		as = take 12 $ (map read $ words aStr)
	putStrLn.show $ solve k as

solve k (a:as)
	| k == 0 = 0
	| sum (a:as) < k = -1
	| sum (a:as) == k = 12
	| otherwise =
		[n | n <- [1..12], sum (take n (reverse.sort $ (a:as))) >= k]!!0

import Data.List

solve :: [Int] -> Int -> Int
solve (d:ays) sz =
    if sz <= 0
    then 0
    else 1 + solve ays (sz - d)
solve [] _ = -1

main = do
  sz <- (getLine >>= return . (read::String->Int))
  days <- (getLine >>= return . map (read::String->Int) . words)
  print $ if (sum days < sz) then (-1) else solve (sort days) sz

import Data.List

solve :: [Int] -> Int -> Int
solve (d:ays) sz =
    if sz <= 0
    then 0
    else 1 + solve ays (sz - d)
solve [] _ = -1

main = do
  sz <- (getLine >>= return . (read::String->Int))
  days <- (getLine >>= return . map (read::String->Int) . words)
  print $ if (sum days < sz) then (-1) else solve (reverse $ sort days) sz


{-# LANGUAGE DataKinds #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE DeriveGeneric #-}
{-# OPTIONS -O2 #-}

import Control.Applicative (liftA2)
import Control.Monad (filterM, guard)
import Control.Monad.State.Strict (State, evalState, get, modify, put)
import Data.Bits ((.&.), (.|.), setBit, shiftL, shiftR, testBit)
import Data.Char (ord)
import Data.Int (Int8)

import Control.Monad.ST (ST, runST)

-- import Data.HashTable.ST.Cuckoo (HashTable)
import Data.IntMap.Strict (IntMap, empty, insert, lookup)

import Control.DeepSeq (NFData, deepseq)
import GHC.Generics (Generic)
import GHC.TypeNats (KnownNat, Nat, natVal)
import Numeric.Natural (Natural)
import Prelude hiding (lookup)

newtype ModuloRing (p :: Nat) =
  ModuloRing Natural
  deriving (Eq, Generic)

instance NFData (ModuloRing p)

char :: KnownNat p => ModuloRing p -> Natural
char = natVal

instance KnownNat p => Show (ModuloRing p) where
  show (ModuloRing a) = show a

instance KnownNat p => Num (ModuloRing p) where
  (+) x@(ModuloRing a) (ModuloRing b) =
    ModuloRing $
    if a + b >= mm
      then a + b - mm
      else a + b
    where
      mm = char x
  (*) x@(ModuloRing a) (ModuloRing b) = ModuloRing $ (a * b) `mod` mm
    where
      mm = char x
  fromInteger a = ret
    where
      mm = toInteger (char ret)
      ret = ModuloRing . fromInteger . (`mod` mm) . (+ mm) . (`mod` mm) $ a
  negate x@(ModuloRing a) =
    ModuloRing $
    if a == 0
      then 0
      else mm - a
    where
      mm = char x
  abs = id
  signum _ = 1

data Task =
  Task !Int !Int !Int !Int !Int !Int
  deriving (Show)

-- [index, xMask, yMask, xCarry, yCarry, exceed]
-- [7, 4, 4, 4, 4, 1]
hash :: Task -> Int
hash (Task index xMask yMask xCarry yCarry exceed) =
  index `shiftL` 17 .|. xMask `shiftL` 13 .|. yMask `shiftL` 9 .|.
  xCarry `shiftL` 5 .|.
  yCarry `shiftL` 1 .|.
  exceed

{-# INLINE hash #-}
type Modulo = ModuloRing 998244353

type Env = (Int, Int, [Int])

type Hash = IntMap Modulo

search :: Env -> Task -> State Hash Modulo
search (x, y, n) task@(Task index xMask yMask xCarry yCarry exceed) =
  case n of
    []
      | exceed == 1 -> return 0
      | xCarry /= 0 || yCarry /= 0 -> return 0
      | xMask .&. yMask > 0 -> return 1
      | otherwise -> return 0
    d:n' -> do
      h <- get
      let hc = hash task
      case lookup hc h of
        Just m -> return m
        Nothing -> do
          v <-
            sum <$>
            sequence
              [ let index' = index + 1
                    (xCarry', xd) = (x * dk + xCarry) `divMod` 10
                    (yCarry', yd) = (y * dk + yCarry) `divMod` 10
                    exceed' =
                      case compare yd d of
                        LT -> 0
                        EQ -> exceed
                        GT -> 1
                    maxk = 9 `div` y
                    add d p mask =
                      let (k, r) = d `divMod` p
                       in if r == 0 && 0 < k && k <= maxk
                            then setBit mask (k - 1)
                            else mask
                    xMask' = add xd x xMask
                    yMask' = add yd y yMask
                 in search
                      (x, y, n')
                      (Task index' xMask' yMask' xCarry' yCarry' exceed')
              | dk <- [0 .. 9]
              ]
          modify (insert hc v)
          return v

solve :: String -> Modulo
solve n =
  (fromInteger (read n) +) . (2 *) . sum $
  [ evalState (search (x, y, n') (Task 0 0 0 0 0 1)) empty
  | y <- [2 .. 9]
  , x <- [1 .. y - 1]
  , gcd x y == 1
  ]
  where
    !n' = fmap (\c -> ord c - 48) . reverse . show . (+ 1) . read $ n

main = getLine >>= print . solve

{-# LANGUAGE DataKinds #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE DeriveGeneric #-}
{-# OPTIONS -O2 #-}

import Control.Applicative (liftA2)
import Control.Monad (filterM, guard)
import Control.Monad.State.Strict (State, evalState, get, modify, put)
import Data.Bits ((.&.), (.|.), setBit, shiftL, shiftR, testBit)
import Data.Char (ord)
import Data.Int (Int8)

import Control.Monad.ST (ST, runST)

-- import Data.HashTable.ST.Cuckoo (HashTable)
import Data.IntMap.Strict (IntMap, empty, insert, lookup)

import Control.DeepSeq (NFData, deepseq)
import GHC.Generics (Generic)
import GHC.TypeNats (KnownNat, Nat, natVal)
import Numeric.Natural (Natural)
import Prelude hiding (lookup)

newtype ModuloRing (p :: Nat) =
  ModuloRing Natural
  deriving (Eq, Generic)

instance NFData (ModuloRing p)

char :: KnownNat p => ModuloRing p -> Natural
char = natVal

instance KnownNat p => Show (ModuloRing p) where
  show (ModuloRing a) = show a

instance KnownNat p => Num (ModuloRing p) where
  (+) x@(ModuloRing a) (ModuloRing b) =
    ModuloRing $
    if a + b >= mm
      then a + b - mm
      else a + b
    where
      mm = char x
  (*) x@(ModuloRing a) (ModuloRing b) = ModuloRing $ (a * b) `mod` mm
    where
      mm = char x
  fromInteger a = ret
    where
      mm = toInteger (char ret)
      ret = ModuloRing . fromInteger . (`mod` mm) . (+ mm) . (`mod` mm) $ a
  negate x@(ModuloRing a) =
    ModuloRing $
    if a == 0
      then 0
      else mm - a
    where
      mm = char x
  abs = id
  signum _ = 1

data Task =
  Task !Int !Int !Int !Int !Int !Int
  deriving (Show)

-- [index, xMask, yMask, xCarry, yCarry, exceed]
-- [7, 4, 4, 4, 4, 1]
hash :: Task -> Int
hash (Task index xMask yMask xCarry yCarry exceed) =
  index `shiftL` 17 .|. xMask `shiftL` 13 .|. yMask `shiftL` 9 .|.
  xCarry `shiftL` 5 .|.
  yCarry `shiftL` 1 .|.
  exceed

{-# INLINE hash #-}
type Modulo = ModuloRing 998244353

type Env = (Int, Int, [Int])

type Hash = IntMap Modulo

search :: Env -> Task -> State Hash Modulo
search (x, y, n) task@(Task index xMask yMask xCarry yCarry exceed) =
  case n of
    []
      | exceed == 1 -> return 0
      | xCarry /= 0 || yCarry /= 0 -> return 0
      | xMask .&. yMask > 0 -> return 1
      | otherwise -> return 0
    d:n' -> do
      h <- get
      let hc = hash task
          maxk = 9 `div` y
      case lookup hc h of
        Just m -> return m
        Nothing -> do
          v <-
            sum <$>
            sequence
              [ let index' = index + 1
                    (xCarry', xd) = (x * dk + xCarry) `quotRem` 10
                    (yCarry', yd) = (y * dk + yCarry) `quotRem` 10
                    exceed' =
                      case compare yd d of
                        LT -> 0
                        EQ -> exceed
                        GT -> 1
                    add d p mask =
                      let (k, r) = d `quotRem` p
                       in if r == 0 && 0 < k && k <= maxk
                            then setBit mask (k - 1)
                            else mask
                    xMask' = add xd x xMask
                    yMask' = add yd y yMask
                 in search
                      (x, y, n')
                      (Task index' xMask' yMask' xCarry' yCarry' exceed')
              | dk <- [0 .. 9]
              ]
          modify (insert hc v)
          return v

solve :: String -> Modulo
solve n =
  (fromInteger (read n) +) . (2 *) . sum $
  [ evalState (search (x, y, n') (Task 0 0 0 0 0 1)) empty
  | y <- [2 .. 9]
  , x <- [1 .. y - 1]
  , gcd x y == 1
  ]
  where
    !n' = fmap (\c -> ord c - 48) . reverse . show . (+ 1) . read $ n

main = getLine >>= print . solve