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 INF = 1001001001;
const long long INFLL = 1001001001001001001LL;
template <typename T>
void pv(T a, T b) {
  for (T i = a; i != b; ++i) cout << *i << " ";
  cout << endl;
}
template <typename T>
void chmin(T& a, T b) {
  if (a > b) a = b;
}
template <typename T>
void chmax(T& a, T b) {
  if (a < b) a = b;
}
int xb[100050], yb[100050], xe[100050], ye[100050];
struct cut {
  int A, B1, B2;
} C1[100050], C2[100050];
bool operator<(const cut& a, const cut& b) { return a.A < b.A; }
pair<int, int> P[200050];
int main() {
  int n, m, k;
  scanf("%d%d%d", &n, &m, &k);
  int c1 = 0, c2 = 0;
  for (int i = 0; i < k; ++i) {
    scanf("%d%d%d%d", &xb[i], &yb[i], &xe[i], &ye[i]);
    if (xb[i] == xe[i]) {
      C1[c1].A = xb[i];
      C1[c1].B1 = min(yb[i], ye[i]);
      C1[c1].B2 = max(yb[i], ye[i]);
      ++c1;
    } else {
      C2[c2].A = yb[i];
      C2[c2].B1 = min(xb[i], xe[i]);
      C2[c2].B2 = max(xb[i], xe[i]);
      ++c2;
    }
  }
  sort(C1, C1 + c1);
  sort(C2, C2 + c2);
  int ns = m - 1, ms = n - 1;
  vector<int> rem1, xx, rem2, yy;
  vector<vector<pair<int, int> > > sp1, sp2;
  for (int i = 0; i < c1;) {
    int j = i;
    while (j < c1 && C1[i].A == C1[j].A) ++j;
    int ps = 0;
    for (int k = i; k < j; ++k) {
      P[ps++] = make_pair(C1[k].B1, +1);
      P[ps++] = make_pair(C1[k].B2, -1);
    }
    sort(P, P + ps);
    int prev = 0, s = 0, r = 0;
    sp1.push_back(vector<pair<int, int> >());
    for (int k = 0; k < ps; ++k) {
      if (s == 0) {
        sp1.back().push_back(make_pair(prev, P[k].first));
        r += P[k].first - prev;
      }
      s += P[k].second;
      prev = P[k].first;
    }
    sp1.back().push_back(make_pair(prev, m));
    r += m - prev;
    rem1.push_back(r);
    xx.push_back(C1[i].A);
    --ms;
    i = j;
  }
  for (int i = 0; i < c2;) {
    int j = i;
    while (j < c2 && C2[i].A == C2[j].A) ++j;
    int ps = 0;
    for (int k = i; k < j; ++k) {
      P[ps++] = make_pair(C2[k].B1, +1);
      P[ps++] = make_pair(C2[k].B2, -1);
    }
    sort(P, P + ps);
    int prev = 0, s = 0, r = 0;
    sp2.push_back(vector<pair<int, int> >());
    for (int k = 0; k < ps; ++k) {
      if (s == 0) {
        sp2.back().push_back(make_pair(prev, P[k].first));
        r += P[k].first - prev;
      }
      s += P[k].second;
      prev = P[k].first;
    }
    sp2.back().push_back(make_pair(prev, n));
    r += n - prev;
    rem2.push_back(r);
    yy.push_back(C2[i].A);
    --ns;
    i = j;
  }
  unsigned X = 0;
  if (ms % 2 == 1) X ^= m;
  if (ns % 2 == 1) X ^= n;
  for (int i = 0; i < (int)rem1.size(); ++i) {
    X ^= rem1[i];
  }
  for (int i = 0; i < (int)rem2.size(); ++i) {
    X ^= rem2[i];
  }
  if (X == 0) {
    puts("SECOND");
  } else {
    puts("FIRST");
    if (ms > 0 && (unsigned)m > (unsigned)(m ^ X)) {
      int mx = 1;
      for (int i = 0; i < (int)xx.size(); ++i) {
        if (xx[i] == mx) {
          ++mx;
        }
      }
      int am = (unsigned)m - (unsigned)(m ^ X);
      printf("%d 0 %d %d\n", mx, mx, am);
      return 0;
    } else if (ns > 0 && (unsigned)n > (unsigned)(n ^ X)) {
      int ny = 1;
      for (int i = 0; i < (int)yy.size(); ++i) {
        if (yy[i] == ny) {
          ++ny;
        }
      }
      int am = (unsigned)n - (unsigned)(n ^ X);
      printf("0 %d %d %d\n", ny, am, ny);
      return 0;
    } else {
      for (int i = 0; i < (int)rem1.size(); ++i) {
        if ((unsigned)rem1[i] > (unsigned)(rem1[i] ^ X)) {
          int am = (unsigned)rem1[i] - (unsigned)(rem1[i] ^ X);
          int cur = 0;
          for (int j = 0; j < (int)sp1[i].size(); ++j) {
            int ss = sp1[i][j].second - sp1[i][j].first;
            if (cur + ss >= am) {
              int pt = am - cur + sp1[i][j].first;
              printf("%d 0 %d %d\n", xx[i], xx[i], pt);
              return 0;
            }
            cur += ss;
          }
        }
      }
      for (int i = 0; i < (int)rem2.size(); ++i) {
        if ((unsigned)rem2[i] > (unsigned)(rem2[i] ^ X)) {
          int am = (unsigned)rem2[i] - (unsigned)(rem2[i] ^ X);
          int cur = 0;
          for (int j = 0; j < (int)sp2[i].size(); ++j) {
            int ss = sp2[i][j].second - sp2[i][j].first;
            if (cur + ss >= am) {
              int pt = am - cur + sp2[i][j].first;
              printf("0 %d %d %d\n", yy[i], pt, yy[i]);
              return 0;
            }
            cur += ss;
          }
        }
      }
    }
  }
  return 0;
}