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;
template <class T>
T sqr(T x) {
  return x * x;
}
const int INF = 1000 * 1000 * 1000;
const long long INF64 = sqr(static_cast<long long>(INF));
const double PI = acos(-1.0);
const int K = 200500;
long long n, m;
long long mex;
int k, a, b, c;
pair<long long, pair<long long, long long> > h[K], v[K];
pair<long long, long long> w[2 * K];
map<int, int> H, V;
int main() {
  cin >> n >> m >> k;
  if (m % 2 == 0) mex = mex ^ n;
  if (n % 2 == 0) mex = mex ^ m;
  for (int i = 0; i < k; ++i) {
    int bx, by, ex, ey;
    scanf("%d %d %d %d", &by, &bx, &ey, &ex);
    if (bx > ex) swap(bx, ex);
    if (by > ey) swap(by, ey);
    if (bx == ex)
      v[a++] = make_pair((long long)(bx),
                         make_pair((long long)(by), (long long)(ey)));
    else
      h[b++] = make_pair((long long)(by),
                         make_pair((long long)(bx), (long long)(ex)));
  }
  for (int i = 1; i < n && i < 100500; ++i)
    h[b++] =
        make_pair((long long)(i), make_pair((long long)(1), (long long)(1)));
  for (int i = 1; i < m && i < 100500; ++i)
    v[a++] =
        make_pair((long long)(i), make_pair((long long)(1), (long long)(1)));
  sort(v, v + a);
  sort(h, h + b);
  for (int i = 0; i < a;) {
    int j = i + 1;
    while (j < a && v[j].first == v[i].first) ++j;
    int c = 0;
    for (int p = i; p < j; ++p) {
      w[c++] = make_pair(v[p].second.first, 1);
      w[c++] = make_pair(v[p].second.second, 0);
    }
    w[c++] = make_pair(n, 0);
    sort(w, w + c);
    int cnt = 0;
    for (int p = 0, prev = 0, balance = 0; p < c; ++p) {
      if (balance <= 0) cnt += w[p].first - prev;
      if (w[p].second)
        ++balance;
      else
        --balance;
      prev = w[p].first;
    }
    V[v[i].first] = cnt;
    i = j;
  }
  for (int i = 0; i < b;) {
    int j = i + 1;
    while (j < b && h[j].first == h[i].first) ++j;
    int c = 0;
    for (int p = i; p < j; ++p) {
      w[c++] = make_pair(h[p].second.first, 1);
      w[c++] = make_pair(h[p].second.second, 0);
    }
    w[c++] = make_pair(m, 0);
    sort(w, w + c);
    int cnt = 0;
    for (int p = 0, prev = 0, balance = 0; p < c; ++p) {
      if (balance <= 0) cnt += w[p].first - prev;
      if (w[p].second)
        ++balance;
      else
        --balance;
      prev = w[p].first;
    }
    H[h[i].first] = cnt;
    i = j;
  }
  int VV = -1, HH = -1;
  int q = 1;
  for (map<int, int>::const_iterator it = V.begin(); it != V.end(); ++it) {
    if (q != -1) {
      if (it->first == q)
        ++q;
      else {
        VV = q;
        q = -1;
      }
    }
    mex = mex ^ n ^ it->second;
  }
  if (q != -1 && q < m) VV = q;
  q = 1;
  for (map<int, int>::const_iterator it = H.begin(); it != H.end(); ++it) {
    if (q != -1) {
      if (it->first == q)
        ++q;
      else {
        HH = q;
        q = -1;
      }
    }
    mex = mex ^ m ^ it->second;
  }
  if (q != -1 && q < n) HH = q;
  if (VV != -1) V[VV] = n;
  if (HH != -1) H[HH] = m;
  if (mex == 0) {
    cout << "SECOND" << endl;
    return 0;
  }
  cout << "FIRST" << endl;
  for (map<int, int>::const_iterator it = V.begin(); it != V.end(); ++it) {
    int CNT = it->second;
    if ((mex ^ CNT) <= CNT) {
      int x = CNT - (mex ^ CNT);
      for (int i = 0; i < a; ++i) {
        if (v[i].first < it->first) continue;
        int j = i + 1;
        while (j < a && v[j].first == v[i].first) ++j;
        int c = 0;
        for (int p = i; p < j; ++p) {
          w[c++] = make_pair(v[p].second.first, 1);
          w[c++] = make_pair(v[p].second.second, 0);
        }
        w[c++] = make_pair(n, 0);
        sort(w, w + c);
        int cnt = 0;
        for (int p = 0, prev = 0, balance = 0; p < c; ++p) {
          if (balance <= 0) {
            cnt += w[p].first - prev;
            if (cnt >= x) {
              cout << "0 " << it->first << " " << w[p].first - (cnt - x) << " "
                   << it->first << endl;
              return 0;
            }
          }
          if (w[p].second)
            ++balance;
          else
            --balance;
          prev = w[p].first;
        }
        break;
      }
    }
  }
  for (map<int, int>::const_iterator it = H.begin(); it != H.end(); ++it) {
    int CNT = it->second;
    if ((mex ^ CNT) <= CNT) {
      int x = CNT - (mex ^ CNT);
      for (int i = 0; i < b; ++i) {
        if (h[i].first < it->first) continue;
        int j = i + 1;
        while (j < b && h[j].first == h[i].first) ++j;
        int c = 0;
        for (int p = i; p < j; ++p) {
          w[c++] = make_pair(h[p].second.first, 1);
          w[c++] = make_pair(h[p].second.second, 0);
        }
        w[c++] = make_pair(m, 0);
        sort(w, w + c);
        int cnt = 0;
        for (int p = 0, prev = 0, balance = 0; p < c; ++p) {
          if (balance <= 0) {
            cnt += w[p].first - prev;
            if (cnt >= x) {
              cout << it->first << " 0 " << it->first << " "
                   << w[p].first - (cnt - x) << endl;
              return 0;
            }
          }
          if (w[p].second)
            ++balance;
          else
            --balance;
          prev = w[p].first;
        }
        break;
      }
    }
  }
  return 0;
}