module Main where

import System.Environment

arg_num_print :: Int -> String -> IO ()
arg_num_print a b = do
  putStr (show a)
  if a == 1
    then putStrLn (": " ++ b ++ " (first)")
    else putStrLn (": " ++ b)

do_list :: Int -> [String] -> IO ()
do_list a [b] = do
  putStr (show a)
  putStrLn (": " ++ b ++ " (last)")

do_list a (x:xs) = do
  arg_num_print a x
  do_list (a+1) xs

do_list a [] = do
  return ()

print_numbered_list a = do
  do_list 1 a

main :: IO ()
main = do
  args <- getArgs
  print_numbered_list args