#include <bits/stdc++.h>
using namespace std;
int n, a[200007];
vector<int> First, Second;
long long Sumf, Sums;
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    if (a[i] > 0) {
      First.push_back(a[i]);
      Sumf += a[i];
    } else {
      Second.push_back(abs(a[i]));
      Sums += abs(a[i]);
    }
  }
  if (Sums > Sumf) return cout << "second", 0;
  if (Sumf > Sums) return cout << "first", 0;
  for (int i = 0; i < min(First.size(), Second.size()); ++i) {
    if (First[i] > Second[i]) return cout << "first", 0;
    if (First[i] < Second[i]) return cout << "second", 0;
  }
  if (First.size() != Second.size())
    return cout << (First.size() > Second.size()) ? "first" : "second", 0;
  if (a[n - 1] > 0) return cout << "first", 0;
  cout << "second";
  return 0;
}
