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;
vector<pair<int, pair<int, int> > > cuts[2];
map<int, int> G[2];
int main() {
  int n[2], k, i0, i, c, mxc;
  int ans, add, d;
  int fcnt, fcoord;
  int x0, x1, y0, y1, c0, dy;
  bool found;
  scanf("%d%d%d", n, n + 1, &k);
  cuts[0].reserve(k);
  cuts[1].reserve(k);
  for (i = 0; i < k; ++i) {
    scanf("%d%d%d%d", &x0, &y0, &x1, &y1);
    if (x0 > x1) swap(x0, x1);
    if (y0 > y1) swap(y0, y1);
    if (x0 == x1)
      cuts[0].push_back(make_pair(x0, make_pair(y0, y1)));
    else
      cuts[1].push_back(make_pair(y0, make_pair(x0, x1)));
  }
  for (ans = c = 0; c < 2; ++c) {
    sort(cuts[c].begin(), cuts[c].end());
    fcnt = n[c] - 1;
    for (i = 0; i <= cuts[c].size(); ++i)
      if (i == 0 || i == cuts[c].size() ||
          cuts[c][i].first != cuts[c][i0].first) {
        if (i) {
          G[c].insert(make_pair(cuts[c][i0].first, add + n[!c] - mxc));
          ans ^= (add + n[!c] - mxc);
          --fcnt;
        }
        if (i < cuts[c].size()) {
          i0 = i;
          add = cuts[c][i].second.first;
          mxc = cuts[c][i].second.second;
        }
      } else {
        if (cuts[c][i].second.first > mxc) add += cuts[c][i].second.first - mxc;
        if (cuts[c][i].second.second > mxc) mxc = cuts[c][i].second.second;
      }
    if (fcnt & 1) ans ^= n[!c];
  }
  if (ans) {
    puts("FIRST");
    for (d = 30;; --d)
      if (ans & (1 << d)) break;
    for (found = c = 0; !found; ++c) {
      fcoord = 0;
      if (n[c] > 1)
        if (cuts[c].size() == 0 || cuts[c][0].first > 1)
          fcoord = 1;
        else if (cuts[c][cuts[c].size() - 1].first < n[c] - 1)
          fcoord = n[c] - 1;
        else
          for (i = 1; i < cuts[c].size(); ++i)
            if (cuts[c][i - 1].first + 1 < cuts[c][i].first) {
              fcoord = cuts[c][i - 1].first + 1;
              break;
            }
      if (fcoord && (n[!c] & (1 << d))) {
        x0 = x1 = fcoord;
        y0 = 0;
        y1 = n[!c] - (n[!c] ^ ans);
        c0 = c;
        found = true;
      }
      if (found) break;
      for (i0 = 0; i0 < cuts[c].size(); ++i0) {
        x0 = x1 = cuts[c][i0].first;
        if (G[c][x0] & (1 << d)) break;
      }
      if (i0 == cuts[c].size()) continue;
      dy = G[c][x0];
      dy = dy - (dy ^ ans);
      mxc = add = 0;
      for (i = i0; i <= cuts[c].size(); ++i)
        if (i < cuts[c].size() && cuts[c][i].first == cuts[c][i0].first) {
          if (cuts[c][i].second.first > mxc)
            add += cuts[c][i].second.first - mxc;
          if (cuts[c][i].second.second > mxc) mxc = cuts[c][i].second.second;
          if (add >= dy) {
            y0 = 0;
            y1 = cuts[c][i].second.first - (add - dy);
            c0 = c;
            found = true;
            break;
          }
        } else {
          add += n[!c] - mxc;
          mxc = n[!c];
          if (add >= dy) {
            y0 = 0;
            y1 = mxc - (add - dy);
            c0 = c;
            found = true;
          }
          break;
        }
    }
    if (c0) {
      swap(x0, y0);
      swap(x1, y1);
    }
    printf("%d %d %d %d\n", x0, y0, x1, y1);
  } else
    puts("SECOND");
  return 0;
}