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;
struct p {
  int start;
  int end;
};
bool operator<(p a, p b) { return a.start < b.start; }
int N, M, K;
map<int, int> vx;
map<int, int> hy;
int revmv[100000];
int revmh[100000];
vector<p> vcuts[100000];
vector<p> hcuts[100000];
int main() {
  cin >> N >> M >> K;
  int vind = 0, hind = 0;
  for (int i = 0; i < K; i++) {
    int a, b, c, d;
    cin >> a >> b >> c >> d;
    if (a == c) {
      if (b > d) {
        b ^= d;
        d ^= b;
        b ^= d;
      }
      if (vx.find(a) == vx.end()) {
        vx[a] = vind;
        revmv[vind] = a;
        vind++;
      }
      p j = {b, d};
      vcuts[vx[a]].push_back(j);
    }
    if (b == d) {
      if (a > c) {
        a ^= c;
        c ^= a;
        a ^= c;
      }
      if (hy.find(b) == hy.end()) {
        hy[b] = hind;
        revmh[hind] = b;
        hind++;
      }
      p j = {a, c};
      hcuts[hy[b]].push_back(j);
    }
  }
  int v[vind], h[hind];
  for (int i = 0; i < vind; i++) {
    sort(vcuts[i].begin(), vcuts[i].end());
    v[i] = M;
  }
  for (int i = 0; i < hind; i++) {
    sort(hcuts[i].begin(), hcuts[i].end());
    h[i] = N;
  }
  int s, e;
  for (int i = 0; i < vind; i++) {
    s = vcuts[i][0].start;
    e = vcuts[i][0].end;
    for (vector<p>::iterator it = vcuts[i].begin() + 1; it < vcuts[i].end();
         it++) {
      if (it->start > e) {
        v[i] -= e - s;
        s = it->start;
        e = it->end;
      } else if (it->end > e) {
        e = it->end;
      }
    }
    v[i] -= e - s;
  }
  for (int i = 0; i < hind; i++) {
    s = hcuts[i][0].start;
    e = hcuts[i][0].end;
    for (vector<p>::iterator it = hcuts[i].begin() + 1; it < hcuts[i].end();
         it++) {
      if (it->start > e) {
        h[i] -= e - s;
        s = it->start;
        e = it->end;
      } else if (it->end > e) {
        e = it->end;
      }
    }
    h[i] -= e - s;
  }
  int nimsum = 0;
  for (int i = 0; i < vind; i++) {
    nimsum ^= v[i];
  }
  for (int i = 0; i < hind; i++) {
    nimsum ^= h[i];
  }
  if ((N - 1 - vind) % 2 != 0) {
    nimsum ^= M;
  }
  if ((M - 1 - hind) % 2 != 0) {
    nimsum ^= N;
  }
  if (nimsum == 0) {
    cout << "SECOND";
    return 0;
  }
  cout << "FIRST\n";
  for (int i = 0; i < vind; i++) {
    if ((v[i] ^ nimsum) < v[i]) {
      if (v[i] == nimsum) {
        cout << revmv[i] << " 0 " << revmv[i] << " " << M;
        return 0;
      }
      s = 0;
      e = 0;
      int tot = 0;
      for (vector<p>::iterator it = vcuts[i].begin(); it < vcuts[i].end();
           it++) {
        if (it->start > e) {
          tot += (it->start) - e;
          if (v[i] - tot <= (v[i] ^ nimsum)) {
            cout << revmv[i] << " 0 " << revmv[i] << " "
                 << ((it->start) - (tot - v[i] + (v[i] ^ nimsum)));
            return 0;
          }
          s = it->start;
          e = it->end;
        } else if (it->end > e) {
          e = it->end;
        }
      }
      tot += M - e;
      if (v[i] - tot <= (v[i] ^ nimsum)) {
        cout << revmv[i] << " 0 " << revmv[i] << " "
             << (M - (tot - v[i] + (v[i] ^ nimsum)));
        return 0;
      }
    }
  }
  for (int i = 0; i < hind; i++) {
    if ((h[i] ^ nimsum) < h[i]) {
      if (h[i] == nimsum) {
        cout << "0 " << revmh[i] << " " << N << " " << revmh[i];
        return 0;
      }
      s = 0;
      e = 0;
      int tot = 0;
      for (vector<p>::iterator it = hcuts[i].begin(); it < hcuts[i].end();
           it++) {
        if (it->start > e) {
          tot += (it->start) - e;
          if (h[i] - tot <= (h[i] ^ nimsum)) {
            cout << "0 " << revmh[i] << " "
                 << ((it->start) - (tot - h[i] + (h[i] ^ nimsum))) << " "
                 << revmh[i];
            return 0;
          }
          s = it->start;
          e = it->end;
        } else if (it->end > e) {
          e = it->end;
        }
      }
      tot += M - e;
      if (h[i] - tot <= (h[i] ^ nimsum)) {
        cout << "0 " << revmh[i] << " " << (N - (tot - h[i] + (h[i] ^ nimsum)))
             << " " << revmh[i];
        return 0;
      }
    }
  }
  if (vind < N - 1 && (M ^ nimsum) < M) {
    for (int i = 1; i <= vind + 1; i++) {
      if (vx.find(i) == vx.end()) {
        cout << i << " 0 " << i << " " << (M - (M ^ nimsum));
        return 0;
      }
    }
  }
  if (hind < M - 1 && (N ^ nimsum) < N) {
    for (int i = 1; i <= hind + 1; i++) {
      if (hy.find(i) == hy.end()) {
        cout << "0 " << i << " " << (N - (N ^ nimsum)) << " " << i;
      }
    }
  }
}