#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  long long sum1 = 0, sum2 = 0;
  vector<long long> one, two;
  int last = 0;
  for (int i = 0; i < n; i++) {
    int temp;
    scanf("%d", &temp);
    if (temp < 0) {
      two.push_back(abs(temp));
      sum2 += abs(temp);
      last = 2;
    } else {
      one.push_back(temp);
      sum1 += temp;
      last = 1;
    }
  }
  if (sum1 != sum2) {
    if (sum1 > sum2)
      puts("first");
    else
      puts("second");
    return 0;
  }
  for (int i = 0; i < min(one.size(), two.size()); i++) {
    if (one[i] != two[i]) {
      if (one[i] < two[i])
        puts("second");
      else if (one[i] > two[i])
        puts("first");
      return 0;
    }
  }
  if (one.size() != two.size()) {
    if (one.size() > two.size())
      puts("first");
    else
      puts("second");
    return 0;
  }
  if (last == 1)
    puts("first");
  else
    puts("second");
}
