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;
int cx, cy;
int res = 0;
map<int, int> mpx, mpy;
int revx[100010], revy[100010];
vector<pair<int, int> > x[100010], y[100010];
vector<pair<int, int> > poss;
int main() {
  cin >> n >> m >> k;
  int a, b, c, d;
  for (int i = 0; i < k; i++) {
    cin >> a >> b >> c >> d;
    if (a == c) {
      if (mpx.find(a) == mpx.end()) {
        revx[cx] = a;
        mpx[a] = cx++;
      }
      x[mpx[a]].push_back(pair<int, int>(max(b, d), -1));
      x[mpx[a]].push_back(pair<int, int>(min(b, d), 1));
    } else {
      if (mpy.find(b) == mpy.end()) {
        revy[cy] = b;
        mpy[b] = cy++;
      }
      y[mpy[b]].push_back(pair<int, int>(max(a, c), -1));
      y[mpy[b]].push_back(pair<int, int>(min(a, c), 1));
    }
  }
  if ((n - cx - 1) % 2) {
    int t = 1;
    while (mpx.find(t) != mpx.end()) t++;
    revx[cx] = t;
    mpx[t] = cx++;
  }
  int res = 0;
  if ((m - cy - 1) % 2) {
    int t = 1;
    while (mpy.find(t) != mpy.end()) t++;
    revy[cy] = t;
    mpy[t] = cy++;
  }
  for (int i = 0; i < cx; i++) {
    sort(x[i].begin(), x[i].end());
    int rem = m, cnt = 0;
    for (int j = 0; j < x[i].size(); j++) {
      if (cnt > 0) rem -= x[i][j].first - x[i][j - 1].first;
      cnt += x[i][j].second;
    }
    poss.push_back(pair<int, int>(rem, i));
    res ^= rem;
  }
  for (int i = 0; i < cy; i++) {
    sort(y[i].begin(), y[i].end());
    int rem = n, cnt = 0;
    for (int j = 0; j < y[i].size(); j++) {
      if (cnt > 0) rem -= y[i][j].first - y[i][j - 1].first;
      cnt += y[i][j].second;
    }
    poss.push_back(pair<int, int>(rem, -i - 1));
    res ^= rem;
  }
  if (res) {
    cout << "FIRST" << endl;
    int gd;
    for (int i = 0; i < poss.size(); i++)
      if ((poss[i].first ^ res) < poss[i].first) gd = i;
    int idx = poss[gd].second;
    vector<pair<int, int> > v;
    if (idx >= 0)
      v = x[idx];
    else
      v = y[-idx - 1];
    v.push_back(pair<int, int>(max(n, m), 2));
    sort(v.begin(), v.end());
    int sum = v[0].first, cnt = 1;
    int p = 1, nd = poss[gd].first - (poss[gd].first ^ res);
    for (; sum < nd && p < v.size(); p++) {
      if (cnt == 0) sum += v[p].first - v[p - 1].first;
      cnt += v[p].second;
    }
    if (idx >= 0)
      cout << revx[idx] << " 0 " << revx[idx] << ' '
           << v[p - 1].first - (sum - nd) << endl;
    else
      cout << "0 " << revy[-idx - 1] << ' ' << v[p - 1].first - (sum - nd)
           << ' ' << revy[-idx - 1] << endl;
  } else
    cout << "SECOND" << endl;
  return 0;
}