#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, p1Sum = 0, p2Sum = 0, x;
  bool lastMove = 0;
  vector<long long> p1, p2;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> x;
    if (x > 0) {
      p1.push_back(x);
      p1Sum += x;
    } else {
      p2.push_back(-x);
      p2Sum -= x;
    }
    lastMove = (x > 0);
  }
  if (p1Sum == p2Sum) {
    bool isSame = 1, winner;
    for (int i = 0; i < min(((int)p1.size()), ((int)p2.size())); ++i)
      if (p1[i] != p2[i]) {
        winner = p1[i] > p2[i];
        isSame = 0;
        break;
      }
    isSame &= (((int)p1.size()) == ((int)p2.size()));
    if (isSame)
      cout << (lastMove ? "first" : "second") << endl;
    else
      cout << (winner ? "first" : "second") << endl;
  } else
    cout << (p1Sum > p2Sum ? "first" : "second") << endl;
  return 0;
}
