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;
const int N = 100005;
struct Seg {
  int x1, y1, x2, y2;
};
Seg c[N], r[N], tmp[N * 2];
int cl, rl, ans[N * 2], al;
bool cmpC(Seg a, Seg b) {
  if (a.y1 == b.y1) return a.x1 < b.x1;
  return a.y1 < b.y1;
}
bool cmpR(Seg a, Seg b) {
  if (a.x1 == b.x1) return a.y1 < b.y1;
  return a.x1 < b.x1;
}
void addAns(int len, int x1, int y1, int x2, int y2) {
  ans[al] = len;
  tmp[al].x1 = x1;
  tmp[al].y1 = y1;
  tmp[al].x2 = x2;
  tmp[al].y2 = y2;
  al++;
}
int main() {
  int n, m, k;
  while (cin >> n >> m >> k) {
    int i, j, f[4];
    cl = rl = al = 0;
    for (i = 0; i < k; i++) {
      scanf("%d%d%d%d", &f[0], &f[1], &f[2], &f[3]);
      if (f[0] == f[2]) {
        if (f[1] > f[3]) {
          int t = f[1];
          f[1] = f[3];
          f[3] = t;
        }
        r[rl].x1 = f[0];
        r[rl].y1 = f[1];
        r[rl].x2 = f[2];
        r[rl++].y2 = f[3];
      } else {
        if (f[0] > f[2]) {
          int t = f[0];
          f[0] = f[2];
          f[2] = t;
        }
        c[cl].x1 = f[0];
        c[cl].y1 = f[1];
        c[cl].x2 = f[2];
        c[cl++].y2 = f[3];
      }
    }
    sort(c, c + cl, cmpC);
    sort(r, r + rl, cmpR);
    int nn = n, mm = m;
    for (i = 0; i < cl;) {
      int tn = 0;
      int tc = c[i].y1;
      while (i < cl && c[i].y1 == tc) {
        if (c[i].x2 <= tn) {
          i++;
          continue;
        }
        if (c[i].x1 > tn) addAns(c[i].x1 - tn, tn, tc, c[i].x1, tc);
        tn = c[i++].x2;
      }
      if (tn != nn) addAns(nn - tn, tn, tc, nn, tc);
      m--;
    }
    for (i = 0; i < rl;) {
      int tn = r[i].x1;
      int tc = 0;
      while (i < rl && r[i].x1 == tn) {
        if (r[i].y2 <= tc) {
          i++;
          continue;
        }
        if (r[i].y1 > tc) addAns(r[i].y1 - tc, tn, tc, tn, r[i].y1);
        tc = r[i++].y2;
      }
      if (tc != mm) addAns(mm - tc, tn, tc, tn, mm);
      n--;
    }
    if ((n - 1) & 1) {
      ans[al] = mm;
      int cnt = 1;
      for (i = 0; i < rl; cnt++) {
        if (r[i].x1 != cnt) break;
        while (i < rl && r[i].x1 == cnt) i++;
      }
      if (i == rl) cnt = nn - 1;
      tmp[al].x1 = tmp[al].x2 = cnt;
      tmp[al].y1 = 0;
      tmp[al].y2 = mm;
      al++;
    }
    if ((m - 1) & 1) {
      ans[al] = nn;
      int cnt = 1;
      for (i = 0; i < cl; cnt++) {
        if (c[i].y1 != cnt) break;
        while (i < cl && c[i].y1 == cnt) i++;
      }
      if (i == cl) cnt = mm - 1;
      tmp[al].y1 = tmp[al].y2 = cnt;
      tmp[al].x1 = 0;
      tmp[al].x2 = nn;
      al++;
    }
    int s = 0;
    for (i = 0; i < al;) {
      int ts = 0;
      int tn = tmp[i].x1;
      int tc = tmp[i].y1;
      while (i < al && tn == tmp[i].x1 && tmp[i].x1 == tmp[i].x2)
        ts += ans[i++];
      while (i < al && tc == tmp[i].y1 && tmp[i].y1 == tmp[i].y2)
        ts += ans[i++];
      s ^= ts;
    }
    if (s == 0)
      cout << "SECOND" << endl;
    else {
      cout << "FIRST" << endl;
      for (i = 0; i < al; i += j) {
        int ts = 0;
        j = 0;
        int tn = tmp[i].x1;
        int tc = tmp[i].y1;
        while (i + j < al && tn == tmp[i + j].x1 &&
               tmp[i + j].x1 == tmp[i + j].x2)
          ts += ans[i + j], j++;
        while (i + j < al && tc == tmp[i + j].y1 &&
               tmp[i + j].y1 == tmp[i + j].y2)
          ts += ans[i + j], j++;
        if (ts >= (s ^ ts)) {
          ts -= (s ^ ts);
          if (tmp[i].x1 == tmp[i].x2) {
            int ty;
            j = 0;
            while (ts) {
              if (ts > ans[i + j]) {
                ts -= ans[i + j];
                j++;
              } else {
                ty = tmp[i + j].y1 + ts;
                break;
              }
            }
            cout << tmp[i].x1 << " " << tmp[i].y1 << " " << tmp[i].x2 << " "
                 << ty << endl;
          } else {
            int tx;
            j = 0;
            while (ts) {
              if (ts > ans[i + j]) {
                ts -= ans[i + j];
                j++;
              } else {
                tx = tmp[i + j].x1 + ts;
                break;
              }
            }
            cout << tmp[i].x1 << " " << tmp[i].y1 << " " << tx << " "
                 << tmp[i].y2 << endl;
          }
          break;
        }
      }
    }
  }
  return 0;
}