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, int> mp1, mp2;
struct node {
  int dir;
  int x1;
  int y1;
  int y2;
  int len;
  int nd;
} p[100011] = {0};
vector<node> v1[100011], v2[100011];
int siz1[100011], siz2[100011];
bool cmp(node a, node b) { return a.nd < b.nd; }
int main() {
  int n, m, k;
  while (scanf("%d%d%d", &n, &m, &k) > 0) {
    for (int i = 0; i < k; i++) {
      int a, b, c, d;
      scanf("%d%d%d%d", &a, &b, &c, &d);
      if (a == c) {
        node temp;
        if (b > d) swap(b, d);
        temp.dir = 0;
        temp.y1 = b;
        temp.y2 = d;
        temp.x1 = a;
        temp.len = d - b;
        temp.nd = b;
        p[i] = temp;
        int siz = mp1.size();
        int k;
        if (mp1[a] == 0)
          k = mp1[a] = siz + 1;
        else
          k = mp1[a];
        v1[k].push_back(temp);
      } else {
        node temp;
        if (a > c) swap(a, c);
        temp.dir = 1;
        temp.y1 = a;
        temp.y2 = c;
        temp.x1 = b;
        temp.len = c - a;
        temp.nd = a;
        int siz = mp2.size();
        int k;
        if (mp2[b] == 0)
          k = mp2[b] = siz + 1;
        else
          k = mp2[b];
        p[i] = temp;
        v2[k].push_back(temp);
      }
    }
    int x = mp1.size();
    int y = mp2.size();
    for (int i = 1; i <= mp1.size(); i++) sort(v1[i].begin(), v1[i].end(), cmp);
    for (int i = 1; i <= mp2.size(); i++) sort(v2[i].begin(), v2[i].end(), cmp);
    int res = 0;
    res ^= ((n - 1 - mp1.size()) % 2) * m;
    res ^= ((m - 1 - mp2.size()) % 2) * n;
    for (int i = 1; i <= mp1.size(); i++) {
      int now = 0;
      int get = 0;
      for (int j = 0; j < v1[i].size(); j++) {
        node temp = v1[i][j];
        if (temp.y1 > now) {
          get += temp.y1 - now;
        }
        if (temp.y2 > now) now = temp.y2;
      }
      if (now < m) {
        get += m - now;
      }
      res ^= get;
      siz1[i] = get;
    }
    for (int i = 1; i <= mp2.size(); i++) {
      int now = 0;
      int get = 0;
      int flag = (n == 200000 && v2[i][0].x1 == 17);
      for (int j = 0; j < v2[i].size(); j++) {
        node temp = v2[i][j];
        if (temp.y1 > now) {
          get += temp.y1 - now;
        }
        if (temp.y2 > now) now = temp.y2;
      }
      if (now < n) {
        get += n - now;
      }
      res ^= get;
      siz2[i] = get;
    }
    puts(res ? "FIRST" : "SECOND");
    if (res) {
      if (n - 1 > mp1.size()) {
        int x = 1;
        while (mp1[x]) x++;
        mp1.erase(x);
        if ((res ^ m) <= m) {
          printf("%d %d %d %d\n", x, 0, x, m - (res ^ m));
          goto loop;
        }
      }
      if (m - 1 > mp2.size()) {
        int x = 1;
        while (mp2[x]) x++;
        mp2.erase(x);
        if ((res ^ n) <= n) {
          printf("%d %d %d %d\n", 0, x, n - (res ^ n), x);
          goto loop;
        }
      }
      {
        for (int i = 1; i <= mp1.size(); i++) {
          if ((res ^ siz1[i]) <= siz1[i]) {
            int tp = siz1[i] - (res ^ siz1[i]);
            int now = 0;
            int ress = 0;
            int go = v1[i][0].x1;
            for (int j = 0; j < v1[i].size(); j++) {
              node temp = v1[i][j];
              if (temp.y1 > now) ress += temp.y1 - now;
              if (temp.y2 > now) now = temp.y2;
              if (ress >= tp) {
                printf("%d %d %d %d\n", go, 0, go, temp.y1 - (ress - tp));
                goto loop;
              }
            }
            printf("%d %d %d %d\n", go, 0, go, now - ress + tp);
            goto loop;
          }
        }
        for (int i = 1; i <= mp2.size(); i++) {
          if ((res ^ siz2[i]) <= siz2[i]) {
            int tp = siz2[i] - (res ^ siz2[i]);
            int now = 0;
            int ress = 0;
            int go = v2[i][0].x1;
            for (int j = 0; j < v2[i].size(); j++) {
              node temp = v2[i][j];
              if (temp.y1 > now) ress += temp.y1 - now;
              if (temp.y2 > now) now = temp.y2;
              if (ress >= tp) {
                printf("%d %d %d %d\n", 0, go, temp.y1 - (ress - tp), go);
                goto loop;
              }
            }
            printf("%d %d %d %d\n", 0, go, now - ress + tp, go);
            goto loop;
          }
        }
      }
    }
  loop:;
  }
  return 0;
}