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 odc {
  int x1, y1, x2, y2;
};
struct prze {
  int l, p;
};
bool porownanie_poz(odc a, odc b) {
  if (a.y1 < b.y1) return true;
  if (a.y1 > b.y1) return false;
  if (a.x1 < b.x1) return true;
  if (a.x1 > b.x1) return false;
  if (a.x2 < b.x2) return true;
  if (a.x2 > b.x2) return false;
  if (a.x2 == b.x2) return true;
}
bool porownanie_pio(odc a, odc b) {
  if (a.x1 < b.x1) return true;
  if (a.x1 > b.x1) return false;
  if (a.y1 < b.y1) return true;
  if (a.y1 > b.y1) return false;
  if (a.y2 < b.y2) return true;
  if (a.y2 > b.y2) return false;
  if (a.y2 == b.y2) return true;
}
int Szukaj(vector<int>& a, int x) {
  for (int i = 0; i < a.size(); ++i)
    if (a[i] == x) return i;
}
int main() {
  ios_base::sync_with_stdio(0);
  int n, m, k;
  cin >> n >> m >> k;
  vector<odc> we_poz, we_pio;
  for (int i = 0; i < k; ++i) {
    int x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    if (x1 == x2) {
      if (y1 > y2) swap(y1, y2);
      we_pio.push_back({x1, y1, x2, y2});
    } else {
      if (x1 > x2) swap(x1, x2);
      we_poz.push_back({x1, y1, x2, y2});
    }
  }
  vector<vector<prze> > prze_poz, prze_pio;
  vector<int> nr_wie, nr_kol;
  sort(we_poz.begin(), we_poz.end(), porownanie_poz);
  sort(we_pio.begin(), we_pio.end(), porownanie_pio);
  for (int l = 0; l < we_pio.size();) {
    int p = l;
    while (p < we_pio.size() && we_pio[l].x1 == we_pio[p].x1) ++p;
    --p;
    for (int l2 = l; l2 <= p;) {
      int L = we_pio[l2].y1, P = we_pio[l2].y2;
      int p2 = l2;
      while (p2 <= p && we_pio[p2].y1 <= P) {
        P = max(P, we_pio[p2].y2);
        ++p2;
      }
      --p2;
      if (nr_kol.size() == 0 || nr_kol.back() != we_pio[l].x1) {
        nr_kol.push_back(we_pio[l].x1);
        vector<prze> t;
        t.push_back({L, P});
        prze_pio.push_back(t);
      } else
        prze_pio.back().push_back({L, P});
      l2 = p2 + 1;
    }
    l = p + 1;
  }
  for (int l = 0; l < we_poz.size();) {
    int p = l;
    while (p < we_poz.size() && we_poz[l].y1 == we_poz[p].y1) ++p;
    --p;
    for (int l2 = l; l2 <= p;) {
      int L = we_poz[l2].x1, P = we_poz[l2].x2;
      int p2 = l2;
      while (p2 <= p && we_poz[p2].x1 <= P) {
        P = max(P, we_poz[p2].x2);
        ++p2;
      }
      --p2;
      if (nr_wie.size() == 0 || nr_wie.back() != we_poz[l].y1) {
        nr_wie.push_back(we_poz[l].y1);
        vector<prze> t;
        t.push_back({L, P});
        prze_poz.push_back(t);
      } else
        prze_poz.back().push_back({L, P});
      l2 = p2 + 1;
    }
    l = p + 1;
  }
  vector<int> stos_poz, stos_pio;
  for (int i = 0; i < prze_pio.size(); ++i) {
    int s = m;
    for (int j = 0; j < prze_pio[i].size(); ++j)
      s -= prze_pio[i][j].p - prze_pio[i][j].l;
    stos_pio.push_back(s);
  }
  for (int i = 0; i < prze_poz.size(); ++i) {
    int s = n;
    for (int j = 0; j < prze_poz[i].size(); ++j)
      s -= prze_poz[i][j].p - prze_poz[i][j].l;
    stos_poz.push_back(s);
  }
  int il_puste_pio = n - 1 - prze_pio.size();
  vector<int> puste_pio;
  vector<bool> jest(200000, false);
  for (int i = 0; i < nr_kol.size(); ++i)
    if (nr_kol[i] < 200000) jest[nr_kol[i]] = true;
  vector<int> puste;
  for (int i = 1; i < 200000; ++i)
    if (!jest[i]) puste.push_back(i);
  if (il_puste_pio % 2 == 0 && il_puste_pio != 0) {
    puste_pio.push_back(puste[0]);
    puste_pio.push_back(puste[1]);
  } else if (il_puste_pio % 2 == 1)
    puste_pio.push_back(puste[0]);
  for (int i = 0; i < 200000; ++i) jest[i] = false;
  puste.clear();
  vector<int> puste_poz;
  int il_puste_poz = m - 1 - prze_poz.size();
  for (int i = 0; i < nr_wie.size(); ++i)
    if (nr_wie[i] < 200000) jest[nr_wie[i]] = true;
  for (int i = 1; i < 200000; ++i)
    if (!jest[i]) puste.push_back(i);
  if (il_puste_poz % 2 == 0 && il_puste_poz != 0) {
    puste_poz.push_back(puste[0]);
    puste_poz.push_back(puste[1]);
  } else if (il_puste_poz % 2 == 1)
    puste_poz.push_back(puste[0]);
  int ksor = 0;
  for (int i = 0; i < stos_pio.size(); ++i) ksor ^= stos_pio[i];
  for (int i = 0; i < stos_poz.size(); ++i) ksor ^= stos_poz[i];
  for (int i = 0; i < puste_pio.size(); ++i) ksor ^= m;
  for (int i = 0; i < puste_poz.size(); ++i) ksor ^= n;
  if (ksor == 0)
    cout << "SECOND";
  else {
    cout << "FIRST" << endl;
    int puste, kier, nr, dl;
    puste = kier = nr = dl = -1;
    for (int i = 0; i < stos_pio.size(); ++i) {
      ksor ^= stos_pio[i];
      if (ksor < stos_pio[i]) {
        puste = 0;
        kier = 0;
        nr = nr_kol[i];
        dl = stos_pio[i] - ksor;
      }
      ksor ^= stos_pio[i];
    }
    for (int i = 0; i < stos_poz.size(); ++i) {
      ksor ^= stos_poz[i];
      if (ksor < stos_poz[i]) {
        puste = 0;
        kier = 1;
        nr = nr_wie[i];
        dl = stos_poz[i] - ksor;
      }
      ksor ^= stos_poz[i];
    }
    if (puste_pio.size() != 0) {
      ksor ^= m;
      if (ksor < m) {
        puste = 1;
        kier = 0;
        nr = puste_pio[0];
        dl = m - ksor;
      }
      ksor ^= m;
    }
    if (puste_poz.size() != 0) {
      ksor ^= n;
      if (ksor < n) {
        puste = 1;
        kier = 1;
        nr = puste_poz[0];
        dl = n - ksor;
      }
      ksor ^= n;
    }
    if (puste == 1) {
      if (kier == 0)
        cout << nr << " 0 " << nr << " " << dl;
      else
        cout << "0 " << nr << " " << dl << " " << nr;
    } else {
      if (kier == 0) {
        for (int i = 0; i < prze_pio.size(); ++i)
          prze_pio[i].push_back({m + 10, m + 10});
        int ind = Szukaj(nr_kol, nr);
        int s = 0;
        for (int i = 0; i < prze_pio[ind].size(); ++i) {
          s += prze_pio[ind][i].p - prze_pio[ind][i].l;
          if (prze_pio[ind][i].p - s >= dl) {
            int wsp = prze_pio[ind][i].l - ((prze_pio[ind][i].p - s) - dl);
            cout << nr << " 0 " << nr << " " << wsp;
            break;
          }
        }
      } else {
        for (int i = 0; i < prze_poz.size(); ++i)
          prze_poz[i].push_back({n + 10, n + 10});
        int ind = Szukaj(nr_wie, nr);
        int s = 0;
        for (int i = 0; i < prze_poz[ind].size(); ++i) {
          s += prze_poz[ind][i].p - prze_poz[ind][i].l;
          if (prze_poz[ind][i].p - s >= dl) {
            int wsp = prze_poz[ind][i].l - ((prze_poz[ind][i].p - s) - dl);
            cout << "0 " << nr << " " << wsp << " " << nr;
            break;
          }
        }
      }
    }
  }
  return 0;
}