Problem: Two players play the following game. Initially, the players have a knife and a rectangular sheet of paper, divided into equal square grid cells of unit size. The players make moves in turn, the player who can't make a move loses. In one move, a player can take the knife and cut the paper along any segment of the grid line (not necessarily from border to border). The part of the paper, that touches the knife at least once, is considered cut. There is one limit not to turn the game into an infinite cycle: each move has to cut the paper, that is the knife has to touch the part of the paper that is not cut before.

Obviously, the game ends when the entire sheet is cut into 1 × 1 blocks. During the game, the pieces of the sheet are not allowed to move. It is also prohibited to cut along the border. The coordinates of the ends of each cut must be integers.

You are given an n × m piece of paper, somebody has already made k cuts there. Your task is to determine who will win if the players start to play on this sheet. You can consider that both players play optimally well. If the first player wins, you also need to find the winning first move.

Input

The first line contains three integers n, m, k (1 ≤ n, m ≤ 109, 0 ≤ k ≤ 105) — the sizes of the piece of paper and the number of cuts. Then follow k lines, each containing 4 integers xbi, ybi, xei, yei (0 ≤ xbi, xei ≤ n, 0 ≤ ybi, yei ≤ m) — the coordinates of the ends of the existing cuts. 

It is guaranteed that each cut has a non-zero length, is either vertical or horizontal and doesn't go along the sheet border.

The cuts may intersect, overlap and even be the same. That is, it is not guaranteed that the cuts were obtained during any correct game.

Output

If the second player wins, print "SECOND". Otherwise, in the first line print "FIRST", and in the second line print any winning move of the first player (the coordinates of the cut ends, follow input format to print them).

Examples

Input

2 1 0


Output

FIRST
1 0 1 1


Input

2 2 4
0 1 2 1
0 1 2 1
1 2 1 0
1 1 1 2


Output

SECOND

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
struct node {
  long long l, r, pos;
};
vector<node> A, B;
long long need, summ, delta, sul, N, M, K, i, j, xx1, xx2, yy1, yy2;
long long lastt, ans, ll, rr, start, last, lena, lenb, t;
vector<pair<long long, long long> > d[1000000], db[1000000], D[1000000],
    DB[1000000];
map<long long, long long> MA, MB;
long long SUMM[1000000], SUMMB[1000000], X[1000000], Y[1000000], SUMA[1000000],
    SUMB[1000000];
