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;
class segment {
  int _pos;
  int _len;

 public:
  segment(int pos, int len) {
    this->_pos = pos;
    this->_len = len;
  }
  int pos() { return _pos; }
  int len() { return _len; }
  bool isintersected(segment s2) {
    return (pos() <= s2.pos() + s2.len()) && (s2.pos() <= pos() + len());
  }
};
bool cmp(segment s1, segment s2) {
  if (s1.pos() != s2.pos()) {
    return s1.pos() < s2.pos();
  }
  return s1.len() < s2.len();
}
class line {
 private:
  list<segment> l;
  int max;
  void canonize() {
    list<segment>::iterator it1, it2;
    l.sort(cmp);
    for (it1 = l.begin(); it1 != l.end();) {
      it2 = it1;
      ++it2;
      if (it2 != l.end()) {
        if (it1->isintersected(*it2)) {
          l.insert(
              it1,
              segment(
                  ((it1->pos()) < (it2->pos()) ? (it1->pos()) : (it2->pos())),
                  ((it1->pos() + it1->len()) > (it2->pos() + it2->len())
                       ? (it1->pos() + it1->len())
                       : (it2->pos() + it2->len())) -
                      ((it1->pos()) < (it2->pos()) ? (it1->pos())
                                                   : (it2->pos()))));
          it2++;
          it1 = l.erase(it1, it2);
          it1--;
          continue;
        }
      }
      it1++;
    }
  }

 public:
  line(int max) { this->max = max; }
  void add(int st, int en) { l.push_back(segment(st, en - st)); }
  int getenum() {
    canonize();
    int full = 0;
    for (list<segment>::iterator it = l.begin(); it != l.end(); ++it) {
      full += it->len();
    }
    return max - full;
  }
  int getinterval(int s) {
    canonize();
    int s1 = 0;
    int cur = 0;
    for (list<segment>::iterator it = l.begin(); it != l.end() && s1 < s;
         ++it) {
      if (it->pos() - cur >= s - s1) return cur + s - s1;
      s1 += it->pos() - cur;
      cur = it->pos() + it->len();
    }
    return cur + s - s1;
  }
};
class grid {
 private:
  int n;
  int m;
  map<int, line> lines;
  int getindex(bool is_hor, int i) { return is_hor ? i : i + n; }
  bool ishor(int index) { return index < n; }
  map<long, long> getheaps() {
    map<long, long> res;
    map<long, long>::iterator rit;
    int ne = n - 1, me = m - 1;
    for (map<int, line>::iterator it = lines.begin(); it != lines.end(); ++it) {
      int e_num = it->second.getenum();
      rit = res.find(e_num);
      int count = rit != res.end() ? rit->second + 1 : 1;
      if (rit != res.end()) res.erase(rit);
      res.insert(pair<long, long>(e_num, count));
      if (ishor(it->first))
        ne--;
      else
        me--;
    }
    if (ne) {
      rit = res.find(m);
      int count = rit != res.end() ? rit->second + ne : ne;
      if (rit != res.end()) res.erase(rit);
      res.insert(pair<long, long>(m, count));
    }
    if (me) {
      rit = res.find(n);
      int count = rit != res.end() ? rit->second + me : me;
      if (rit != res.end()) res.erase(rit);
      res.insert(pair<long, long>(n, count));
    }
    return res;
  }

 public:
  grid(int n, int m) {
    this->n = n;
    this->m = m;
  }
  void add(int xb, int yb, int xe, int ye) {
    map<int, line>::iterator it;
    if (xb == xe) {
      if (yb > ye) {
        int t = ye;
        ye = yb;
        yb = t;
      }
      it = lines.find(getindex(true, xb));
      if (it == lines.end()) {
        it = lines.insert(pair<int, line>(getindex(true, xb), line(m))).first;
      }
      it->second.add(yb, ye);
    } else {
      assert(yb == ye);
      if (xb > xe) {
        int t = xe;
        xe = xb;
        xb = t;
      }
      it = lines.find(getindex(false, yb));
      if (it == lines.end()) {
        it = lines.insert(pair<int, line>(getindex(false, yb), line(n))).first;
      }
      it->second.add(xb, xe);
    }
  }
  string calc() {
    for (int i = 1; i < n; i++) {
      if (lines.find(getindex(true, i)) == lines.end()) {
        map<int, line>::iterator it =
            lines.insert(pair<int, line>(getindex(true, i), line(m))).first;
        it->second.add(0, 0);
        break;
      }
    }
    for (int i = 1; i < m; i++) {
      if (lines.find(getindex(false, i)) == lines.end()) {
        map<int, line>::iterator it =
            lines.insert(pair<int, line>(getindex(false, i), line(n))).first;
        it->second.add(0, 0);
        break;
      }
    }
    map<long, long> H;
    H = getheaps();
    int sum = 0;
    string res;
    for (map<long, long>::iterator it = H.begin(); it != H.end(); ++it) {
      if ((it->second & 1) == 1) sum ^= it->first;
    }
    if (sum == 0) {
      res = "SECOND\n";
      return res;
    } else {
      res = "FIRST\n";
    }
    for (map<int, line>::iterator it = lines.begin(); it != lines.end(); ++it) {
      int e_num = it->second.getenum();
      if (e_num >= (sum ^ e_num)) {
        stringstream stout;
        int t = it->second.getinterval(e_num - (sum ^ e_num));
        if (ishor(it->first)) {
          stout << it->first << " 0 " << it->first << " " << t << endl;
        } else {
          stout << "0 " << it->first - n << " " << t << " " << it->first - n
                << endl;
        }
        res += stout.str();
        return res;
      }
    }
    assert(false);
    return res;
  }
};
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  grid G(n, m);
  for (int i = 0; i < k; i++) {
    int xb, yb, xe, ye;
    cin >> xb >> yb >> xe >> ye;
    G.add(xb, yb, xe, ye);
  }
  cout << G.calc();
  return 0;
}