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;
int func(vector<pair<int, int> > cuts, int l) {
  vector<pair<int, int> > sweep;
  int at = 0;
  int sum = 0;
  int qtd = 0;
  for (int i = 0; i < cuts.size(); i++) {
    sweep.push_back(make_pair(cuts[i].first, 1));
    sweep.push_back(make_pair(cuts[i].second, -1));
  }
  sort(sweep.begin(), sweep.end());
  for (int i = 0; i < sweep.size(); i++) {
    if (qtd == 0) sum += (sweep[i].first - at);
    qtd += sweep[i].second;
    at = sweep[i].first;
  }
  sum += (l - at);
  return sum;
}
int func2(vector<pair<int, int> > cuts, int l, int lim) {
  int pos = 0;
  vector<pair<int, int> > sweep;
  int at = 0;
  int sum = 0;
  int qtd = 0;
  for (int i = 0; i < cuts.size(); i++) {
    sweep.push_back(make_pair(cuts[i].first, 1));
    sweep.push_back(make_pair(cuts[i].second, -1));
  }
  sort(sweep.begin(), sweep.end());
  for (int i = 0; i < sweep.size(); i++) {
    if (qtd == 0) sum += (sweep[i].first - at);
    if (sum >= lim) {
      int qtd = sum - lim;
      return sweep[i].first - qtd;
    }
    qtd += sweep[i].second;
    at = sweep[i].first;
  }
  sum += (l - at);
  if (sum >= lim) {
    int qtd = sum - lim;
    return l - qtd;
  }
  return -1;
}
int main() {
  int n, m, k;
  scanf("%d %d %d", &n, &m, &k);
  map<int, vector<pair<int, int> > > mx, my;
  set<int> sty, stx;
  for (int i = 0; i < k; i++) {
    pair<int, int> p1, p2;
    scanf("%d %d %d %d", &p1.first, &p1.second, &p2.first, &p2.second);
    if (p1 > p2) swap(p1, p2);
    if (p1.first == p2.first) {
      stx.insert(p1.first);
      mx[p1.first].push_back(make_pair(p1.second, p2.second));
    } else {
      sty.insert(p2.second);
      my[p1.second].push_back(make_pair(p1.first, p2.first));
    }
  }
  int game = 0;
  if ((m - 1 - sty.size()) & 1) game = n;
  if ((n - 1 - stx.size()) & 1) game ^= m;
  for (set<int>::iterator it = sty.begin(); it != sty.end(); it++) {
    int qtd = func(my[*it], n);
    game ^= qtd;
  }
  for (set<int>::iterator it = stx.begin(); it != stx.end(); it++) {
    int qtd = func(mx[*it], m);
    game ^= qtd;
  }
  if (game) {
    printf("FIRST\n");
    if ((m - 1 - sty.size()) != 0 && (game ^ n) <= n) {
      int at = 0;
      sty.insert(m);
      for (set<int>::iterator it = sty.begin(); it != sty.end(); it++) {
        if (*it - at > 1) {
          printf("0 %d %d %d\n", at + 1, n - (game ^ n), at + 1);
          break;
        }
        at = *it;
      }
    } else if ((n - 1 - stx.size()) != 0 && (game ^ m) <= m) {
      int at = 0;
      stx.insert(n);
      for (set<int>::iterator it = stx.begin(); it != stx.end(); it++) {
        if (*it - at > 1) {
          printf("%d 0 %d %d\n", at + 1, at + 1, m - (game ^ m));
          break;
        }
        at = *it;
      }
    } else {
      bool ok = false;
      for (set<int>::iterator it = sty.begin(); it != sty.end(); it++) {
        int qtd = func(my[*it], n);
        if ((game ^ qtd) <= qtd) {
          int pos = func2(my[*it], n, qtd - (game ^ qtd));
          printf("0 %d %d %d\n", *it, pos, *it);
          ok = true;
          break;
        }
      }
      for (set<int>::iterator it = stx.begin(); it != stx.end() && !ok; it++) {
        int qtd = func(mx[*it], m);
        if ((game ^ qtd) <= qtd) {
          int pos = func2(mx[*it], m, qtd - (game ^ qtd));
          printf("%d 0 %d %d\n", *it, *it, pos);
          break;
        }
      }
    }
  } else
    printf("SECOND\n");
  return 0;
}