-- Exercise 3 from page 84
module Main
       where

import IO
import System

main = do
  args <- getArgs
  text <- readFile (head args)
  putStrLn $ unlines $ map (\x -> let w = words x
                              in
                                if null w then [] else head w
                        ) $ lines text