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 cnt1, cnt2, cnt, n, m, k, A, B, C, D, i, j, l, v[100005], sum1, sum2, Q, Q2,
    nowx, nowy, ans, P, L, R, mid, CNT;
struct node {
  int x, y, z;
} t1[100005], t2[100005], h[100005], s[100005], S[100005], H[100005];
int cmp(node i, node j) { return i.x < j.x; }
int OK(int x) {
  int sum = 0;
  for (int i = 1; i <= CNT; i++)
    if (H[i].x <= x) {
      if (H[i].y <= x)
        sum += H[i].y - H[i].x + 1;
      else
        sum += x - H[i].x + 1;
    }
  return x - sum;
}
int main() {
  scanf("%d%d%d", &n, &m, &k);
  for (i = 1; i <= k; i++) {
    scanf("%d%d%d%d", &A, &B, &C, &D);
    if (A == C) {
      t1[++cnt1].x = A;
      t1[cnt1].y = min(B, D);
      t1[cnt1].z = max(B, D);
    } else {
      t2[++cnt2].x = B;
      t2[cnt2].y = min(A, C);
      t2[cnt2].z = max(A, C);
    }
  }
  sort(t1 + 1, t1 + cnt1 + 1, cmp);
  sort(t2 + 1, t2 + cnt2 + 1, cmp);
  for (j = 1, i = 2; i <= cnt1 + 1; i++)
    if (i == cnt1 + 1 || t1[i].x != t1[i - 1].x) {
      cnt = 0;
      sum1++;
      for (k = j; k < i; k++) {
        h[++cnt].x = t1[k].y;
        h[cnt].y = t1[k].z;
      }
      sort(h + 1, h + cnt + 1, cmp);
      s[++Q].x = m;
      s[Q].y = t1[i - 1].x;
      nowx = nowy = 0;
      for (k = 1; k <= cnt; k++)
        if (h[k].x <= nowy)
          nowy = max(nowy, h[k].y);
        else {
          s[Q].x -= (nowy - nowx);
          nowx = h[k].x;
          nowy = h[k].y;
        }
      s[Q].x -= (nowy - nowx);
      j = i;
    }
  for (j = 1, i = 2; i <= cnt2 + 1; i++)
    if (i == cnt2 + 1 || t2[i].x != t2[i - 1].x) {
      cnt = 0;
      sum2++;
      for (k = j; k < i; k++) {
        h[++cnt].x = t2[k].y;
        h[cnt].y = t2[k].z;
      }
      sort(h + 1, h + cnt + 1, cmp);
      S[++Q2].x = n;
      S[Q2].y = t2[i - 1].x;
      nowx = nowy = 0;
      for (k = 1; k <= cnt; k++)
        if (h[k].x <= nowy)
          nowy = max(nowy, h[k].y);
        else {
          S[Q2].x -= (nowy - nowx);
          nowx = h[k].x;
          nowy = h[k].y;
        }
      S[Q2].x -= (nowy - nowx);
      j = i;
    }
  if ((n - sum1) % 2 == 0) {
    s[++Q].x = m;
    t1[cnt1 + 1].x = n;
    for (i = 1; i <= cnt1 + 1; i++)
      if (t1[i].x - t1[i - 1].x >= 2) {
        s[Q].y = t1[i].x - 1;
        break;
      }
  }
  if ((m - sum2) % 2 == 0) {
    S[++Q2].x = n;
    t2[cnt2 + 1].x = m;
    for (i = 1; i <= cnt2 + 1; i++)
      if (t2[i].x - t2[i - 1].x >= 2) {
        S[Q2].y = t2[i].x - 1;
        break;
      }
  }
  for (i = 1; i <= Q; i++) ans ^= s[i].x;
  for (i = 1; i <= Q2; i++) ans ^= S[i].x;
  if (!ans) {
    cout << "SECOND";
    return 0;
  }
  cout << "FIRST" << endl;
  for (i = 1; i <= Q; i++)
    if ((s[i].x ^ ans) < s[i].x) break;
  if (i <= Q) {
    cout << s[i].y << ' ' << 0 << ' ' << s[i].y << ' ';
    j = i;
    cnt = 0;
    for (i = 1; i <= cnt1; i++)
      if (t1[i].x == s[j].y) {
        h[++cnt].x = t1[i].y;
        h[cnt].y = t1[i].z;
      }
    sort(h + 1, h + cnt + 1, cmp);
    nowx = nowy = 0;
    for (k = 1; k <= cnt; k++)
      if (h[k].x <= nowy)
        nowy = max(nowy, h[k].y);
      else {
        H[++CNT].x = nowx + 1;
        H[CNT].y = nowy;
        nowx = h[k].x;
        nowy = h[k].y;
      }
    H[++CNT].x = nowx + 1;
    H[CNT].y = nowy;
    L = 1;
    R = m;
    mid = (L + R) / 2;
    s[j].x = s[j].x - (s[j].x ^ ans);
    while (L <= R) {
      if (OK(mid) >= s[j].x) {
        R = mid - 1;
        mid = (L + R) / 2;
      } else {
        L = mid + 1;
        mid = (L + R) / 2;
      }
    }
    cout << L << endl;
    return 0;
  }
  for (i = 1; i <= Q2; i++)
    if ((S[i].x ^ ans) < S[i].x) break;
  cout << 0 << ' ' << S[i].y << ' ';
  P = S[i].y;
  j = i;
  cnt = 0;
  for (i = 1; i <= cnt2; i++)
    if (t2[i].x == S[j].y) {
      h[++cnt].x = t2[i].y;
      h[cnt].y = t2[i].z;
    }
  sort(h + 1, h + cnt + 1, cmp);
  nowx = nowy = 0;
  for (k = 1; k <= cnt; k++)
    if (h[k].x <= nowy)
      nowy = max(nowy, h[k].y);
    else {
      H[++CNT].x = nowx + 1;
      H[CNT].y = nowy;
      nowx = h[k].x;
      nowy = h[k].y;
    }
  H[++CNT].x = nowx + 1;
  H[CNT].y = nowy;
  S[j].x = S[j].x - (S[j].x ^ ans);
  L = 1;
  R = n;
  mid = (L + R) / 2;
  while (L <= R) {
    if (OK(mid) >= S[j].x) {
      R = mid - 1;
      mid = (L + R) / 2;
    } else {
      L = mid + 1;
      mid = (L + R) / 2;
    }
  }
  cout << L << ' ' << P << endl;
  return 0;
}