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 = 200007;
map<int, int> MH, MV;
vector<vector<pair<int, int> > > cuth, cutv;
vector<int> freev, freeh;
int n, m, k, curh, curv, numh[N], numv[N];
int free(vector<pair<int, int> > segments, int size) {
  int i, r = 0, ret = 0;
  for (i = 0; i < segments.size(); ++i) {
    int a = segments[i].first;
    int b = segments[i].second;
    if (a > r) {
      ret += a - r;
    }
    r = max(r, b);
  }
  ret += size - r;
  return ret;
}
int main() {
  int i, j, rest, xorh, xorv;
  scanf("%d%d%d", &n, &m, &k);
  xorh = xorv = 0;
  for (i = 0; i < k; ++i) {
    int bx, by, ex, ey;
    scanf("%d%d%d%d", &bx, &by, &ex, &ey);
    if (bx == ex) {
      if (MH.find(bx) == MH.end()) {
        MH.insert(make_pair(bx, curh));
        numh[curh] = bx;
        cuth.push_back(vector<pair<int, int> >(0));
        ++curh;
      }
      if (by > ey) {
        swap(by, ey);
      }
      int ind = MH[bx];
      cuth[ind].push_back(make_pair(by, ey));
    } else {
      if (MV.find(by) == MV.end()) {
        MV.insert(make_pair(by, curv));
        numv[curv] = by;
        cutv.push_back(vector<pair<int, int> >(0));
        ++curv;
      }
      if (bx > ex) {
        swap(bx, ex);
      }
      int ind = MV[by];
      cutv[ind].push_back(make_pair(bx, ex));
    }
  }
  for (i = 0; i < curh; ++i) {
    sort((cuth[i]).begin(), (cuth[i]).end());
  }
  for (i = 0; i < curv; ++i) {
    sort((cutv[i]).begin(), (cutv[i]).end());
  }
  freeh.resize(curh);
  for (i = 0; i < curh; ++i) {
    freeh[i] = free(cuth[i], m);
    xorh ^= freeh[i];
  }
  rest = n - 1 - curh;
  if (rest & 1) {
    xorh ^= m;
  }
  freev.resize(curv);
  for (i = 0; i < curv; ++i) {
    freev[i] = free(cutv[i], n);
    xorv ^= freev[i];
  }
  rest = m - 1 - curv;
  if (rest & 1) {
    xorv ^= n;
  }
  if ((xorv ^ xorh) == 0) {
    puts("SECOND");
    return 0;
  }
  puts("FIRST");
  if (curh < n - 1) {
    int tmp = xorh ^ m;
    int needToCut = m - (tmp ^ xorv);
    if (0 < needToCut && needToCut <= m) {
      for (i = 1; MH.find(i) != MH.end(); ++i)
        ;
      printf("%d %d %d %d\n", i, 0, i, needToCut);
      return 0;
    }
  }
  for (i = 0; i < curh; ++i) {
    int tmp = xorh ^ freeh[i];
    int needToBe = tmp ^ xorv;
    if (0 <= needToBe && needToBe < freeh[i]) {
      int r = 0;
      int len = 0;
      if (needToBe == 0) {
        printf("%d %d %d %d\n", numh[i], 0, numh[i], m);
        return 0;
      }
      for (j = 0; j < cuth[i].size(); ++j) {
        int a = cuth[i][j].first;
        int b = cuth[i][j].second;
        if (a > r) {
          len += a - r;
          if (len >= needToBe) {
            printf("%d %d %d %d\n", numh[i], a - len + needToBe, numh[i], m);
            return 0;
          }
        }
        r = max(r, b);
      }
      len += m - r;
      printf("%d %d %d %d\n", numh[i], m - len + needToBe, numh[i], m);
      return 0;
    }
  }
  if (curv < m - 1) {
    int tmp = xorv ^ n;
    int needToCut = n - (tmp ^ xorh);
    if (0 < needToCut && needToCut <= n) {
      for (i = 1; MV.find(i) != MV.end(); ++i)
        ;
      printf("%d %d %d %d\n", 0, i, needToCut, i);
      return 0;
    }
  }
  for (i = 0; i < curv; ++i) {
    int tmp = xorv ^ freev[i];
    int needToBe = tmp ^ xorh;
    if (0 <= needToBe && needToBe < freev[i]) {
      int r = 0;
      int len = 0;
      if (needToBe == 0) {
        printf("%d %d %d %d\n", 0, numv[i], n, numv[i]);
        return 0;
      }
      for (j = 0; j < cutv[i].size(); ++j) {
        int a = cutv[i][j].first;
        int b = cutv[i][j].second;
        if (a > r) {
          len += a - r;
          if (len >= needToBe) {
            printf("%d %d %d %d\n", a - len + needToBe, numv[i], n, numv[i]);
            return 0;
          }
        }
        r = max(r, b);
      }
      len += n - r;
      printf("%d %d %d %d\n", n - len + needToBe, numv[i], n, numv[i]);
      return 0;
    }
  }
  assert(true);
  return 0;
}