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;
const int INF = 1e9 + 5;
int n, m, k;
vector<pair<pair<int, int>, int>> col, row;
bool cmp(pair<pair<int, int>, int> a, pair<pair<int, int>, int> b) {
  if (a.second != b.second) return a.second < b.second;
  return a.first < b.first;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> m >> k;
  while (k--) {
    int a, b, c, d;
    cin >> a >> b >> c >> d;
    if (a > c || b > d) swap(a, c), swap(b, d);
    if (b == d)
      col.push_back({{a, c}, b});
    else
      row.push_back({{b, d}, a});
  }
  sort(col.begin(), col.end(), cmp);
  sort(row.begin(), row.end(), cmp);
  for (int i = 1; i < col.size(); i++)
    if (col[i].second == col[i - 1].second &&
        col[i].first.first <= col[i - 1].first.second) {
      col[i].first.first = min(col[i].first.first, col[i - 1].first.first);
      col[i].first.second = max(col[i].first.second, col[i - 1].first.second);
      col[i - 1].first.first = INF;
    }
  for (int i = 1; i < row.size(); i++)
    if (row[i].second == row[i - 1].second &&
        row[i].first.first <= row[i - 1].first.second) {
      row[i].first.first = min(row[i].first.first, row[i - 1].first.first);
      row[i].first.second = max(row[i].first.second, row[i - 1].first.second);
      row[i - 1].first.first = INF;
    }
  int ans = 0;
  {
    set<int> st;
    map<int, int> mp;
    for (int i = 0; i < col.size(); i++)
      if (col[i].first.first != INF) {
        if (st.count(col[i].second)) ans ^= n - mp[col[i].second];
        st.insert(col[i].second);
        mp[col[i].second] += col[i].first.second - col[i].first.first;
        ans ^= n - mp[col[i].second];
      }
    if (st.size() % 2 != (m - 1) % 2) ans ^= n;
    st.clear();
    mp.clear();
    for (int i = 0; i < row.size(); i++)
      if (row[i].first.first != INF) {
        if (st.count(row[i].second)) ans ^= m - mp[row[i].second];
        st.insert(row[i].second);
        mp[row[i].second] += row[i].first.second - row[i].first.first;
        ans ^= m - mp[row[i].second];
      }
    if (st.size() % 2 != (n - 1) % 2) ans ^= m;
  }
  if (ans == 0)
    cout << "SECOND\n";
  else {
    cout << "FIRST\n";
    int l;
    for (l = 30; l >= 0; l--)
      if ((ans >> l) & 1) break;
    {
      set<int> st;
      map<int, int> mp;
      for (int i = 0; i < col.size(); i++)
        if (col[i].first.first != INF) {
          st.insert(col[i].second);
          mp[col[i].second] += col[i].first.second - col[i].first.first;
        }
      if (st.size() != m - 1)
        for (int i = 1; i < m; i++)
          if (mp.count(i) == 0) {
            st.insert(i);
            break;
          }
      for (int c : st) {
        int z = n - mp[c];
        if ((z >> l) & 1) {
          z ^= 1 << l;
          ans ^= 1 << l;
          for (--l; l >= 0; l--) {
            if ((ans >> l) & 1) z ^= (1 << l), ans ^= 1 << l;
          }
          vector<pair<int, int>> gec;
          for (pair<pair<int, int>, int> ss : col)
            if (ss.first.first != INF)
              if (ss.second == c) gec.push_back(ss.first);
          gec.push_back({n, n});
          int cur = 0, last = 0;
          for (pair<int, int> temp : gec) {
            if (cur + temp.first - last < z) {
              cur += temp.first - last;
              last = temp.second;
            } else {
              last = last + z - cur;
              cur = z;
              break;
            }
          }
          cout << last << " " << c << " " << n << " " << c << endl;
          return 0;
        }
      }
      st.clear();
      mp.clear();
      for (int i = 0; i < row.size(); i++)
        if (row[i].first.first != INF) {
          st.insert(row[i].second);
          mp[row[i].second] += row[i].first.second - row[i].first.first;
        }
      if (st.size() != n - 1)
        for (int i = 1; i < n; i++)
          if (mp.count(i) == 0) {
            st.insert(i);
            break;
          }
      for (int c : st) {
        int z = m - mp[c];
        if ((z >> l) & 1) {
          for (; l >= 0; l--) {
            if ((ans >> l) & 1) z ^= (1 << l), ans ^= 1 << l;
          }
          vector<pair<int, int>> gec;
          for (pair<pair<int, int>, int> ss : row)
            if (ss.first.first != INF)
              if (ss.second == c) gec.push_back(ss.first);
          gec.push_back({m, m});
          int cur = 0, last = 0;
          for (pair<int, int> temp : gec) {
            if (cur + temp.first - last < z) {
              cur += temp.first - last;
              last = temp.second;
            } else {
              last = last + z - cur;
              cur = z;
              break;
            }
          }
          cout << c << " " << last << " " << c << " " << m << endl;
          return 0;
        }
      }
    }
  }
  return 0;
}