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 Node {
  int x, y, z;
} node1[100100], node[100100];
int n, m, k, ans, X1, Y1, X2, Y2;
int a, b, c, d, tmp1, tmp2, tmp;
int p, q;
bool cmp(Node a, Node b) {
  if (a.x != b.x)
    return a.x < b.x;
  else if (a.y != b.y)
    return a.y < b.y;
  else
    return a.z < b.z;
}
int fuck;
map<int, bool> h1, h2;
map<int, int> X, Y, x, y;
vector<int> V1, V2;
int main() {
  while (~scanf("%d%d%d", &n, &m, &k)) {
    p = q = 0;
    ans = 0;
    tmp1 = n - 1;
    tmp2 = m - 1;
    X1 = X2 = Y1 = Y2 = 0;
    h1.clear();
    h2.clear();
    X.clear();
    Y.clear();
    x.clear();
    y.clear();
    V1.clear();
    V2.clear();
    for (int i = 1; i <= k; i++) {
      scanf("%d%d%d%d", &a, &b, &c, &d);
      if (a == c) {
        node[++p].x = a;
        node[p].y = min(b, d);
        node[p].z = max(b, d);
      } else {
        node1[++q].x = b;
        node1[q].y = min(a, c);
        node1[q].z = max(a, c);
      }
    }
    sort(node + 1, node + 1 + p, cmp);
    sort(node1 + 1, node1 + 1 + q, cmp);
    for (int i = 1; i <= p; i++) {
      if (!h1[node[i].x]) {
        tmp1--;
        h1[node[i].x] = 1;
        V1.push_back(node[i].x);
      }
      if (i == 1) {
        tmp = node[i].y;
        fuck = node[i].z;
        x[node[1].x] = 1;
      } else {
        if (node[i].x == node[i - 1].x) {
          if (node[i].y > fuck) tmp += node[i].y - fuck;
          fuck = max(fuck, node[i].z);
        } else {
          x[node[i].x] = i;
          tmp += m - fuck;
          ans ^= tmp;
          X[node[i - 1].x] = tmp;
          tmp = node[i].y;
          fuck = node[i].z;
        }
      }
      if (i == p) {
        tmp += m - fuck;
        ans ^= tmp;
        X[node[p].x] = tmp;
      }
    }
    for (int i = 1; i <= q; i++) {
      if (!h2[node1[i].x]) {
        tmp2--;
        h2[node1[i].x] = 1;
        V2.push_back(node1[i].x);
      }
      if (i == 1) {
        tmp = node1[i].y;
        y[node1[i].x] = 1;
        fuck = node1[i].z;
      } else {
        if (node1[i].x == node1[i - 1].x) {
          if (node1[i].y > fuck) tmp += node1[i].y - fuck;
          fuck = max(fuck, node1[i].z);
        } else {
          tmp += n - fuck;
          ans ^= tmp;
          Y[node1[i - 1].x] = tmp;
          y[node1[i].x] = i;
          tmp = node1[i].y;
          fuck = node1[i].z;
        }
      }
      if (i == q) {
        tmp += n - fuck;
        ans ^= tmp;
        Y[node1[q].x] = tmp;
      }
    }
    if (tmp1 & 1) ans ^= m;
    if (tmp2 & 1) ans ^= n;
    if (tmp1 && (ans ^ m) < m) {
      for (int i = 1; i < n; i++)
        if (!h1[i]) {
          printf("FIRST\n");
          printf("%d %d %d %d\n", i, ans ^ m, i, m);
          break;
        }
      continue;
    }
    if (tmp2 && (ans ^ n) < n) {
      for (int i = 1; i < m; i++)
        if (!h2[i]) {
          printf("FIRST\n");
          printf("%d %d %d %d\n", ans ^ n, i, n, i);
          break;
        }
      continue;
    }
    bool fang = 0;
    int xie, e;
    if (ans) {
      printf("FIRST\n");
      for (int i = 0; i < V1.size(); i++) {
        tmp = V1[i];
        if ((ans ^ X[tmp]) < X[tmp]) {
          xie = X[tmp] - (ans ^ X[tmp]);
          e = 0;
          fuck = 0;
          for (int j = x[tmp];; j++) {
            if (node[j].y > fuck) {
              e += node[j].y - fuck;
            }
            fuck = max(node[j].z, fuck);
            if (e >= xie) {
              printf("%d %d %d %d\n", tmp, 0, tmp, node[j].y - (e - xie));
              fang = 1;
              break;
            }
            if (fang) break;
            if (node1[j].x != node1[j + 1].x) {
              e = X[tmp];
              printf("%d %d %d %d\n", tmp, 0, tmp, m - (ans ^ X[tmp]));
              fang = 1;
              break;
            }
            if (fang) break;
          }
        }
        if (fang) break;
      }
      if (fang) break;
      for (int i = 1; i <= q; i++) {
        tmp = V2[i];
        if ((ans ^ Y[tmp]) < Y[tmp]) {
          xie = Y[tmp] - (ans ^ Y[tmp]);
          e = 0;
          fuck = 0;
          for (int j = y[tmp];; j++) {
            if (node1[j].y > fuck) {
              e += node1[j].y - fuck;
            }
            fuck = max(node1[j].z, fuck);
            if (e >= xie) {
              printf("%d %d %d %d\n", 0, tmp, node1[j].y - (e - xie), tmp);
              fang = 1;
              break;
            }
            if (fang) break;
            if (node1[j].x != node1[j + 1].x) {
              e = Y[tmp];
              printf("%d %d %d %d\n", 0, tmp, n - (ans ^ Y[tmp]), tmp);
              fang = 1;
              break;
            }
            if (fang) break;
          }
        }
        if (fang) break;
      }
    } else
      printf("SECOND\n");
  }
  return 0;
}