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;
struct tcut {
  int x1, x2, y, len;
  int type;
} v[100500];
struct trow {
  int l, r;
  int xr;
} row[100500];
bool tcut_less(const tcut &a, const tcut &b) {
  return (a.type < b.type) || (a.type == b.type && a.y < b.y);
}
int x, y, k, n;
int row_count;
set<int> xset, yset;
int xcount;
int ycount;
int best, rmx, lmx;
pair<int, int> o[100500 * 2];
int get_grandy_value(int l, int r) {
  int start;
  int open = 0;
  int total = v[l].len;
  k = 0;
  for (int i = l; i < r; ++i) {
    o[k++] = make_pair(v[i].x1, -1);
    o[k++] = make_pair(v[i].x2, 1);
  }
  sort(o, o + k);
  for (int i = 0; i < k; ++i) {
    if (o[i].second == -1 && open == 0) {
      start = o[i].first;
    } else if (o[i].second == 1 && open == 1) {
      total -= (o[i].first - start);
    }
    open += -o[i].second;
  }
  row[row_count].l = l;
  row[row_count].r = r;
  row[row_count].xr = total;
  row_count++;
  return total;
}
int get_total(int a) {
  int start;
  int open = 0;
  int total = v[lmx].len;
  for (int i = 0; i < k; ++i) {
    if (o[i].first >= a) break;
    if (o[i].second == -1 && open == 0) {
      start = o[i].first;
    } else if (o[i].second == 1 && open == 1) {
      total -= (o[i].first - start);
    }
    open += -o[i].second;
  }
  if (open)
    total -= v[lmx].len - start;
  else
    total -= v[lmx].len - a;
  return total;
}
int main() {
  scanf("%i %i %i", &x, &y, &n);
  for (int i = 0; i < n; ++i) {
    int xx1, xx2, yy1, yy2;
    scanf("%i %i %i %i", &xx1, &yy1, &xx2, &yy2);
    if (xx1 > xx2) swap(xx1, xx2);
    if (yy1 > yy2) swap(yy1, yy2);
    if (xx1 == xx2) {
      v[k].x1 = yy1;
      v[k].x2 = yy2;
      v[k].y = xx1;
      v[k].len = y;
      v[k].type = 0;
      xset.insert(xx1);
    } else {
      v[k].x1 = xx1;
      v[k].x2 = xx2;
      v[k].y = yy1;
      v[k].len = x;
      v[k].type = 1;
      yset.insert(yy1);
    }
    k++;
  }
  sort(v, v + n, tcut_less);
  xcount = x - 1;
  ycount = y - 1;
  int ans = 0;
  for (int i = 0; i < n;) {
    int j = i;
    for (j = i; j < n && v[j].type == v[i].type && v[j].y == v[i].y; ++j)
      ;
    ans = ans ^ get_grandy_value(i, j);
    if (v[i].type == 0)
      xcount--;
    else
      ycount--;
    i = j;
  }
  if (xcount & 1) {
    ans ^= y;
  }
  if (ycount & 1) {
    ans ^= x;
  }
  if (!ans)
    printf("SECOND\n");
  else {
    printf("FIRST\n");
    if (xcount && y > (ans ^ y)) {
      ans ^= y;
      for (int i = 1; i < x; ++i)
        if (xset.find(i) == xset.end()) {
          printf("%i %i %i %i\n", i, ans, i, y);
          break;
        }
    } else if (ycount && x > (ans ^ x)) {
      ans ^= x;
      for (int i = 1; i < y; ++i)
        if (yset.find(i) == yset.end()) {
          printf("%i %i %i %i\n", ans, i, x, i);
          break;
        }
    } else
      for (int i = 0; i < row_count; ++i) {
        lmx = row[i].l;
        rmx = row[i].r;
        if ((ans ^ row[i].xr) >= row[i].xr) continue;
        ans = ans ^ row[i].xr;
        get_grandy_value(lmx, rmx);
        int A = 0;
        int B = v[lmx].len;
        while (B - A > 1) {
          int C = (A + B) / 2;
          if (get_total(C) > ans)
            B = C;
          else
            A = C;
        }
        if (get_total(A) != ans) A = B;
        if (v[lmx].type == 0) {
          printf("%i %i %i %i\n", v[lmx].y, A, v[lmx].y, v[lmx].len);
        } else {
          printf("%i %i %i %i\n", A, v[lmx].y, v[lmx].len, v[lmx].y);
        }
        break;
      }
  }
}