bool cmp(pair<long long, long long> X, pair<long long, long long> Y) {
  return (X.first < Y.first);
}
long long ans1;
int main() {
  scanf("%I64d %I64d %I64d", &N, &M, &K);
  for (i = 1; i <= K; i++) {
    scanf("%I64d %I64d %I64d %I64d", &xx1, &yy1, &xx2, &yy2);
    if (xx1 == xx2)
      A.push_back((node){yy1, yy2, xx1});
    else
      B.push_back((node){xx1, xx2, yy1});
  }
  for (i = 0; i < A.size(); i++) {
    if (A[i].l > A[i].r) swap(A[i].l, A[i].r);
    if (!MA[A[i].pos]) {
      lena++;
      X[lena] = A[i].pos;
      MA[A[i].pos] = lena;
      d[lena].push_back(make_pair(A[i].l, A[i].r));
    } else {
      d[MA[A[i].pos]].push_back(make_pair(A[i].l, A[i].r));
    }
  }
  for (i = 1; i <= lena; i++) {
    sort(d[i].begin(), d[i].end(), cmp);
    start = 0;
    last = 0;
    lastt = 0;
    for (j = 0; j < d[i].size(); j++) {
      ll = d[i][j].first;
      rr = d[i][j].second;
      if (ll > last) {
        D[i].push_back(make_pair(last, ll));
        SUMA[i] += ll - last;
        start = ll;
        last = rr;
      } else {
        last = max(last, rr);
      }
    }
    if (M > last) {
      D[i].push_back(make_pair(last, M));
      SUMA[i] += M - last;
    }
  }
  t = (N - 1 - lena + 4) % 2;
  if (t) ans ^= M;
  for (i = 0; i < B.size(); i++) {
    if (B[i].l > B[i].r) swap(B[i].l, B[i].r);
    if (!MB[B[i].pos]) {
      lenb++;
      Y[lenb] = B[i].pos;
      MB[B[i].pos] = lenb;
      db[lenb].push_back(make_pair(B[i].l, B[i].r));
    } else {
      db[MB[B[i].pos]].push_back(make_pair(B[i].l, B[i].r));
    }
  }
  for (i = 1; i <= lenb; i++) {
    sort(db[i].begin(), db[i].end(), cmp);
    start = 0;
    last = 0;
    lastt = 0;
    for (j = 0; j < db[i].size(); j++) {
      ll = db[i][j].first;
      rr = db[i][j].second;
      if (ll > last) {
        DB[i].push_back(make_pair(last, ll));
        SUMB[i] += ll - last;
        start = ll;
        last = rr;
      } else {
        last = max(last, rr);
      }
    }
    if (N > last) {
      DB[i].push_back(make_pair(last, N));
      SUMB[i] += N - last;
    }
  }
  t = (M - 1 - lenb + 4) % 2;
  if (t) ans ^= N;
  for (i = 1; i <= lena; i++) {
    summ = 0;
    for (j = 0; j < D[i].size(); j++) summ += D[i][j].second - D[i][j].first;
    ans ^= summ;
    SUMM[i] = summ;
  }
  for (i = 1; i <= lenb; i++) {
    summ = 0;
    for (j = 0; j < DB[i].size(); j++) summ += DB[i][j].second - DB[i][j].first;
    ans ^= summ;
    SUMMB[i] = summ;
  }
  if (ans == 0) {
    cout << "SECOND" << endl;
    return 0;
  }
  cout << "FIRST" << endl;
  for (i = 1; i <= lena; i++)
    if ((SUMM[i] ^ ans) <= SUMM[i]) {
      sul = 0;
      need = SUMM[i] - (SUMM[i] ^ ans);
      for (j = 0; j < D[i].size(); j++) {
        sul += D[i][j].second - D[i][j].first;
        if (sul >= need)
          if ((D[i][j].second - (sul - need)) > 0 &&
              D[i][j].second - (sul - need) <= M) {
            cout << X[i] << " " << 0 << " " << X[i] << " "
                 << D[i][j].second - (sul - need) << endl;
            return 0;
          } else
            break;
      }
    }
  for (i = 1; i <= lenb; i++)
    if ((SUMMB[i] ^ ans) <= SUMMB[i]) {
      sul = 0;
      need = SUMMB[i] - (SUMMB[i] ^ ans);
      for (j = 0; j < DB[i].size(); j++) {
        sul += DB[i][j].second - DB[i][j].first;
        if (sul >= need)
          if ((DB[i][j].second - (sul - need)) > 0 &&
              DB[i][j].second - (sul - need) <= N) {
            cout << 0 << " " << Y[i] << " " << DB[i][j].second - (sul - need)
                 << " " << Y[i] << endl;
            return 0;
          } else
            break;
      }
    }
  for (i = 1; i <= lenb; i++)
    if (!MB[Y[i] - 1] && Y[i] - 1 >= 1 && ((M - 1 - lenb + 4) % 2))
      if ((ans ^ N) < N) {
        cout << 0 << " " << Y[i] - 1 << " " << N - (ans ^ N) << " " << Y[i] - 1
             << endl;
        return 0;
      }
  for (i = 1; i <= lenb; i++)
    if (!MB[Y[i] + 1] && Y[i] + 1 < N && ((M - 1 - lenb + 4) % 2))
      if ((ans ^ N) < N) {
        cout << 0 << " " << Y[i] + 1 << " " << N - (ans ^ N) << " " << Y[i] + 1
             << endl;
        return 0;
      }
  for (i = 1; i <= lena; i++)
    if (!MA[X[i] - 1] && X[i] - 1 >= 1 && ((N - 1 - lena + 4) % 2))
      if ((ans ^ M) < M) {
        cout << X[i] - 1 << " " << 0 << " " << X[i] - 1 << " " << M - (M ^ ans)
             << endl;
        return 0;
      }
  for (i = 1; i <= lena; i++)
    if (!MA[X[i] + 1] && X[i] + 1 < M && ((N - 1 - lena + 4) % 2))
      if ((ans ^ M) < M) {
        cout << X[i] + 1 << " " << 0 << " " << X[i] + 1 << " " << M - (M ^ ans)
             << endl;
        return 0;
      }
  if (lena == 0 && (M - (M ^ ans)) > 0) {
    cout << 1 << " " << 0 << " " << 1 << " " << M - (M ^ ans) << endl;
    return 0;
  }
  if (lenb == 0 && ((N - (N ^ ans)) > 0)) {
    cout << 0 << " " << 1 << " " << N - (N ^ ans) << " " << 1 << endl;
    return 0;
  }
}