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;
#pragma comment(linker, "/STACK:100000000")
int xb[100500], xe[100500], yb[100500], ye[100500];
vector<int> indv, indh;
set<pair<int, int> > H, V;
vector<pair<int, int> > h, v, ev;
bool cmph(int i, int j) { return yb[i] < yb[j]; }
bool cmpv(int i, int j) { return xb[i] < xb[j]; }
int main() {
  int i, j;
  int n, m, k;
  scanf("%d%d%d", &n, &m, &k);
  int g = 0;
  if (n % 2 == 0) g ^= m;
  if (m % 2 == 0) g ^= n;
  for (i = 0; i < k; ++i) {
    scanf("%d%d%d%d\n", &xb[i], &yb[i], &xe[i], &ye[i]);
    if (xb[i] > xe[i]) swap(xb[i], xe[i]);
    if (yb[i] > ye[i]) swap(yb[i], ye[i]);
    if (xb[i] == xe[i]) {
      indv.push_back(i);
      V.insert(make_pair(yb[i], i));
    } else {
      indh.push_back(i);
      H.insert(make_pair(xb[i], i));
    }
  }
  sort(indv.begin(), indv.end(), cmpv);
  for (i = 0; i < indv.size();) {
    ev.clear();
    for (j = i; j < indv.size() && xb[indv[j]] == xb[indv[i]]; ++j) {
      ev.push_back(make_pair(yb[indv[j]], 0));
      ev.push_back(make_pair(ye[indv[j]], 1));
    }
    i = j;
    sort(ev.begin(), ev.end());
    int st;
    int cnt = 0;
    int stones = m;
    for (j = 0; j < ev.size(); ++j) {
      if (ev[j].second == 0) {
        if (cnt == 0) st = ev[j].first;
        cnt++;
      } else {
        cnt--;
        if (cnt == 0) {
          stones -= (ev[j].first - st);
        }
      }
    }
    v.push_back(make_pair(stones, xb[indv[i - 1]]));
    g ^= (stones ^ m);
  }
  sort(indh.begin(), indh.end(), cmph);
  for (i = 0; i < indh.size();) {
    ev.clear();
    for (j = i; j < indh.size() && yb[indh[j]] == yb[indh[i]]; ++j) {
      ev.push_back(make_pair(xb[indh[j]], 0));
      ev.push_back(make_pair(xe[indh[j]], 1));
    }
    i = j;
    sort(ev.begin(), ev.end());
    int st;
    int cnt = 0;
    int stones = n;
    for (j = 0; j < ev.size(); ++j) {
      if (ev[j].second == 0) {
        if (cnt == 0) st = ev[j].first;
        cnt++;
      } else {
        cnt--;
        if (cnt == 0) {
          stones -= (ev[j].first - st);
        }
      }
    }
    h.push_back(make_pair(stones, yb[indh[i - 1]]));
    g ^= (stones ^ n);
  }
  if (g == 0) {
    printf("SECOND\n");
    return 0;
  }
  int g1 = g;
  while (((g1 - 1) & g1) > 0) {
    g1 = ((g1 - 1) & g1);
  }
  printf("FIRST\n");
  for (i = 0; i < v.size(); ++i)
    if ((g1 & v[i].first) != 0) {
      int cnt = v[i].first - (g ^ v[i].first);
      int x = 0;
      while (!V.empty()) {
        int seg = V.begin()->second;
        V.erase(V.begin());
        if (ye[seg] <= x || xb[seg] != v[i].second) continue;
        if (yb[seg] > x) {
          if (cnt - (yb[seg] - x) > 0) {
            cnt -= (yb[seg] - x);
            x = ye[seg];
          } else {
            break;
          }
        } else {
          x = ye[seg];
        }
      }
      x += cnt;
      printf("%d %d %d %d\n", v[i].second, 0, v[i].second, x);
      return 0;
    }
  for (i = 0; i < h.size(); ++i)
    if ((g1 & h[i].first) != 0) {
      int cnt = h[i].first - (g ^ h[i].first);
      int x = 0;
      while (!H.empty()) {
        int seg = H.begin()->second;
        H.erase(H.begin());
        if (xe[seg] <= x || yb[seg] != h[i].second) continue;
        if (xb[seg] > x) {
          if (cnt - (xb[seg] - x) > 0) {
            cnt -= (xb[seg] - x);
            x = xe[seg];
          } else {
            break;
          }
        } else {
          x = xe[seg];
        }
      }
      x += cnt;
      printf("%d %d %d %d\n", 0, h[i].second, x, h[i].second);
      return 0;
    }
  int lst = 0;
  v.push_back(make_pair(m, n));
  for (i = 0; i < v.size(); ++i) {
    if (v[i].second - lst > 1) {
      if ((g1 & m) != 0) {
        printf("%d %d %d %d\n", lst + 1, 0, lst + 1, m - (g ^ m));
        return 0;
      }
      break;
    }
    lst = v[i].second;
  }
  lst = 0;
  h.push_back(make_pair(m, m));
  for (i = 0; i < h.size(); ++i) {
    if (h[i].second - lst > 1) {
      if ((g1 & n) != 0) {
        printf("%d %d %d %d\n", 0, lst + 1, n - (g ^ n), lst + 1);
        return 0;
      }
      break;
    }
    lst = h[i].second;
  }
  return 0;
}