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;
map<int, int> mpx;
map<int, int> mpy;
map<int, int> rmpx;
map<int, int> rmpy;
map<int, int>::iterator it;
vector<vector<pair<int, int> > > Y, X;
vector<int> reX, reY;
vector<pair<int, int> > RES;
int inter(vector<pair<int, int> > v, int n) {
  int cnt = 0;
  for (int i = 0; i < (int)v.size(); i++) {
    if (i + 1 < v.size() && v[i].second >= v[i + 1].first) {
      v[i + 1].second = max(v[i + 1].second, v[i].second);
      v[i].second = v[i + 1].first - 1;
      if (v[i].second >= v[i].first) v[i + 1].first--;
    }
    cnt += max(0, v[i].second - v[i].first);
  }
  assert(n - cnt >= 0);
  return n - cnt;
}
vector<int> Xor;
void bilud(int n) {
  while (n) {
    Xor.push_back((n & 1));
    n >>= 1;
  }
  reverse(Xor.begin(), Xor.end());
}
int must_remove(int cur) {
  int n = (int)Xor.size();
  int must = (1 << (n - 1));
  if (must & cur) {
    vector<int> bits;
    int temp = cur;
    while (temp) {
      bits.push_back((temp & 1));
      temp >>= 1;
    }
    reverse(bits.begin(), bits.end());
    for (int i = n - 1, j = bits.size() - 1; i >= 0; j--, i--) {
      if (Xor[i]) {
        bits[j] ^= 1;
      }
    }
    temp = 0;
    for (int i = (int)bits.size() - 1, j = 0; i >= 0; i--, j++) {
      temp += (bits[i] * (1 << j));
    }
    return cur - temp;
  }
  return -1;
}
bool valid(int s, int m, int e, int Z) {
  pair<int, int> p(s, m);
  RES.push_back(p);
  sort(RES.begin(), RES.end());
  int ret = inter(RES, e);
  for (int i = 0; i < RES.size(); i++) {
    if (RES[i] == p) {
      swap(RES[i], RES.back());
      RES.pop_back();
      break;
    }
  }
  return ret >= Z;
}
int BS(int s, int e, int Z) {
  int S = s, E = e;
  while (s < e) {
    int mid = s + (e - s + 1) / 2;
    if (valid(S, mid, E, Z)) {
      s = mid;
    } else {
      e = mid - 1;
    }
  }
  return s;
}
int main() {
  int n, m, k;
  int xb, yb, xe, ye;
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 0; i < k; i++) {
    scanf("%d%d%d%d", &xb, &yb, &xe, &ye);
    if (xb == xe) {
      if (yb > ye) {
        swap(yb, ye);
      }
      if (xb == 0 || xb == n) continue;
      it = mpx.find(xb);
      if (it == mpx.end()) {
        mpx[xb] = X.size();
        rmpx[X.size()] = xb;
        X.push_back(vector<pair<int, int> >());
      }
      it = mpx.find(xb);
      X[(it->second)].push_back({yb, ye});
    } else {
      if (xb > xe) {
        swap(xb, xe);
      }
      if (yb == 0 || yb == m) continue;
      it = mpy.find(yb);
      if (it == mpy.end()) {
        mpy[yb] = Y.size();
        rmpy[Y.size()] = yb;
        Y.push_back(vector<pair<int, int> >());
      }
      it = mpy.find(yb);
      Y[(it->second)].push_back({xb, xe});
    }
  }
  int retx = (n - 1) - mpx.size();
  int rety = (m - 1) - mpy.size();
  int res = (retx & 1) ? m : 0;
  for (int i = 0; i < X.size(); i++) {
    sort(X[i].begin(), X[i].end());
    reX.push_back(inter(X[i], m));
    res ^= reX.back();
  }
  res ^= (rety & 1) ? n : 0;
  for (int i = 0; i < Y.size(); i++) {
    sort(Y[i].begin(), Y[i].end());
    reY.push_back(inter(Y[i], n));
    res ^= reY.back();
  }
  if (res) {
    puts("FIRST");
    bilud(res);
    for (int i = 0; i < (int)reX.size(); i++) {
      int found = (must_remove(reX[i]));
      if (found && found != -1) {
        RES = X[i];
        assert(reX[i] - found >= 0);
        cout << rmpx[i] << " " << 0 << " " << rmpx[i] << " "
             << BS(0, m, reX[i] - found);
        return 0;
      }
    }
    for (int i = 0; i < (int)reY.size(); i++) {
      int found = (must_remove(reY[i]));
      if (found != -1) {
        RES = Y[i];
        cout << 0 << " " << rmpy[i] << " " << BS(0, n, reY[i] - found) << " "
             << rmpy[i];
        return 0;
      }
    }
    int found = (must_remove(m));
    if (retx && found != -1) {
      for (int i = 1; i < n; i++) {
        it = mpx.find(i);
        if (it == mpx.end()) {
          cout << i << " " << 0 << " " << i << " " << found;
          return 0;
        }
      }
    }
    found = (must_remove(n));
    if (rety && found != -1) {
      for (int i = 1; i < m; i++) {
        it = mpy.find(i);
        if (it == mpy.end()) {
          cout << 0 << " " << i << " " << found << " " << i;
          return 0;
        }
      }
    }
  } else {
    puts("SECOND");
  }
}