#include <bits/stdc++.h>
using namespace std;
struct debugger {
  template <typename T>
  debugger& operator,(const T& v) {
    cerr << v << " ";
    return *this;
  }
} dbg;
int main() {
  int n, v, last, win = 0;
  vector<int> first, second;
  long long a = 0, b = 0;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> v;
    if (v > 0) {
      first.push_back(v);
      a += v;
    } else {
      second.push_back(-v);
      b += -v;
    }
    if (i == n - 1) {
      last = v;
    }
  }
  if (a != b) {
    win = a > b ? 1 : 2;
  } else {
    int i, sz = min(first.size(), second.size());
    for (i = 0; i < sz; ++i) {
      if (first[i] != second[i]) break;
    }
    if (i < sz) {
      win = first[i] > second[i] ? 1 : 2;
    } else if (first.size() == second.size()) {
      win = last > 0 ? 1 : 2;
    } else {
      win = first.size() > second.size() ? 1 : 2;
    }
  }
  puts(win == 1 ? "first" : "second");
}
