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, vector<pair<int, int> > > mx, my;
map<int, int> mp;
vector<pair<int, int> > event;
vector<pair<int, int> > vx, vy;
void func(int type, int id, int X, vector<pair<int, int> > v) {
  int i;
  event.clear();
  event.push_back(make_pair(0, 1));
  event.push_back(make_pair(X, -1));
  for ((i) = 0; (i) < (int)(v.size()); (i)++) {
    event.push_back(make_pair(v[i].first, -1));
    event.push_back(make_pair(v[i].second, 1));
  }
  int total = 0;
  int cur = 0;
  int sz = event.size();
  sort(event.begin(), event.end());
  for ((i) = 0; (i) < (int)(sz - 1); (i)++) {
    cur += event[i].second;
    if (cur > 0) total += event[i + 1].first - event[i].first;
  }
  if (type == 0) {
    vx.push_back(make_pair(id, total));
  } else {
    vy.push_back(make_pair(id, total));
  }
  mp[X]--;
  mp[total]++;
}
int cut_x(int x, int target) {
  int i;
  vector<pair<int, int> > v = mx[x];
  event.clear();
  event.push_back(make_pair(0, 1));
  event.push_back(make_pair(1000000000, -1));
  for ((i) = 0; (i) < (int)(v.size()); (i)++) {
    event.push_back(make_pair(v[i].first, -1));
    event.push_back(make_pair(v[i].second, 1));
  }
  int total = 0;
  int cur = 0;
  int sz = event.size();
  sort(event.begin(), event.end());
  for ((i) = 0; (i) < (int)(sz - 1); (i)++) {
    cur += event[i].second;
    if (cur > 0) {
      int d = event[i + 1].first - event[i].first;
      if (d >= target) {
        return event[i].first + target;
      } else {
        target -= d;
      }
    }
  }
  return -1;
}
int cut_y(int y, int target) {
  int i;
  vector<pair<int, int> > v = my[y];
  event.clear();
  event.push_back(make_pair(0, 1));
  event.push_back(make_pair(1000000000, -1));
  for ((i) = 0; (i) < (int)(v.size()); (i)++) {
    event.push_back(make_pair(v[i].first, -1));
    event.push_back(make_pair(v[i].second, 1));
  }
  int total = 0;
  int cur = 0;
  int sz = event.size();
  sort(event.begin(), event.end());
  for ((i) = 0; (i) < (int)(sz - 1); (i)++) {
    cur += event[i].second;
    if (cur > 0) {
      int d = event[i + 1].first - event[i].first;
      if (d >= target) {
        return event[i].first + target;
      } else {
        target -= d;
      }
    }
  }
  return -1;
}
int freex(int X) {
  int i;
  for (i = 1; i < X; i++) {
    if (i > 100010) break;
    if (mx.find(i) == mx.end()) return i;
  }
  return -1;
}
int freey(int Y) {
  int i;
  for (i = 1; i < Y; i++) {
    if (i > 100010) break;
    if (my.find(i) == my.end()) return i;
  }
  return -1;
}
int main(void) {
  int X, Y, N, x1, x2, y1, y2, i;
  cin >> X >> Y >> N;
  for ((i) = 0; (i) < (int)(N); (i)++) {
    scanf("%d%d%d%d", &x1, &y1, &x2, &y2);
    if (x1 == x2) {
      if (y1 > y2) swap(y1, y2);
      mx[x1].push_back(make_pair(y1, y2));
    } else {
      if (x1 > x2) swap(x1, x2);
      my[y1].push_back(make_pair(x1, x2));
    }
  }
  mp[X] += Y - 1;
  mp[Y] += X - 1;
  for (__typeof((mx).begin()) itr = (mx).begin(); itr != (mx).end(); itr++)
    func(0, (itr->first), Y, (itr->second));
  for (__typeof((my).begin()) itr = (my).begin(); itr != (my).end(); itr++)
    func(1, (itr->first), X, (itr->second));
  int nim = 0;
  for (__typeof((mp).begin()) itr = (mp).begin(); itr != (mp).end(); itr++)
    if ((itr->second) % 2 == 1) nim ^= (itr->first);
  if (nim == 0) {
    cout << "SECOND" << endl;
    return 0;
  }
  cout << "FIRST" << endl;
  int tmp = freex(X);
  if (tmp != -1 && (Y ^ nim) < Y) {
    cout << tmp << ' ' << 0 << ' ' << tmp << ' ' << Y - (Y ^ nim) << endl;
    return 0;
  }
  tmp = freey(Y);
  if (tmp != -1 && (X ^ nim) < X) {
    cout << 0 << ' ' << tmp << ' ' << X - (X ^ nim) << ' ' << tmp << endl;
    return 0;
  }
  for ((i) = 0; (i) < (int)(vx.size()); (i)++) {
    int x = vx[i].first;
    int total = vx[i].second;
    if ((total ^ nim) < total) {
      int tmp = cut_x(x, total - (total ^ nim));
      cout << x << ' ' << 0 << ' ' << x << ' ' << tmp << endl;
      return 0;
    }
  }
  for ((i) = 0; (i) < (int)(vy.size()); (i)++) {
    int y = vy[i].first;
    int total = vy[i].second;
    if ((total ^ nim) < total) {
      int tmp = cut_y(y, total - (total ^ nim));
      cout << 0 << ' ' << y << ' ' << tmp << ' ' << y << endl;
      return 0;
    }
  }
  cout << "failed" << endl;
  return 0;
}