#!/usr/bin/env python3 # WA because b is an iterator that is exhausted after the first loop. n = int(input()) a = map(int, input().split()) b = map(int, input().split()) ca = 0 cb = 0 for x in a: for y in b: if x > y: ca += 1 elif x < y: cb += 1 if ca > cb: print("first") elif ca < cb: print("second") else: print("tie")