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;
map<int, vector<pair<int, int> > > vcuts, hcuts;
map<int, int> vlens, hlens;
int N, M, K;
int main() {
  scanf("%d %d %d", &N, &M, &K);
  int sum = 0;
  if ((N - 1) & 1) sum ^= M;
  if ((M - 1) & 1) sum ^= N;
  for (int i = 0; i < K; ++i) {
    int a, b, c, d;
    scanf("%d %d %d %d", &a, &b, &c, &d);
    if (a == c) {
      if (b > d) swap(b, d);
      vcuts[a].push_back(pair<int, int>(b, 1));
      vcuts[a].push_back(pair<int, int>(d, -1));
    } else if (b == d) {
      if (a > c) swap(a, c);
      hcuts[b].push_back(pair<int, int>(a, 1));
      hcuts[b].push_back(pair<int, int>(c, -1));
    }
  }
  for (typeof((vcuts).begin()) i = (vcuts).begin(), _i = (vcuts).end(); i != _i;
       ++i) {
    vector<pair<int, int> > &v = i->second;
    sort(v.begin(), v.end());
    int prv = 0, cnt = 0, len = 0;
    for (typeof((v).begin()) j = (v).begin(), _j = (v).end(); j != _j; ++j) {
      int cur = j->first;
      if (cnt == 0) len += cur - prv;
      cnt += j->second;
      prv = cur;
    }
    len += M - prv;
    vlens[i->first] = len;
    sum ^= M ^ len;
  }
  for (typeof((hcuts).begin()) i = (hcuts).begin(), _i = (hcuts).end(); i != _i;
       ++i) {
    vector<pair<int, int> > &v = i->second;
    sort(v.begin(), v.end());
    int prv = 0, cnt = 0, len = 0;
    for (typeof((v).begin()) j = (v).begin(), _j = (v).end(); j != _j; ++j) {
      int cur = j->first;
      if (cnt == 0) len += cur - prv;
      cnt += j->second;
      prv = cur;
    }
    len += N - prv;
    hlens[i->first] = len;
    sum ^= N ^ len;
  }
  if (sum == 0) {
    printf("SECOND\n");
  } else {
    printf("FIRST\n");
    int need = 1;
    while ((need << 1) <= sum) need <<= 1;
    int vfree = 0, vprv = 0;
    for (typeof((vlens).begin()) it = (vlens).begin(), _it = (vlens).end();
         it != _it; ++it) {
      int i = it->first;
      if (i != vprv + 1) vfree = vprv + 1;
      vprv = i;
      int len = it->second;
      if (len & need) {
        int res = len ^ sum;
        int curlen = 0, cnt = 0, prv = 0;
        int ind;
        if (res) {
          for (typeof((vcuts[i]).begin()) j = (vcuts[i]).begin(),
                                          _j = (vcuts[i]).end();
               j != _j; ++j) {
            int cur = j->first;
            if (cnt == 0) {
              if (curlen + cur - prv >= res)
                break;
              else
                curlen += cur - prv;
            }
            cnt += j->second;
            prv = cur;
          }
          ind = prv + res - curlen;
        } else
          ind = 0;
        printf("%d %d %d %d\n", i, ind, i, M);
        return 0;
      }
    }
    if (vprv < N - 1) vfree = N - 1;
    if (vfree) {
      if (M & need) {
        int res = M ^ sum;
        printf("%d %d %d %d\n", vfree, res, vfree, M);
        return 0;
      }
    }
    int hfree = 0, hprv = 0;
    for (typeof((hlens).begin()) it = (hlens).begin(), _it = (hlens).end();
         it != _it; ++it) {
      int i = it->first;
      if (i != hprv + 1) hfree = hprv + 1;
      int len = it->second;
      if (len & need) {
        int res = len ^ sum;
        int curlen = 0, cnt = 0, prv = 0;
        int ind;
        if (res) {
          for (typeof((hcuts[i]).begin()) j = (hcuts[i]).begin(),
                                          _j = (hcuts[i]).end();
               j != _j; ++j) {
            int cur = j->first;
            if (cnt == 0) {
              if (curlen + cur - prv >= res)
                break;
              else
                curlen += cur - prv;
            }
            cnt += j->second;
            prv = cur;
          }
          ind = prv + res - curlen;
        } else
          ind = 0;
        printf("%d %d %d %d\n", ind, i, N, i);
        return 0;
      }
    }
    if (hprv < M - 1) hfree = M - 1;
    if (hfree) {
      if (N & need) {
        int res = N ^ sum;
        printf("%d %d %d %d\n", res, hfree, N, hfree);
        return 0;
      }
    }
  }
  return 0;
}