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;
vector<pair<int, int> > lc[100010], lr[100010], la;
map<pair<int, int>, bool> mc[100010], mr[100010];
struct seg {
  int x1, x2, y1, y2;
} s[100010];
int c[100010], nc, r[100010], nr;
pair<pair<int, int>, int> v[200010];
int nv;
int getIdC(int x) { return int(lower_bound(c + 1, c + 1 + nc, x) - c); }
int getIdR(int x) { return int(lower_bound(r + 1, r + 1 + nr, x) - r); }
int main() {
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 1; i <= k; i++) {
    scanf("%d%d%d%d", &s[i].x1, &s[i].y1, &s[i].x2, &s[i].y2);
    if (s[i].x1 > s[i].x2) swap(s[i].x1, s[i].x2);
    if (s[i].x1 == s[i].x2) c[++nc] = s[i].x1;
    if (s[i].y1 > s[i].y2) swap(s[i].y1, s[i].y2);
    if (s[i].y1 == s[i].y2) r[++nr] = s[i].y1;
  }
  sort(c + 1, c + 1 + nc);
  sort(r + 1, r + 1 + nr);
  int tmp = 0;
  for (int i = 1; i <= nc; i++)
    if (i == 1 || c[i] != c[i - 1]) c[++tmp] = c[i];
  nc = tmp;
  tmp = 0;
  for (int i = 1; i <= nr; i++)
    if (i == 1 || r[i] != r[i - 1]) r[++tmp] = r[i];
  nr = tmp;
  for (int i = 1; i <= k; i++) {
    if (s[i].x1 == s[i].x2) {
      int j = getIdC(s[i].x1);
      pair<int, int> p = make_pair(s[i].y1, s[i].y2);
      if (!mc[j][p]) {
        mc[j][p] = true;
        lc[j].push_back(p);
      }
    }
    if (s[i].y1 == s[i].y2) {
      int j = getIdR(s[i].y1);
      pair<int, int> p = make_pair(s[i].x1, s[i].x2);
      if (!mr[j][p]) {
        mr[j][p] = true;
        lr[j].push_back(p);
      }
    }
  }
  for (int i = 1; i <= nc; i++) {
    int t = 0;
    int cur = 0;
    sort(lc[i].begin(), lc[i].end());
    lc[i].push_back(make_pair(m, m));
    for (int j = 0; j < lc[i].size(); j++) {
      if (lc[i][j].first - cur >= 0) {
        t += lc[i][j].first - cur;
        cur = lc[i][j].second;
      } else if (lc[i][j].second > cur)
        cur = lc[i][j].second;
    }
    v[++nv] = make_pair(make_pair(t, i), 0);
  }
  for (int i = 1; i <= nr; i++) {
    int t = 0;
    int cur = 0;
    sort(lr[i].begin(), lr[i].end());
    lr[i].push_back(make_pair(n, n));
    for (int j = 0; j < lr[i].size(); j++) {
      if (lr[i][j].first - cur >= 0) {
        t += lr[i][j].first - cur;
        cur = lr[i][j].second;
      } else if (lr[i][j].second > cur)
        cur = lr[i][j].second;
    }
    v[++nv] = make_pair(make_pair(t, i), 1);
  }
  int restc = n - 1 - nc;
  if (restc % 2 != 0) {
    v[++nv] = make_pair(make_pair(m, ++nc), 0);
    tmp = 1;
    for (int i = 1; i < nc; i++)
      if (c[i] == tmp)
        ++tmp;
      else
        break;
    c[nc] = tmp;
    lc[nc].push_back(make_pair(0, 0));
    lc[nc].push_back(make_pair(m, m));
  }
  int restr = m - 1 - nr;
  if (restr % 2 != 0) {
    v[++nv] = make_pair(make_pair(n, ++nr), 1);
    tmp = 1;
    for (int i = 1; i < nr; i++)
      if (r[i] == tmp)
        ++tmp;
      else
        break;
    r[nr] = tmp;
    lr[nr].push_back(make_pair(0, 0));
    lr[nr].push_back(make_pair(n, n));
  }
  int res = 0;
  for (int i = 1; i <= nv; i++) res ^= v[i].first.first;
  if (res == 0)
    cout << "SECOND";
  else {
    cout << "FIRST" << endl;
    sort(v + 1, v + 1 + nv);
    int len, col, ch;
    for (int i = 1; i <= nv; i++) {
      int x = v[i].first.first;
      if ((res ^ x) < x) {
        len = x - (res ^ x);
        if (v[i].second == 0) {
          la = lc[v[i].first.second];
          ch = c[v[i].first.second];
          col = true;
        } else {
          la = lr[v[i].first.second];
          ch = r[v[i].first.second];
          col = false;
        }
        break;
      }
    }
    sort(la.begin(), la.end());
    int cur = 0;
    for (int i = 0; i < la.size(); i++) {
      if (la[i].first - cur >= 0)
        if (la[i].first - cur >= len) {
          cur += len;
          len = 0;
          break;
        } else {
          len -= la[i].first - cur;
          cur = la[i].second;
        }
      else if (la[i].second > cur)
        cur = la[i].second;
    }
    if (col)
      cout << ch << " " << 0 << " " << ch << " " << cur;
    else
      cout << 0 << " " << ch << " " << cur << " " << ch;
  }
}