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 segm {
  bool vert;
  bool valid;
  int sx, sy, ex, ey;
  int len;
  segm(int _sx = 0, int _sy = 0, int _ex = 0, int _ey = 0) {
    sx = _sx;
    sy = _sy;
    ex = _ex;
    ey = _ey;
    build();
  }
  void build() {
    if (sx > ex) swap(sx, ex);
    if (sy > ey) swap(sy, ey);
    vert = (sx == ex);
    valid = 1;
    recLen();
  }
  void recLen() { len = ex + ey - sx - sy; }
  void merge(segm& other) {
    if (vert != other.vert) return;
    if (vert) {
      if (other.sx != sx) return;
      if (other.sy <= ey) {
        valid = 0;
        other.sy = sy;
        other.ey = max(ey, other.ey);
      }
    } else {
      if (other.sy != sy) return;
      if (other.sx <= ex) {
        valid = 0;
        other.sx = sx;
        other.ex = max(ex, other.ex);
      }
    }
    recLen();
    other.recLen();
  }
};
bool operator<(const segm& s1, const segm& s2) {
  if (s1.vert && !s2.vert) return true;
  if (!s1.vert && s2.vert) return false;
  if (s1.vert) {
    if (s1.sx != s2.sx) return s1.sx < s2.sx;
    return s1.sy < s2.sy;
  }
  if (s1.sy != s2.sy) return s1.sy < s2.sy;
  return s1.sx < s2.sx;
}
const int MAXVAL = 100005;
int leftLengthW[100005], leftLengthH[100005];
vector<segm> segmsVert[100005], segmsHor[100005];
int main() {
  clock_t cl = clock();
  vector<segm> segms;
  int w, h, k;
  scanf("%d%d%d", &w, &h, &k);
  segms.resize(k);
  for (int i = (0), endi = (k); i < endi; i++) {
    scanf("%d%d%d%d", &(segms[i].sx), &(segms[i].sy), &(segms[i].ex),
          &(segms[i].ey));
    segms[i].build();
  }
  sort((segms).begin(), (segms).end());
  for (int i = (0), endi = (MAXVAL); i < endi; i++) {
    leftLengthW[i] = w;
    leftLengthH[i] = h;
  }
  map<int, int> lengthsW, lengthsH;
  for (int i = (0), endi = (k); i < endi; i++) {
    if (i < k - 1) segms[i].merge(segms[i + 1]);
    if (segms[i].valid) {
      if (segms[i].vert) {
        if (segms[i].sx < MAXVAL) {
          leftLengthH[segms[i].sx] -= segms[i].len;
          segmsVert[segms[i].sx].push_back(segms[i]);
        }
        if (lengthsH.find(segms[i].sx) == lengthsH.end()) {
          lengthsH[segms[i].sx] = h - segms[i].len;
        } else
          lengthsH[segms[i].sx] -= segms[i].len;
      }
      if (!segms[i].vert) {
        if (segms[i].sy < MAXVAL) {
          leftLengthW[segms[i].sy] -= segms[i].len;
          segmsHor[segms[i].sy].push_back(segms[i]);
        }
        if (lengthsW.find(segms[i].sy) == lengthsW.end()) {
          lengthsW[segms[i].sy] = w - segms[i].len;
        } else
          lengthsW[segms[i].sy] -= segms[i].len;
      }
    }
  }
  int leftW = (h - 1 - lengthsW.size());
  int leftH = (w - 1 - lengthsH.size());
  int xorSum = 0;
  if (leftW & 1) xorSum ^= w;
  if (leftH & 1) xorSum ^= h;
  for (map<int, int>::iterator it = lengthsW.begin(), itEnd = lengthsW.end();
       it != itEnd; it++) {
    xorSum ^= it->second;
  }
  for (map<int, int>::iterator it = lengthsH.begin(), itEnd = lengthsH.end();
       it != itEnd; it++) {
    xorSum ^= it->second;
  }
  if (xorSum) {
    printf("FIRST\n");
    int sx, sy, ex, ey;
    bool found = 0;
    for (int i = (1), endi = (min(MAXVAL, w)); i < endi; i++) {
      if (found) break;
      int cVal = h;
      if (lengthsH.find(i) != lengthsH.end()) {
        cVal = lengthsH.find(i)->second;
      }
      if (cVal >= (cVal ^ xorSum)) {
        found = 1;
        sx = ex = i;
        sy = 0;
        ey = 0;
        int segmsLen = 0;
        int needed = cVal - (cVal ^ xorSum);
        for (int j = (0), endj = (segmsVert[i].size()); j < endj; j++) {
          if (segmsVert[i][j].sy - segmsLen >= needed) break;
          segmsLen += segmsVert[i][j].len;
        }
        ey = needed + segmsLen;
      }
    }
    for (int i = (1), endi = (min(MAXVAL, h)); i < endi; i++) {
      if (found) break;
      int cVal = w;
      if (lengthsW.find(i) != lengthsW.end()) {
        cVal = lengthsW.find(i)->second;
      }
      if (cVal >= (cVal ^ xorSum)) {
        found = 1;
        sy = ey = i;
        sx = 0;
        ex = 0;
        int segmsLen = 0;
        int needed = cVal - (cVal ^ xorSum);
        for (int j = (0), endj = (segmsHor[i].size()); j < endj; j++) {
          if (segmsHor[i][j].sx - segmsLen >= needed) break;
          segmsLen += segmsHor[i][j].len;
        }
        ex = needed + segmsLen;
      }
    }
    printf("%d %d %d %d\n", sx, sy, ex, ey);
  } else {
    printf("SECOND\n");
  }
  return 0;
}