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 double EPS = 1e-9;
const double PI = acos(-1.0);
const int MAXN = (int)1e6 + 10000;
struct seg {
  int len;
  int x1, x2, qwertyuiopasdfghjklzxcvbnm, y2;
  seg(int x1 = 0, int x2 = 0, int qwertyuiopasdfghjklzxcvbnm = 0, int y2 = 0)
      : x1(x1),
        x2(x2),
        qwertyuiopasdfghjklzxcvbnm(qwertyuiopasdfghjklzxcvbnm),
        y2(y2) {
    len = abs(x1 - x2) + abs(qwertyuiopasdfghjklzxcvbnm - y2);
  };
};
seg segs[MAXN];
vector<int> x;
vector<int> y;
int n, m, k;
vector<pair<int, int> > segv[MAXN];
vector<pair<int, int> > segg[MAXN];
vector<int> lens;
seg vseg, gseg;
void out(int x1, int x2, int qwertyuiopasdfghjklzxcvbnm, int y2) {
  printf("%d %d %d %d\n", x1, qwertyuiopasdfghjklzxcvbnm, x2, y2);
  exit(0);
}
int main() {
  scanf("%d %d %d", &n, &m, &k);
  int K = k;
  k = 0;
  for (int i = 0; i < K; i++) {
    int x1, x2, qwertyuiopasdfghjklzxcvbnm, y2;
    scanf("%d %d %d %d", &x1, &qwertyuiopasdfghjklzxcvbnm, &x2, &y2);
    if (x1 > x2) swap(x1, x2);
    if (qwertyuiopasdfghjklzxcvbnm > y2) swap(qwertyuiopasdfghjklzxcvbnm, y2);
    segs[k++] = seg(x1, x2, qwertyuiopasdfghjklzxcvbnm, y2);
    x.push_back(x1);
    x.push_back(x2);
    y.push_back(qwertyuiopasdfghjklzxcvbnm);
    y.push_back(y2);
  }
  sort(x.begin(), x.end());
  x.resize(unique(x.begin(), x.end()) - x.begin());
  sort(y.begin(), y.end());
  y.resize(unique(y.begin(), y.end()) - y.begin());
  for (int i = 0; i < k; i++)
    if (segs[i].qwertyuiopasdfghjklzxcvbnm == segs[i].y2) {
      int Y = segs[i].qwertyuiopasdfghjklzxcvbnm;
      int pos = lower_bound(y.begin(), y.end(), Y) - y.begin();
      segv[pos].push_back(make_pair(segs[i].x1, 0));
      segv[pos].push_back(make_pair(segs[i].x2, 1));
    } else {
      int X = segs[i].x1;
      int pos = lower_bound(x.begin(), x.end(), X) - x.begin();
      segg[pos].push_back(make_pair(segs[i].qwertyuiopasdfghjklzxcvbnm, 0));
      segg[pos].push_back(make_pair(segs[i].y2, 1));
    }
  for (int i = 0; i < ((int)(y).size()); i++) {
    if (y[i] == 0 || y[i] == m) continue;
    segv[i].push_back(make_pair(0, 0));
    segv[i].push_back(make_pair(0, 1));
    segv[i].push_back(make_pair(n, 0));
    segv[i].push_back(make_pair(n, 1));
    sort(segv[i].begin(), segv[i].end());
    int cnt = 0;
    int len = 0;
    for (int j = 0; j < ((int)(segv[i]).size()) - 1; j++) {
      if (!segv[i][j].second)
        cnt++;
      else
        cnt--;
      if (cnt == 0) len += segv[i][j + 1].first - segv[i][j].first;
    }
    if (len > 0) lens.push_back(len);
  }
  for (int i = 0; i < ((int)(x).size()); i++) {
    if (x[i] == 0 || x[i] == n) continue;
    segg[i].push_back(make_pair(0, 0));
    segg[i].push_back(make_pair(0, 1));
    segg[i].push_back(make_pair(m, 0));
    segg[i].push_back(make_pair(m, 1));
    sort(segg[i].begin(), segg[i].end());
    int cnt = 0;
    int len = 0;
    for (int j = 0; j < ((int)(segg[i]).size()) - 1; j++) {
      if (!segg[i][j].second)
        cnt++;
      else
        cnt--;
      if (cnt == 0) len += segg[i][j + 1].first - segg[i][j].first;
    }
    if (len > 0) lens.push_back(len);
  }
  vseg = seg(-1, -1, -1, -1);
  int cnt = m - 1 - ((int)(y).size());
  if (!y.empty() && y[0] == 0) cnt++;
  if (!y.empty() && *y.rbegin() == m) cnt++;
  for (int i = 1; i < MAXN && cnt % 2 == 1 && cnt > 0; i++) {
    int pos = lower_bound(y.begin(), y.end(), i) - y.begin();
    if (pos == ((int)(y).size()) || y[pos] != i) {
      vseg = seg(0, n, i, i);
      lens.push_back(n);
      break;
    }
  }
  gseg = seg(-1, -1, -1, -1);
  cnt = n - 1 - ((int)(x).size());
  if (!x.empty() && x[0] == 0) cnt++;
  if (!x.empty() && *x.rbegin() == n) cnt++;
  for (int i = 1; i < MAXN && cnt % 2 == 1 && cnt > 0; i++) {
    int pos = lower_bound(x.begin(), x.end(), i) - x.begin();
    if (pos == ((int)(x).size()) || x[pos] != i) {
      gseg = seg(i, i, 0, m);
      lens.push_back(m);
      break;
    }
  }
  int res = 0;
  for (int i = 0; i < ((int)(lens).size()); i++) res ^= lens[i];
  if (res == 0) {
    puts("SECOND");
    return 0;
  } else
    puts("FIRST");
  int bit = 0;
  for (int i = 30; i >= 0; i--)
    if (res & (1 << i)) {
      bit = i;
      break;
    }
  int need = 0;
  int needlen = 0;
  for (int i = 0; i < ((int)(lens).size()); i++)
    if (lens[i] & (1 << bit)) {
      need = lens[i] - (lens[i] ^ res);
      needlen = lens[i];
      break;
    }
  int x1, x2, qwertyuiopasdfghjklzxcvbnm, y2;
  for (int i = 0; i < ((int)(y).size()); i++) {
    if (y[i] == 0 || y[i] == m) continue;
    int cnt = 0;
    int len = 0;
    x1 = 0;
    qwertyuiopasdfghjklzxcvbnm = y2 = y[i];
    for (int j = 0; j < ((int)(segv[i]).size()) - 1; j++) {
      if (!segv[i][j].second)
        cnt++;
      else
        cnt--;
      if (cnt == 0) len += segv[i][j + 1].first - segv[i][j].first;
    }
    if (len != needlen) continue;
    len = cnt = 0;
    for (int j = 0; j < ((int)(segv[i]).size()) - 1; j++) {
      if (!segv[i][j].second)
        cnt++;
      else
        cnt--;
      if (cnt == 0) {
        len += segv[i][j + 1].first - segv[i][j].first;
        if (len >= need) {
          len -= segv[i][j + 1].first - segv[i][j].first;
          x2 = segv[i][j].first + (need - len);
          out(x1, x2, qwertyuiopasdfghjklzxcvbnm, y2);
        }
      }
    }
  }
  for (int i = 0; i < ((int)(x).size()); i++) {
    if (x[i] == 0 || x[i] == n) continue;
    int cnt = 0;
    int len = 0;
    x1 = x2 = x[i];
    qwertyuiopasdfghjklzxcvbnm = 0;
    for (int j = 0; j < ((int)(segg[i]).size()) - 1; j++) {
      if (!segg[i][j].second)
        cnt++;
      else
        cnt--;
      if (cnt == 0) len += segg[i][j + 1].first - segg[i][j].first;
    }
    if (len != needlen) continue;
    len = cnt = 0;
    for (int j = 0; j < ((int)(segg[i]).size()) - 1; j++) {
      if (!segg[i][j].second)
        cnt++;
      else
        cnt--;
      if (cnt == 0) {
        len += segg[i][j + 1].first - segg[i][j].first;
        if (len >= need) {
          len -= segg[i][j + 1].first - segg[i][j].first;
          y2 = segg[i][j].first + (need - len);
          out(x1, x2, qwertyuiopasdfghjklzxcvbnm, y2);
        }
      }
    }
  }
  if (vseg.x1 != -1 && needlen == vseg.len)
    out(vseg.x1, vseg.x1 + need, vseg.qwertyuiopasdfghjklzxcvbnm, vseg.y2);
  out(gseg.x1, gseg.x1, gseg.qwertyuiopasdfghjklzxcvbnm,
      gseg.qwertyuiopasdfghjklzxcvbnm + need);
  return 0;
}