#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const int alphabet = 26;
const int MAXINT = 1e9;
long long n, a, s1 = 0, s2 = 0;
bool last;
vector<int> w1, w2;
int main() {
  cin >> n;
  ;
  for (int i = 0; i < n; i++) {
    cin >> a;
    if (a > 0)
      s1 += a, w1.push_back(a), last = true;
    else
      s2 += -a, w2.push_back(-a), last = false;
  }
  if (s1 != s2)
    cout << (s2 > s1 ? "second" : "first") << endl;
  else {
    int i = 0, j = 0, win = 0;
    while (i < w1.size() && j < w2.size() && !win) {
      if (w1[i] > w2[j])
        win = 1;
      else if (w1[i] < w2[j])
        win = 2;
      i++, j++;
    }
    if (!win) win = (last ? 1 : 2);
    cout << (win == 1 ? "first" : "second");
  }
  return 0;
}
