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;
const int maxn = 111111;
const int N = 111111;
const double eps = 1e-10;
const double pi = acos(-1.0);
map<pair<long long, long long>, int> h, v;
set<long long> X, Y;
set<long long>::iterator it;
map<long long, int> hx, hy;
vector<pair<long long, long long> > H[maxn], V[maxn];
long long n, m, k;
long long a[maxn], b[maxn], c[maxn], d[maxn];
long long rx[maxn], ry[maxn];
int main() {
  cin >> n >> m >> k;
  int i, j;
  for (i = 0; i < k; ++i) {
    cin >> a[i] >> b[i] >> c[i] >> d[i];
    if (a[i] == c[i] && (a[i] > 0 && a[i] < n)) X.insert(a[i]);
    if (b[i] == d[i] && (b[i] > 0 && b[i] < m)) Y.insert(b[i]);
  }
  int nx, ny, cnt = 0;
  for (cnt = 0, it = X.begin(); it != X.end(); ++it) hx[*it] = cnt++;
  nx = cnt;
  long long cx, cy;
  cx = n - 1 - cnt;
  if (cx & 1)
    cx = m;
  else
    cx = 0;
  for (cnt = 0, it = Y.begin(); it != Y.end(); ++it) hy[*it] = cnt++;
  ny = cnt;
  cy = m - 1 - cnt;
  if (cy & 1)
    cy = n;
  else
    cy = 0;
  int t;
  int size;
  for (i = 0; i < k; ++i) {
    if (a[i] == c[i] && (a[i] > 0 && a[i] < n)) {
      if (b[i] > d[i]) swap(b[i], d[i]);
      t = hx[a[i]];
      H[t].push_back(pair<long long, long long>(b[i], d[i]));
    }
    if (b[i] == d[i] && (b[i] > 0 && b[i] < m)) {
      if (a[i] > c[i]) swap(a[i], c[i]);
      t = hy[b[i]];
      V[t].push_back(pair<long long, long long>(a[i], c[i]));
    }
  }
  long long cut = 0, tmp;
  long long last, first;
  long long res = cx ^ cy;
  for (i = 0; i < nx; ++i) {
    sort(H[i].begin(), H[i].end());
    size = H[i].size();
    first = H[i][0].first;
    last = H[i][0].second;
    tmp = 0;
    for (j = 1; j < size; ++j) {
      if (H[i][j].first <= last) {
        last = max(last, H[i][j].second);
      } else {
        tmp += last - first;
        first = H[i][j].first;
        last = H[i][j].second;
      }
    }
    tmp += last - first;
    cut += tmp;
    rx[i] = m - tmp;
    res ^= (m - tmp);
  }
  for (i = 0; i < ny; ++i) {
    sort(V[i].begin(), V[i].end());
    size = V[i].size();
    first = V[i][0].first;
    last = V[i][0].second;
    tmp = 0;
    for (j = 1; j < size; ++j) {
      if (V[i][j].first <= last) {
        last = max(last, V[i][j].second);
      } else {
        tmp += last - first;
        first = V[i][j].first;
        last = V[i][j].second;
      }
    }
    tmp += last - first;
    ry[i] = n - tmp;
    res ^= (n - tmp);
  }
  if (!res)
    cout << "SECOND" << endl;
  else {
    cout << "FIRST" << endl;
    long long pv, take;
    pv = m - (m ^ res);
    if (pv > 0) {
      take = pv;
      for (i = 1; i < n; ++i) {
        if (!X.count(i)) {
          cout << i << ' ' << 0 << ' ' << i << ' ' << take << endl;
          return 0;
        }
      }
    }
    pv = n - (n ^ res);
    if (pv > 0) {
      take = pv;
      for (i = 1; i < m; ++i) {
        if (!Y.count(i)) {
          cout << 0 << ' ' << i << ' ' << take << ' ' << i << endl;
          return 0;
        }
      }
    }
    for (i = 0, it = X.begin(); i < nx && it != X.end(); ++i, ++it) {
      pv = rx[i] - (rx[i] ^ res);
      if (pv > 0 && pv <= rx[i]) {
        take = pv;
        size = H[i].size();
        tmp = 0;
        first = H[i][0].first;
        if (first >= take) {
          cout << *it << ' ' << 0 << ' ' << *it << ' ' << take << endl;
          return 0;
        }
        last = H[i][0].second;
        for (j = 1; j < size; ++j) {
          if (H[i][j].first <= last) {
            last = max(last, H[i][j].second);
          } else {
            tmp += last - first;
            pv = last;
            first = H[i][j].first;
            last = H[i][j].second;
            if (first - tmp >= take) {
              cout << *it << ' ' << 0 << ' ' << *it << ' ' << (take + tmp)
                   << endl;
              return 0;
            }
          }
        }
        tmp += last - first;
        cout << *it << ' ' << 0 << ' ' << *it << ' ' << (take + tmp) << endl;
        return 0;
      }
    }
    for (i = 0, it = Y.begin(); i < ny && it != Y.end(); ++i, ++it) {
      pv = ry[i] - (ry[i] ^ res);
      if (pv > 0 && pv <= ry[i]) {
        take = pv;
        size = V[i].size();
        tmp = 0;
        first = V[i][0].first;
        last = V[i][0].second;
        for (j = 1; j < size; ++j) {
          if (V[i][j].first <= last) {
            last = max(last, V[i][j].second);
          } else {
            tmp += last - first;
            first = V[i][j].first;
            last = V[i][j].second;
            if (first - tmp >= take) {
              cout << 0 << ' ' << *it << ' ' << (take + tmp) << ' ' << *it
                   << endl;
              return 0;
            }
          }
        }
        tmp += last - first;
        cout << 0 << ' ' << *it << ' ' << take + tmp << ' ' << *it << endl;
        return 0;
      }
    }
  }
  return 0;
}