#include <bits/stdc++.h>
using namespace std;
void err(istream_iterator<string> it) {}
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
  cerr << *it << " = " << a << endl;
  err(++it, args...);
}
const long long N = ((long long)1e8) + 4;
long long gcd(long long a, long long b) {
  if (b > a) {
    return gcd(b, a);
  }
  if (b == 0) {
    return a;
  }
  return gcd(b, a % b);
}
void swap(long long &x, long long &y) {
  long long temp = x;
  x = y;
  y = temp;
}
long long mod_add(long long a, long long b, long long m) {
  a = a % m;
  b = b % m;
  return (((a + b) % m) + m) % m;
}
long long mod_mul(long long a, long long b, long long m) {
  a = a % m;
  b = b % m;
  return (((a * b) % m) + m) % m;
}
long long mod_sub(long long a, long long b, long long m) {
  a = a % m;
  b = b % m;
  return (((a - b) % m) + m) % m;
}
void solve() {
  long long n;
  cin >> n;
  long long last = -1;
  long long s1 = 0, s2 = 0;
  vector<long long> one, sec;
  vector<long long> v(n, 0);
  for (long long i = 0; i < n; i++) {
    cin >> v[i];
    if (v[i] < 0) {
      s2 += (-v[i]);
      sec.emplace_back(-v[i]);
    } else {
      s1 += v[i];
      one.emplace_back(v[i]);
    }
    if (i == n - 1) {
      if (v[i] > 0)
        last = 1;
      else {
        last = 2;
      }
    }
  }
  if (s1 != s2) {
    if (s1 > s2) {
      cout << "first" << '\n';
    } else {
      cout << "second" << '\n';
    }
    return;
  } else {
    long long i = 0, j = 0;
    s1 = one.size();
    s2 = sec.size();
    while (i < s1 and j < s2) {
      if (one[i] == sec[j]) {
        i++;
        j++;
      } else {
        if (one[i] > sec[j]) {
          cout << "first" << '\n';
        } else {
          cout << "second" << '\n';
        }
        return;
      }
    }
    if (s1 != s2) {
      if (s1 > s2) {
        cout << "first" << '\n';
      } else {
        cout << "second" << '\n';
      }
      return;
    } else {
      if (last == 1) {
        cout << "first" << '\n';
      } else
        cout << "second" << '\n';
    }
  }
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t;
  t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
