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;
template <typename T1, typename T2>
inline void chkmin(T1 &x, T2 y) {
  if (x > y) x = y;
}
template <typename T1, typename T2>
inline void chkmax(T1 &x, T2 y) {
  if (x < y) x = y;
}
template <class T>
bool uin(T &a, T b) {
  return a > b ? (a = b, true) : false;
}
template <class T>
bool uax(T &a, T b) {
  return a < b ? (a = b, true) : false;
}
inline int readChar();
template <class T = int>
inline T readInt();
template <class T>
inline void writeInt(T x, char end = 0);
inline void writeChar(int x);
inline void writeWord(const char *s);
static const int buf_size = 4096;
inline int getChar() {
  static char buf[buf_size];
  static int len = 0, pos = 0;
  if (pos == len) pos = 0, len = fread(buf, 1, buf_size, stdin);
  if (pos == len) return -1;
  return buf[pos++];
}
inline int readChar() {
  int c = getChar();
  while (c <= 32) c = getChar();
  return c;
}
template <class T>
inline T readInt() {
  int s = 1, c = readChar();
  T x = 0;
  if (c == '-') s = -1, c = getChar();
  while ('0' <= c && c <= '9') x = x * 10 + c - '0', c = getChar();
  return s == 1 ? x : -x;
}
static int write_pos = 0;
static char write_buf[buf_size];
inline void writeChar(int x) {
  if (write_pos == buf_size)
    fwrite(write_buf, 1, buf_size, stdout), write_pos = 0;
  write_buf[write_pos++] = x;
}
template <class T>
inline void writeInt(T x, char end) {
  if (x < 0) writeChar('-'), x = -x;
  char s[24];
  int n = 0;
  while (x || !n) s[n++] = '0' + x % 10, x /= 10;
  while (n--) writeChar(s[n]);
  if (end) writeChar(end);
}
inline void writeWord(const char *s) {
  while (*s) writeChar(*s++);
}
struct flusher {
  ~flusher() {
    if (write_pos) fwrite(write_buf, 1, write_pos, stdout), write_pos = 0;
  }
} flusher;
const int CLOSE = -1;
const int OPEN = 1;
const int MAXN = 100228;
struct event {
  int x, t;
  event(int x, int t) : x(x), t(t) {}
  event() {}
};
inline bool operator<(const event &a, const event &b) { return a.x < b.x; }
struct segment {
  int level, x1, x2;
  segment(int level, int x1, int x2) : level(level), x1(x1), x2(x2) {}
  segment() {}
};
inline bool operator<(const segment &a, const segment &b) {
  return a.level < b.level;
}
int n, m, k;
vector<segment> xs, ys;
vector<event> evx[MAXN], evy[MAXN];
int rx[MAXN], ry[MAXN], lenx[MAXN], leny[MAXN];
int main() {
  n = readInt(), m = readInt(), k = readInt();
  for (int i = 0; i < k; i++) {
    int x1 = readInt(), y1 = readInt(), x2 = readInt(), y2 = readInt();
    if (x1 > x2) {
      swap(x1, x2);
    }
    if (y1 > y2) {
      swap(y1, y2);
    }
    if (x1 == x2) {
      ys.push_back(segment(x1, y1, y2));
    } else {
      xs.push_back(segment(y1, x1, x2));
    }
  }
  sort((xs).begin(), (xs).end());
  sort((ys).begin(), (ys).end());
  int kx = 0;
  for (int i = 0; i < (int)(xs).size(); i++) {
    if (i == 0 || xs[i].level != xs[i - 1].level) {
      evx[kx].resize(0);
      evx[kx].push_back(event(xs[i].x1, OPEN));
      evx[kx].push_back(event(xs[i].x2, CLOSE));
      ry[kx] = xs[i].level;
      kx++;
    } else {
      evx[kx - 1].push_back(event(xs[i].x1, OPEN));
      evx[kx - 1].push_back(event(xs[i].x2, CLOSE));
    }
  }
  int ky = 0;
  for (int i = 0; i < (int)(ys).size(); i++) {
    if (i == 0 || ys[i].level != ys[i - 1].level) {
      evy[ky].resize(0);
      evy[ky].push_back(event(ys[i].x1, OPEN));
      evy[ky].push_back(event(ys[i].x2, CLOSE));
      rx[ky] = ys[i].level;
      ky++;
    } else {
      evy[ky - 1].push_back(event(ys[i].x1, OPEN));
      evy[ky - 1].push_back(event(ys[i].x2, CLOSE));
    }
  }
  int answer = 0;
  if ((m - 1 - kx) % 2 == 1) {
    answer ^= n;
  }
  if ((n - 1 - ky) % 2 == 1) {
    answer ^= m;
  }
  for (int i = 0; i < kx; i++) {
    sort((evx[i]).begin(), (evx[i]).end());
    int curk = 0;
    int lastx = 0;
    lenx[i] = 0;
    for (int j = 0; j < (int)(evx[i]).size(); j++) {
      if (curk == 0) {
        lenx[i] += evx[i][j].x - lastx;
      }
      curk += evx[i][j].t;
      lastx = evx[i][j].x;
    }
    lenx[i] += n - lastx;
    answer ^= lenx[i];
  }
  for (int i = 0; i < ky; i++) {
    sort((evy[i]).begin(), (evy[i]).end());
    int curk = 0;
    int lastx = 0;
    leny[i] = 0;
    for (int j = 0; j < (int)(evy[i]).size(); j++) {
      if (curk == 0) {
        leny[i] += evy[i][j].x - lastx;
      }
      curk += evy[i][j].t;
      lastx = evy[i][j].x;
    }
    leny[i] += m - lastx;
    answer ^= leny[i];
  }
  if (answer == 0) {
    writeWord("SECOND\n");
    return 0;
  }
  writeWord("FIRST\n");
  for (int i = 0; i < kx; i++) {
    int need = (answer ^ lenx[i]);
    if (need <= lenx[i]) {
      need = lenx[i] - need;
      int curk = 0;
      int lastx = 0;
      int curlen = 0;
      for (int j = 0; j < (int)(evx[i]).size(); j++) {
        if (curk == 0) {
          curlen += evx[i][j].x - lastx;
        }
        if (curlen >= need) {
          writeInt(0, ' ');
          writeInt(ry[i], ' ');
          writeInt(evx[i][j].x - (curlen - need), ' ');
          writeInt(ry[i], '\n');
          return 0;
        }
        curk += evx[i][j].t;
        lastx = evx[i][j].x;
      }
      curlen += n - lastx;
      writeInt(0, ' ');
      writeInt(ry[i], ' ');
      writeInt(n - (curlen - need), ' ');
      writeInt(ry[i], '\n');
      return 0;
    }
  }
  for (int i = 0; i < ky; i++) {
    int need = (answer ^ leny[i]);
    if (need <= leny[i]) {
      need = leny[i] - need;
      int curk = 0;
      int lastx = 0;
      int curlen = 0;
      for (int j = 0; j < (int)(evy[i]).size(); j++) {
        if (curk == 0) {
          curlen += evy[i][j].x - lastx;
        }
        if (curlen >= need) {
          writeInt(rx[i], ' ');
          writeInt(0, ' ');
          writeInt(rx[i], ' ');
          writeInt(evy[i][j].x - (curlen - need), '\n');
          return 0;
        }
        curk += evy[i][j].t;
        lastx = evy[i][j].x;
      }
      curlen += m - lastx;
      writeInt(rx[i], ' ');
      writeInt(0, ' ');
      writeInt(rx[i], ' ');
      writeInt(m - (curlen - need), '\n');
      return 0;
    }
  }
  int emptyx = -1;
  if (n > 1 && ky == 0) {
    emptyx = 1;
  }
  if (ky > 0 && rx[0] != 1) {
    emptyx = 1;
  }
  for (int i = 0; i < ky; i++) {
    if (rx[i] + 1 != rx[i + 1] && rx[i] + 1 != n) {
      emptyx = rx[i] + 1;
    }
  }
  int need = (answer ^ m);
  if (need <= m && emptyx != -1) {
    writeInt(emptyx, ' ');
    writeInt(0, ' ');
    writeInt(emptyx, ' ');
    writeInt(m - need, '\n');
    return 0;
  }
  int emptyy = -1;
  if (m > 1 && kx == 0) {
    emptyy = 1;
  }
  if (kx > 0 && ry[0] != 1) {
    emptyy = 1;
  }
  for (int i = 0; i < kx; i++) {
    if (ry[i] + 1 != ry[i + 1] && ry[i] + 1 != m) {
      emptyy = ry[i] + 1;
    }
  }
  need = (answer ^ n);
  if (need <= n && emptyy != -1) {
    writeInt(0, ' ');
    writeInt(emptyy, ' ');
    writeInt(n - need, ' ');
    writeInt(emptyy, '\n');
    return 0;
  }
  return 0;
}