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, set<pair<int, int> > > l, c;
vector<pair<int, int> > lvals, cvals;
int findcutsize(set<pair<int, int> > &s, int val) {
  int cnt = 0;
  int lastend = 0;
  for (set<pair<int, int> >::iterator it = s.begin(); it != s.end(); it++) {
    if (cnt + (it->second - lastend) >= val) {
      return lastend + val - cnt;
    } else {
      cnt += it->second - lastend;
      lastend = it->first;
    }
  }
  return lastend + val - cnt;
}
void addseg(int b, int e, set<pair<int, int> > &s) {
  set<pair<int, int> >::iterator it1 = s.lower_bound(make_pair(b, 0));
  set<pair<int, int> >::iterator it2 = s.lower_bound(make_pair(e, 0));
  int newe = e, newb = b;
  bool erase1 = 0, erase2 = 0;
  if (it1 == s.end()) {
    s.insert(make_pair(e, b));
  } else {
    if (it1->second < newb) {
      newb = it1->second;
      erase1 = 1;
    }
    if (it2 != s.end() and it2->second <= e) {
      newe = it2->first;
      erase2 = 1;
    }
    if (erase1 and erase2) {
      if (it1 != it2) {
        s.erase(it1);
        s.erase(it2);
      } else {
        s.erase(it1);
      }
    } else {
      if (erase1) {
        s.erase(it1);
      }
      if (erase2) {
        s.erase(it2);
      }
    }
    set<pair<int, int> >::iterator er1, er2, aux;
    er1 = s.lower_bound(make_pair(newb, 0));
    er2 = s.upper_bound(make_pair(newe, 0));
    while (er1 != er2) {
      aux = er1;
      aux++;
      s.erase(er1);
      er1 = aux;
    }
    s.insert(make_pair(newe, newb));
  }
}
int calcxor(int val, int times) {
  if (times == 0) {
    return 0;
  } else if (times == 1)
    return val;
  else {
    int ret = calcxor(val, times / 2);
    ret = ret ^ ret;
    if (times % 2) ret = ret ^ val;
    return ret;
  }
}
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  for (int i = 0; i < k; i++) {
    int x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    if (x1 == x2) {
      addseg(min(y1, y2), max(y1, y2), c[x1]);
    } else {
      addseg(min(x1, x2), max(x1, x2), l[y1]);
    }
  }
  int leftc = n - 1 - c.size();
  int leftl = m - 1 - l.size();
  int xorc = calcxor(m, leftc);
  int xorl = calcxor(n, leftl);
  for (map<int, set<pair<int, int> > >::iterator it1 = c.begin();
       it1 != c.end(); it1++) {
    int cur = m;
    for (set<pair<int, int> >::iterator it2 = it1->second.begin();
         it2 != it1->second.end(); it2++) {
      cur -= it2->first - it2->second;
    }
    cvals.push_back(make_pair(cur, it1->first));
  }
  for (map<int, set<pair<int, int> > >::iterator it1 = l.begin();
       it1 != l.end(); it1++) {
    int cur = n;
    for (set<pair<int, int> >::iterator it2 = it1->second.begin();
         it2 != it1->second.end(); it2++) {
      cur -= it2->first - it2->second;
    }
    lvals.push_back(make_pair(cur, it1->first));
  }
  int ans = 0;
  for (int i = 0; i < cvals.size(); i++) {
    ans = ans ^ cvals[i].first;
  }
  for (int i = 0; i < lvals.size(); i++) {
    ans = ans ^ lvals[i].first;
  }
  ans = ans ^ xorl ^ xorc;
  if (ans == 0) {
    cout << "SECOND" << endl;
  } else {
    cout << "FIRST" << endl;
    int digit;
    for (int i = 0; i < 32; i++) {
      if ((ans >> i) & 1) {
        digit = i;
      }
    }
    if (leftc and ((m >> digit) & 1)) {
      int tocut = m - (m ^ ans);
      int cutcol;
      for (int i = 1; i <= 100003; i++) {
        if (c.find(i) == c.end()) {
          cutcol = i;
          break;
        }
      }
      cout << cutcol << " " << 0 << " " << cutcol << " " << tocut << endl;
    } else if (leftl and ((n >> digit) & 1)) {
      int tocut = n - (n ^ ans);
      int cutline;
      for (int i = 1; i <= 100003; i++) {
        if (l.find(i) == l.end()) {
          cutline = i;
          break;
        }
      }
      cout << 0 << " " << cutline << " " << tocut << " " << cutline << endl;
    } else {
      for (int i = 0; i < cvals.size(); i++) {
        if ((cvals[i].first >> digit) & 1) {
          int cutcol;
          int tocut = cvals[i].first - (cvals[i].first ^ ans);
          cutcol = cvals[i].second;
          int cutsize = findcutsize(c[cutcol], tocut);
          cout << cutcol << " " << 0 << " " << cutcol << " " << cutsize << endl;
          exit(0);
        }
      }
      for (int i = 0; i < lvals.size(); i++) {
        if ((lvals[i].first >> digit) & 1) {
          int cutline;
          int tocut = lvals[i].first - (lvals[i].first ^ ans);
          cutline = lvals[i].second;
          int cutsize = findcutsize(l[cutline], tocut);
          cout << 0 << " " << cutline << " " << cutsize << " " << cutline
               << endl;
          exit(0);
        }
      }
    }
  }
  return 0;
}