#include <bits/stdc++.h>
using namespace std;
int a[200005], b[200005], cn1, cn2;
int main() {
  int i, j, n, m, p, k;
  long long s1, s2;
  s1 = 0;
  s2 = 0;
  int f = 0;
  cin >> n;
  for (i = 0; i < n; i++) {
    scanf("%d", &p);
    if (p > 0) {
      s1 += p;
      a[cn1++] = p;
      if (i == n - 1) f = 0;
    } else {
      s2 -= p;
      b[cn2++] = -p;
      if (i == n - 1) f = 1;
    }
  }
  if (s1 > s2) {
    printf("first\n");
    return 0;
  }
  if (s1 < s2) {
    printf("second\n");
    return 0;
  }
  m = -1;
  for (i = 0; i < min(cn1, cn2); i++) {
    if (a[i] > b[i]) {
      m = 0;
      break;
    }
    if (a[i] < b[i]) {
      m = 1;
      break;
    }
  }
  if (m == 0 || (m == -1 && cn1 > cn2)) {
    printf("first\n");
    return 0;
  }
  if (m == 1 || (m == -1 && cn1 < cn2)) {
    printf("second\n");
    return 0;
  }
  if (f == 0)
    printf("first\n");
  else
    printf("second\n");
}
