import Control.Monad
import Data.List
import Data.Bits

solve :: [Int] -> String
solve as = if play 0 as then "first" else "second" where
    play t apples 
        | sum apples > 0 = if mod t 2 == 0
                        then play (t+1) (updates ((packCol.sort.packRow) apples))
                        else play (t+1) (updates ((packCol.sort) apples))
--                        else play (t+1) (updates  apples)
        | otherwise = odd t
    updates :: [Int] -> [Int]
    updates apples = if any odd apples
                        then map (\x -> clearBit x 0) apples
                        else eatEvenOne apples
    eatEvenOne :: [Int] -> [Int]
    eatEvenOne = iter [] where
        iter ac [] = ac
        iter ac (a:as) 
            | a > 0 && even a = ac++(a-1):as
            | otherwise = iter (a:ac) as
    packRow xs
        | m > 0 = map (\x -> if odd m then x - clearBit m 0 else x -m +2) xs
        | otherwise = xs where
            m = minimum xs
    packCol = iter 0 where
        iter _ [] = []
        iter p (x:xs)
            | x == p = iter p xs
            | otherwise = x : iter x xs
    
readLine = fmap (map read . words) getLine
readLines = flip replicateM readLine
    
main :: IO() 
main = do
    [n] <- readLine
    l <- readLines n
    let ans = solve (concat l)
    putStrLn ans
