{-# LANGUAGE ViewPatterns #-}
import Control.Arrow
import Control.Monad
import Data.List
import qualified Data.ByteString.Char8 as B
import Data.Maybe 

main :: IO ()
main = readLn >>= flip replicateM readLn  >>= putStrLn . result . solve
    where
        result b
            | b = "first"
            | otherwise = "second"

solve :: [Int] -> Bool
solve = count True 0 0 . sortBy (flip compare)
    where
        count b to te xs@(x : y : _)
            | to + te >= y = check b to x
            | odd x = count (not b) (to + 1) te xs
            | otherwise = count next to (te + y) xs
            where
                next
                    | odd y = not b
                    | otherwise = b
        count _ _ _ (x : _) = odd x

        check b to x = judge b $ x - to

        judge b
            | b = odd
            | otherwise = even 

readLine :: IO [Int]
readLine = unfoldr (\s -> second (maybe B.empty snd . B.uncons) <$> B.readInt s) <$> B.getLine

readContents :: Int -> IO [[Int]]
readContents = flip replicateM readLine
