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 maxn = 100007;
struct hor {
  int x, y1, y2;
} a[maxn];
struct ver {
  int y, x1, x2;
} b[maxn];
int m, n, k, c1, c2, d1, d2;
vector<pair<int, int> > list_hor[maxn];
int x_hor[maxn], y_ver[maxn], sum_hor[maxn], sum_ver[maxn];
vector<pair<int, int> > list_ver[maxn];
bool cmp1(const hor &a, const hor &b) {
  return a.x < b.x || (a.x == b.x && a.y1 < b.y1);
}
bool cmp2(const ver &a, const ver &b) {
  return a.y < b.y || (a.y == b.y && a.x1 < b.x1);
}
int find_x() {
  int x = 1;
  for (int i = 1, _c = d1; i <= _c; i++)
    if (x_hor[i] == x)
      x++;
    else if (x_hor[i] > x)
      return x;
  return x;
}
int find_y() {
  int y = 1;
  for (int i = 1, _c = d2; i <= _c; i++)
    if (y_ver[i] == y)
      y++;
    else if (y_ver[i] > y)
      return y;
  return y;
}
int find_x2(int bit) {
  for (int i = 1, _c = d1; i <= _c; i++)
    if (sum_hor[i] >= bit) return x_hor[i];
  return -1;
}
int find_y2(int bit) {
  for (int i = 1, _c = d2; i <= _c; i++)
    if (sum_ver[i] >= bit) return y_ver[i];
  return -1;
}
int main() {
  scanf("%d%d%d", &m, &n, &k);
  c1 = c2 = 0;
  int x1, y1, x2, y2;
  for (int i = 1, _c = k; i <= _c; i++) {
    scanf("%d%d%d%d", &x1, &y1, &x2, &y2);
    if (x1 == x2) {
      a[++c1].x = x1;
      a[c1].y1 = min(y1, y2);
      a[c1].y2 = max(y1, y2);
    } else {
      b[++c2].y = y1;
      b[c2].x1 = min(x1, x2);
      b[c2].x2 = max(x1, x2);
    }
  }
  sort(a + 1, a + c1 + 1, cmp1);
  sort(b + 1, b + c2 + 1, cmp2);
  d1 = d2 = 0;
  int i, j, maxval;
  i = 1;
  while (i <= c1) {
    j = i;
    while (j < c1 && a[j + 1].x == a[i].x) j++;
    d1++;
    x_hor[d1] = a[i].x;
    sum_hor[d1] = 0;
    maxval = 0;
    for (int it = i, _c = j; it <= _c; it++) {
      if (maxval < a[it].y1) {
        list_hor[d1].push_back(pair<int, int>(maxval, a[it].y1));
        sum_hor[d1] += a[it].y1 - maxval;
      }
      maxval = max(maxval, a[it].y2);
    }
    if (maxval < n) {
      list_hor[d1].push_back(pair<int, int>(maxval, n));
      sum_hor[d1] += n - maxval;
    }
    i = j + 1;
  }
  i = 1;
  while (i <= c2) {
    j = i;
    while (j < c2 && b[j + 1].y == b[i].y) j++;
    d2++;
    sum_ver[d2] = 0;
    y_ver[d2] = b[i].y;
    maxval = 0;
    for (int it = i, _c = j; it <= _c; it++) {
      if (maxval < b[it].x1) {
        list_ver[d2].push_back(pair<int, int>(maxval, b[it].x1));
        sum_ver[d2] += b[it].x1 - maxval;
      }
      maxval = max(maxval, b[it].x2);
    }
    if (maxval < m) {
      list_ver[d2].push_back(pair<int, int>(maxval, m));
      sum_ver[d2] += m - maxval;
    }
    i = j + 1;
  }
  int bit = 0;
  if (m - 1 > d1 && (m - 1 - d1) % 2 == 1) bit ^= n;
  if (n - 1 > d2 && (n - 1 - d2) % 2 == 1) bit ^= m;
  for (int i = 1, _c = d1; i <= _c; i++) bit ^= sum_hor[i];
  for (int i = 1, _c = d2; i <= _c; i++) bit ^= sum_ver[i];
  if (bit) {
    puts("FIRST");
    int bit2, tmp, xi, yi;
    if (m - 1 > d1 && (n ^ bit) <= n) {
      bit2 = n - (bit ^ n);
      int x = find_x();
      printf("%d %d %d %d\n", x, 0, x, bit2);
    } else if (n - 1 > d2 && (m ^ bit) <= m) {
      bit2 = m - (bit ^ m);
      int y = find_y();
      printf("%d %d %d %d\n", 0, y, bit2, y);
    } else {
      for (int it = 1, _c = d1; it <= _c; it++)
        if ((bit ^ sum_hor[it]) <= sum_hor[it]) {
          bit2 = sum_hor[it] - (bit ^ sum_hor[it]);
          xi = it;
          i = 0;
          tmp = list_hor[xi][i].second - list_hor[xi][i].first;
          while (tmp < bit2) {
            i++;
            tmp += list_hor[xi][i].second - list_hor[xi][i].first;
          }
          printf("%d %d %d %d\n", x_hor[xi], 0, x_hor[xi],
                 list_hor[xi][i].second - (tmp - bit2));
          return 0;
        }
      for (int it = 1, _c = d2; it <= _c; it++)
        if ((bit ^ sum_ver[it]) <= sum_ver[it]) {
          bit2 = sum_ver[it] - (bit ^ sum_ver[it]);
          yi = it;
          i = 0;
          tmp = list_ver[yi][i].second - list_ver[yi][i].first;
          while (tmp < bit2) {
            i++;
            tmp += list_ver[yi][i].second - list_ver[yi][i].first;
          }
          printf("%d %d %d %d\n", 0, y_ver[yi],
                 list_ver[yi][i].second - (tmp - bit2), y_ver[yi]);
        }
    }
  } else
    puts("SECOND");
  return 0;
}