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;
int N, M, K;
map<int, vector<pair<int, int> > > R, C;
int get_used(vector<pair<int, int> > from) {
  vector<pair<int, int> > dat;
  for (int i = 0; i < ((int)(from).size()); ++i) {
    dat.push_back(make_pair(from[i].first, -1));
    dat.push_back(make_pair(from[i].second, +1));
  }
  int le = 0, ri = 0, bal = 0, ret = 0;
  sort(dat.begin(), dat.end());
  for (int i = 0; i < ((int)(dat).size()); ++i) {
    if (dat[i].second == -1) {
      ++bal;
      if (bal == 1) {
        le = dat[i].first;
      }
      ri = dat[i].first;
    } else {
      ri = dat[i].first;
      --bal;
      if (bal == 0) {
        ret += ri - le + 1;
      }
    }
  }
  return ret;
}
int main() {
  scanf("%d%d%d", &N, &M, &K);
  for (int i = 0; i < K; ++i) {
    int xf, yf, xt, yt;
    scanf("%d%d%d%d", &xf, &yf, &xt, &yt);
    if (xf > xt) swap(xf, xt);
    if (yf > yt) swap(yf, yt);
    if (xf == xt) {
      R[xf].push_back(make_pair(yf, yt - 1));
    } else {
      C[yf].push_back(make_pair(xf, xt - 1));
    }
  }
  vector<int> avb, avbt, avbp;
  int LR = N - 1 - ((int)(R).size()), LC = M - 1 - ((int)(C).size());
  if (LR & 1) {
    for (int i = 1;; ++i) {
      if (!R.count(i)) {
        R[i] = vector<pair<int, int> >();
        break;
      }
    }
  }
  if (LC & 1) {
    for (int i = 1;; ++i) {
      if (!C.count(i)) {
        C[i] = vector<pair<int, int> >();
        break;
      }
    }
  }
  for (map<int, vector<pair<int, int> > >::iterator it = R.begin();
       it != R.end(); ++it) {
    avb.push_back(M - get_used(it->second));
    avbt.push_back('R');
    avbp.push_back(it->first);
  }
  for (map<int, vector<pair<int, int> > >::iterator it = C.begin();
       it != C.end(); ++it) {
    avb.push_back(N - get_used(it->second));
    avbt.push_back('C');
    avbp.push_back(it->first);
  }
  int XOR = 0;
  for (int i = 0; i < ((int)(avb).size()); ++i) {
    XOR ^= avb[i];
  }
  if (XOR == 0)
    puts("SECOND");
  else {
    puts("FIRST");
    int BIG = 0;
    for (BIG = 30;; --BIG)
      if (XOR & (1 << BIG)) break;
    int pos = 0;
    for (int i = 0; i < ((int)(avb).size()); ++i)
      if (avb[i] & (1 << BIG)) {
        pos = i;
        break;
      }
    XOR ^= avb[pos];
    int TO = XOR;
    if (avbt[pos] == 'R') {
      int lo = 0, hi = M - 1, mid;
      vector<pair<int, int> > U = R[avbp[pos]];
      for (;;) {
        if (lo + 1 >= hi) {
          U.push_back(make_pair(0, lo));
          if (TO == M - get_used(U))
            mid = lo;
          else
            mid = hi;
          break;
        }
        mid = (lo + hi) >> 1;
        U.push_back(make_pair(0, mid));
        if (TO >= M - get_used(U))
          hi = mid;
        else
          lo = mid;
        U.pop_back();
      }
      cout << avbp[pos] << ' ' << 0 << ' ' << avbp[pos] << ' ' << mid + 1
           << '\n';
    } else {
      int lo = 0, hi = N - 1, mid;
      vector<pair<int, int> > U = C[avbp[pos]];
      for (;;) {
        if (lo + 1 >= hi) {
          U.push_back(make_pair(0, lo));
          if (TO == N - get_used(U))
            mid = lo;
          else
            mid = hi;
          break;
        }
        mid = (lo + hi) >> 1;
        U.push_back(make_pair(0, mid));
        if (TO >= N - get_used(U))
          hi = mid;
        else
          lo = mid;
        U.pop_back();
      }
      cout << 0 << ' ' << avbp[pos] << ' ' << mid + 1 << ' ' << avbp[pos]
           << '\n';
    }
  }
  return 0;
}