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;
typedef pair<int, int> PII;
typedef struct cut_ST {
  int r1, r2, c1, c2;
} Segment;
int R, C, K;
vector<Segment> rowcuts;
vector<Segment> colcuts;
bool cmpr(Segment A, Segment B) {
  if (A.r1 != B.r1) return A.r1 < B.r1;
  return A.c1 < B.c1;
}
bool cmpc(Segment A, Segment B) {
  if (A.c1 != B.c1) return A.c1 < B.c1;
  return A.r1 < B.r1;
}
int cut(vector<PII> segs) {
  int cutTo = 0;
  int res = 0;
  int sz = segs.size();
  for (int i = 0; i < sz; i++) {
    if (segs[i].first > cutTo) res += segs[i].first - cutTo;
    cutTo = max(cutTo, segs[i].second);
  }
  return res;
}
Segment firstMove;
void computeCut(int isRow, int at, vector<PII> segs, int todo) {
  int cutTo = 0;
  int res = 0;
  int sz = segs.size();
  for (int i = 0; i < sz; i++) {
    if (segs[i].first > cutTo) res += segs[i].first - cutTo;
    if (res >= todo) {
      todo = segs[i].first - (res - todo);
      break;
    }
    cutTo = max(cutTo, segs[i].second);
  }
  if (isRow) {
    firstMove.r1 = firstMove.r2 = at;
    firstMove.c1 = 0;
    firstMove.c2 = todo;
  } else {
    firstMove.c1 = firstMove.c2 = at;
    firstMove.r1 = 0;
    firstMove.r2 = todo;
  }
}
int nim(int grundy2) {
  int grundy = 0;
  int i, j, sz;
  vector<int> cut_at_cols;
  vector<int> cut_at_rows;
  sz = rowcuts.size();
  for (i = 0; i < sz; i = j) {
    vector<PII> segs;
    for (j = i; j < sz && rowcuts[i].r1 == rowcuts[j].r1; j++)
      segs.push_back(PII(rowcuts[j].c1, rowcuts[j].c2));
    segs.push_back(PII(C, C));
    int totalLeft = cut(segs);
    grundy ^= totalLeft;
    cut_at_rows.push_back(rowcuts[i].r1);
    if (grundy2 != -1) {
      if ((totalLeft ^ grundy2) < totalLeft) {
        int todo = totalLeft - (totalLeft ^ grundy2);
        computeCut(1, rowcuts[i].r1, segs, todo);
        return 0;
      }
    }
  }
  sz = colcuts.size();
  for (i = 0; i < sz; i = j) {
    vector<PII> segs;
    for (j = i; j < sz && colcuts[i].c1 == colcuts[j].c1; j++)
      segs.push_back(PII(colcuts[j].r1, colcuts[j].r2));
    segs.push_back(PII(R, R));
    int totalLeft = cut(segs);
    grundy ^= totalLeft;
    cut_at_cols.push_back(colcuts[i].c1);
    if (grundy2 != -1) {
      if ((totalLeft ^ grundy2) < totalLeft) {
        int todo = totalLeft - (totalLeft ^ grundy2);
        computeCut(0, colcuts[i].c1, segs, todo);
        return 0;
      }
    }
  }
  if ((C - 1 - cut_at_cols.size()) % 2) grundy ^= R;
  if ((R - 1 - cut_at_rows.size()) % 2) grundy ^= C;
  if (grundy2 != -1) {
    if ((grundy2 ^ C) < C) {
      sz = cut_at_rows.size();
      int todo = C - (grundy2 ^ C);
      for (i = 1; i <= sz; i++) {
        if (i != cut_at_rows[i - 1]) {
          break;
        }
      }
      firstMove.r1 = firstMove.r2 = i;
      firstMove.c1 = 0;
      firstMove.c2 = todo;
      return 0;
    }
    if ((grundy2 ^ R) < R) {
      sz = cut_at_cols.size();
      int todo = R - (grundy2 ^ R);
      for (i = 1; i <= sz; i++) {
        if (i != cut_at_cols[i - 1]) {
          break;
        }
      }
      firstMove.c1 = firstMove.c2 = i;
      firstMove.r1 = 0;
      firstMove.r2 = todo;
      return 0;
    }
  }
  return grundy;
}
int main() {
  scanf("%d %d %d", &R, &C, &K);
  for (int i = 0; i < K; i++) {
    Segment cut;
    scanf("%d %d %d %d", &cut.r1, &cut.c1, &cut.r2, &cut.c2);
    if (cut.r1 == cut.r2) {
      if (cut.c1 > cut.c2) swap(cut.c1, cut.c2);
      rowcuts.push_back(cut);
    } else {
      if (cut.r1 > cut.r2) swap(cut.r1, cut.r2);
      colcuts.push_back(cut);
    }
  }
  sort(rowcuts.begin(), rowcuts.end(), cmpr);
  sort(colcuts.begin(), colcuts.end(), cmpc);
  int grundy = nim(-1);
  if (!grundy) {
    printf("SECOND\n");
  } else {
    nim(grundy);
    printf("FIRST\n");
    printf("%d %d %d %d\n", firstMove.r1, firstMove.c1, firstMove.r2,
           firstMove.c2);
  }
  return 0;
}