import Control.Monad

solve :: [Int] -> String
solve as = if play 0 (packRow as) then "first" else "second" where
    play t apples 
        | sum apples > 0 = play (t+1) (updates apples)
        | otherwise      = odd t
    updates :: [Int] -> [Int]
    updates apples = if all even apples
                        then eatEvenOne apples
                        else packCol $ map (\x -> if odd x then x-1 else x) 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 = map (\x -> x-d) xs where
        m = minimum xs
        d = if even m then m else m-1
    packCol [] = []
    packCol (x:xs) 
        | x == 0 = packCol xs
        | otherwise = x : packCol 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
