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, map<int, int> > mp, mp2;
map<int, vector<pair<int, int> > > mp3, mp4;
map<int, int> mp5, mp6;
int a[200001];
int sum[200001];
int main() {
  int n, m, k, ans = 0, i;
  map<int, map<int, int> >::iterator it;
  map<int, int>::iterator it2;
  scanf("%d %d %d", &n, &m, &k);
  for (i = 0; i < k; i++) {
    int x1, y1, x2, y2;
    scanf("%d %d %d %d", &x1, &y1, &x2, &y2);
    if (y1 == y2) {
      mp[y1][x1] = 0;
      mp[y1][x2] = 0;
      mp3[y1].push_back(make_pair(min(x1, x2), max(x1, x2)));
    } else {
      mp2[x1][y1] = 0;
      mp2[x1][y2] = 0;
      mp4[x1].push_back(make_pair(min(y1, y2), max(y1, y2)));
    }
  }
  if ((m - mp.size() - 1) % 2 == 1) ans ^= n;
  if ((n - mp2.size() - 1) % 2 == 1) ans ^= m;
  for (it = mp.begin(); it != mp.end(); it++) {
    int x = 0;
    for (it2 = it->second.begin(), i = 0; it2 != it->second.end(); it2++, i++) {
      it2->second = i;
      a[i] = it2->first;
    }
    for (i = 0; i < it->second.size(); i++) sum[i] = 0;
    for (i = 0; i < mp3[it->first].size(); i++) {
      sum[it->second[mp3[it->first][i].first]]++;
      sum[it->second[mp3[it->first][i].second]]--;
    }
    for (i = 1; i < it->second.size(); i++) sum[i] += sum[i - 1];
    for (i = 0; i < it->second.size() - 1; i++) {
      if (sum[i] == 0) x += a[i + 1] - a[i];
    }
    x += a[0] + n - a[it->second.size() - 1];
    mp5[it->first] = x;
    ans ^= x;
  }
  for (it = mp2.begin(); it != mp2.end(); it++) {
    int x = 0;
    for (it2 = it->second.begin(), i = 0; it2 != it->second.end(); it2++, i++) {
      it2->second = i;
      a[i] = it2->first;
    }
    for (i = 0; i < it->second.size(); i++) sum[i] = 0;
    for (i = 0; i < mp4[it->first].size(); i++) {
      sum[it->second[mp4[it->first][i].first]]++;
      sum[it->second[mp4[it->first][i].second]]--;
    }
    for (i = 1; i < it->second.size(); i++) sum[i] += sum[i - 1];
    for (i = 0; i < it->second.size() - 1; i++) {
      if (sum[i] == 0) x += a[i + 1] - a[i];
    }
    x += a[0] + m - a[it->second.size() - 1];
    mp6[it->first] = x;
    ans ^= x;
  }
  if (ans == 0) {
    puts("SECOND");
  } else {
    puts("FIRST");
    if ((ans ^ n) < n) {
      for (i = 1; i < m; i++) {
        if (mp.count(i) == 0) {
          printf("%d %d %d %d\n", 0, i, n - (ans ^ n), i);
          return 0;
        }
      }
    }
    if ((ans ^ m) < m) {
      for (i = 1; i < n; i++) {
        if (mp2.count(i) == 0) {
          printf("%d %d %d %d\n", i, 0, i, m - (ans ^ m));
          return 0;
        }
      }
    }
    for (it = mp.begin(); it != mp.end(); it++) {
      if ((ans ^ mp5[it->first]) < mp5[it->first]) {
        int x = 0;
        ans = mp5[it->first] - (ans ^ mp5[it->first]);
        for (it2 = it->second.begin(), i = 0; it2 != it->second.end();
             it2++, i++) {
          a[i] = it2->first;
        }
        for (i = 0; i < it->second.size(); i++) sum[i] = 0;
        for (i = 0; i < mp3[it->first].size(); i++) {
          sum[it->second[mp3[it->first][i].first]]++;
          sum[it->second[mp3[it->first][i].second]]--;
        }
        for (i = 1; i < it->second.size(); i++) sum[i] += sum[i - 1];
        for (i = 0; i < it->second.size() - 1; i++) {
          if (sum[i] == 0) {
            if (x + a[i + 1] - a[i] >= ans) {
              printf("%d %d %d %d\n", a[0], it->first, ans - x + a[i],
                     it->first);
              return 0;
            }
            x += a[i + 1] - a[i];
          }
        }
        if (x + a[0] >= ans) {
          printf("%d %d %d %d\n", a[0] + x - ans, it->first,
                 a[it->second.size() - 1], it->first);
        } else {
          printf("%d %d %d %d\n", 0, it->first,
                 ans + a[it->second.size() - 1] - a[0] - x, it->first);
        }
        return 0;
      }
    }
    for (it = mp2.begin(); it != mp2.end(); it++) {
      if ((ans ^ mp6[it->first]) < mp6[it->first]) {
        int x = 0;
        ans = mp6[it->first] - (ans ^ mp6[it->first]);
        for (it2 = it->second.begin(), i = 0; it2 != it->second.end();
             it2++, i++) {
          a[i] = it2->first;
        }
        for (i = 0; i < it->second.size(); i++) sum[i] = 0;
        for (i = 0; i < mp4[it->first].size(); i++) {
          sum[it->second[mp4[it->first][i].first]]++;
          sum[it->second[mp4[it->first][i].second]]--;
        }
        for (i = 1; i < it->second.size(); i++) sum[i] += sum[i - 1];
        for (i = 0; i < it->second.size() - 1; i++) {
          if (sum[i] == 0) {
            if (x + a[i + 1] - a[i] >= ans) {
              printf("%d %d %d %d\n", it->first, a[0], it->first,
                     ans - x + a[i]);
              return 0;
            }
            x += a[i + 1] - a[i];
          }
        }
        if (x + a[0] >= ans) {
          printf("%d %d %d %d\n", it->first, a[0] + x - ans, it->first,
                 a[it->second.size() - 1]);
        } else {
          printf("%d %d %d %d\n", it->first, 0, it->first,
                 ans + a[it->second.size() - 1] - a[0] - x);
        }
        return 0;
      }
    }
  }
  return 0;
}