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 xb[100005], xe[100005], yb[100005], ye[100005];
map<int, vector<pair<int, int> > > mpx, mpy;
map<int, vector<pair<int, int> > >::iterator it;
pair<int, int> pr;
int main() {
  int n, m, i, j, k, l, f = 0;
  scanf("%d", &n);
  scanf("%d", &m);
  scanf("%d", &k);
  for (i = 1; i <= (k); i++) {
    scanf("%d", &xb[i]);
    scanf("%d", &yb[i]);
    scanf("%d", &xe[i]);
    scanf("%d", &ye[i]);
    if (xb[i] == xe[i]) {
      if (xb[i] == 0 || xb[i] == n) continue;
      pr.first = min(yb[i], ye[i]);
      pr.second = max(yb[i], ye[i]);
      mpx[xb[i]].push_back(pr);
    } else {
      if (yb[i] == 0 || yb[i] == m) continue;
      pr.first = min(xb[i], xe[i]);
      pr.second = max(xb[i], xe[i]);
      mpy[yb[i]].push_back(pr);
    }
  }
  int ans = 0, b, e;
  int totr = n - 1 - mpx.size();
  int totc = m - 1 - mpy.size();
  for (it = mpx.begin(); it != mpx.end(); it++) {
    sort(it->second.begin(), it->second.end());
    b = it->second[0].first;
    e = it->second[0].second;
    k = m;
    for (i = 1; i < it->second.size(); i++) {
      if (it->second[i].first >= e) {
        k = k - (e - b);
        b = it->second[i].first;
        e = it->second[i].second;
      } else if (it->second[i].second >= e) {
        e = it->second[i].second;
      }
    }
    k = k - (e - b);
    ans = ans ^ k;
  }
  if (totr & 1) ans = ans ^ m;
  for (it = mpy.begin(); it != mpy.end(); it++) {
    sort(it->second.begin(), it->second.end());
    b = it->second[0].first;
    e = it->second[0].second;
    k = n;
    for (i = 1; i < it->second.size(); i++) {
      if (it->second[i].first >= e) {
        k = k - (e - b);
        b = it->second[i].first;
        e = it->second[i].second;
      } else if (it->second[i].second >= e) {
        e = it->second[i].second;
      }
    }
    k = k - (e - b);
    ans = ans ^ k;
  }
  if (totc & 1) ans = ans ^ n;
  if (ans == 0) {
    printf("SECOND");
    return 0;
  }
  i = ans / 2;
  j = 1;
  while (i) {
    i = i / 2;
    j = j * 2;
  }
  printf("FIRST\n");
  if (totr > 0) {
    i = 1;
    while (1) {
      if (mpx[i].size() == 0) {
        mpx[i].push_back(make_pair(m, m));
        break;
      }
      i++;
    }
  }
  if (totc > 0) {
    i = 1;
    while (1) {
      if (mpy[i].size() == 0) {
        mpy[i].push_back(make_pair(n, n));
        break;
      }
      i++;
    }
  }
  for (it = mpx.begin(); it != mpx.end(); it++) {
    sort(it->second.begin(), it->second.end());
    b = it->second[0].first;
    e = it->second[0].second;
    k = m;
    for (i = 1; i < it->second.size(); i++) {
      if (it->second[i].first >= e) {
        k = k - (e - b);
        b = it->second[i].first;
        e = it->second[i].second;
      } else if (it->second[i].second >= e) {
        e = it->second[i].second;
      }
    }
    k = k - (e - b);
    if (k & j) {
      f = 1;
      k = ans ^ k;
      b = it->second[0].first;
      e = it->second[0].second;
      if (k <= b) {
        printf("%d %d %d %d", it->first, k, it->first, m);
        return 0;
      }
      k = k - b;
      for (i = 1; i < it->second.size(); i++) {
        if (it->second[i].first >= e) {
          k = k - (it->second[i].first - e);
          if (k <= 0) {
            printf("%d %d %d %d", it->first, it->second[i].first + k, it->first,
                   m);
            return 0;
          }
          b = it->second[i].first;
          e = it->second[i].second;
        } else if (it->second[i].second >= e) {
          e = it->second[i].second;
        }
      }
      k = k - (m - e);
      printf("%d %d %d %d", it->first, m + k, it->first, m);
      return 0;
    }
  }
  for (it = mpy.begin(); it != mpy.end(); it++) {
    sort(it->second.begin(), it->second.end());
    b = it->second[0].first;
    e = it->second[0].second;
    k = n;
    for (i = 1; i < it->second.size(); i++) {
      if (it->second[i].first >= e) {
        k = k - (e - b);
        b = it->second[i].first;
        e = it->second[i].second;
      } else if (it->second[i].second >= e) {
        e = it->second[i].second;
      }
    }
    k = k - (e - b);
    if (k & j) {
      f = 1;
      k = ans ^ k;
      b = it->second[0].first;
      e = it->second[0].second;
      if (k <= b) {
        printf("%d %d %d %d", k, it->first, n, it->first);
        return 0;
      }
      k = k - b;
      for (i = 1; i < it->second.size(); i++) {
        if (it->second[i].first >= e) {
          k = k - (it->second[i].first - e);
          if (k <= 0) {
            printf("%d %d %d %d", it->second[i].first + k, it->first, n,
                   it->first);
            return 0;
          }
          b = it->second[i].first;
          e = it->second[i].second;
        } else if (it->second[i].second >= e) {
          e = it->second[i].second;
        }
      }
      k = k - (n - e);
      printf("%d %d %d %d", n + k, it->first, n, it->first);
      return 0;
    }
  }
  return 0;
}