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> > > v, v1, v2;
bool used1[110000];
bool used2[110000];
vector<pair<int, pair<int, int> > > mem;
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  for (int i = 0; i < k; i++) {
    int x1, x2, x3, x4;
    cin >> x1 >> x2 >> x3 >> x4;
    if (x1 > x3) swap(x1, x3);
    if (x2 > x4) swap(x2, x4);
    if (x1 == x3)
      v1.push_back(make_pair(x1, make_pair(x2, x4)));
    else
      v2.push_back(make_pair(x2, make_pair(x1, x3)));
  }
  sort(v1.begin(), v1.end());
  sort(v2.begin(), v2.end());
  int cnt1 = 0;
  int cnt2 = 0;
  for (int i = 0; i < min(110000, m); i++) used1[i] = false;
  for (int i = 0; i < min(110000, n); i++) used2[i] = false;
  int ans = 0;
  for (int ii = 0; ii < 2; ii++) {
    if (ii == 0)
      v = v1;
    else
      v = v2;
    int r = -1;
    int sum = 0;
    v.push_back(make_pair(-1, make_pair(-1, -1)));
    for (int i = 0; i < v.size(); i++) {
      if (ii == 0 && v[i].first != -1 && v[i].first < 110000)
        used1[v[i].first] = true;
      if (ii == 1 && v[i].first != -1 && v[i].first < 110000)
        used2[v[i].first] = true;
      if (i > 0 && v[i].first != v[i - 1].first) {
        if (ii == 0)
          cnt2++;
        else
          cnt1++;
        if (ii == 0)
          ans ^= (m - sum);
        else
          ans ^= (n - sum);
        if (ii == 0)
          mem.push_back(make_pair(m - sum, make_pair(ii, v[i - 1].first)));
        else
          mem.push_back(make_pair(n - sum, make_pair(ii, v[i - 1].first)));
        r = -1;
        sum = 0;
      }
      if (v[i].second.first > r) {
        sum += v[i].second.second - v[i].second.first;
        r = v[i].second.second;
      } else if (v[i].second.second > r) {
        sum += v[i].second.second - r;
        r = v[i].second.second;
      }
    }
  }
  if ((m - cnt1 - 1) % 2 == 1) ans ^= (n);
  if ((n - cnt2 - 1) % 2 == 1) ans ^= (m);
  for (int i = 1; i < min(110000, n); i++)
    if (!used1[i]) {
      mem.push_back(make_pair(m, make_pair(0, i)));
      break;
    }
  for (int i = 1; i < min(110000, m); i++)
    if (!used2[i]) {
      mem.push_back(make_pair(n, make_pair(1, i)));
      break;
    }
  if (ans == 0)
    cout << "SECOND";
  else {
    cout << "FIRST\n";
    for (int i = 0; i < mem.size(); i++) {
      if (mem[i].first >= (mem[i].first ^ ans)) {
        if (mem[i].second.first == 0) {
          cout << mem[i].second.second << " 0 " << mem[i].second.second << " ";
          int l = 0;
          int sum = 0;
          for (int j = 0; j < v1.size(); j++)
            if (v1[j].first == mem[i].second.second) {
              if (v1[j].second.first >= l) sum += (v1[j].second.first - l);
              l = max(l, v1[j].second.second);
              if (sum >= (mem[i].first - (mem[i].first ^ ans))) {
                cout << v1[j].second.first -
                            (sum - (mem[i].first - (mem[i].first ^ ans)));
                return 0;
              }
            }
          cout << (mem[i].first - (mem[i].first ^ ans)) - sum + l;
          return 0;
          cout << "\n";
        } else {
          cout << "0 " << mem[i].second.second << " ";
          int l = 0;
          int sum = 0;
          for (int j = 0; j < v2.size(); j++)
            if (v2[j].first == mem[i].second.second) {
              if (v2[j].second.first >= l) sum += (v2[j].second.first - l);
              l = max(l, v2[j].second.second);
              if (sum >= (mem[i].first - (mem[i].first ^ ans))) {
                cout << v2[j].second.first -
                            (sum - (mem[i].first - (mem[i].first ^ ans)))
                     << " " << mem[i].second.second;
                return 0;
              }
            }
          cout << (mem[i].first - (mem[i].first ^ ans)) - sum + l << " "
               << mem[i].second.second;
          return 0;
          cout << "\n";
        }
      }
    }
  }
  return 0;
}