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 JAVA):

Solution:
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;

public class ProblemC {

	static class Vcut implements Comparable<Vcut> {
		int c;
		int fr, to;
		Vcut(int _x, int _fy, int _ty) {
			c = _x;
			if (_fy <= _ty) {
				fr = _fy;
				to = _ty;
			} else {
				fr = _ty;
				to = _fy;
			}
		}

		@Override
		public int compareTo(Vcut arg0) {
			if (c == arg0.c) {
				if (fr == arg0.fr) {
					return to - arg0.to;
				}
				return fr - arg0.fr;
			}
			return c - arg0.c;
		}
	}
	
	static class Stone {
		int left;
		int c;
		boolean isX;
		int fr;
		int to;
		Stone(int l, int _c, boolean _is, int _fr, int _to) {
			left = l;
			c = _c;
			isX = _is;
			fr = _fr;
			to = _to;
		}
	}
	
	public static void main(String[] args) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter out = new PrintWriter(System.out);

		String[] nmk = in.readLine().split(" ");
		int n = Integer.valueOf(nmk[0]);
		int m = Integer.valueOf(nmk[1]);
		int k = Integer.valueOf(nmk[2]);
		List<Vcut> vcut = new ArrayList<Vcut>();
		List<Vcut> hcut = new ArrayList<Vcut>();
		for (int i = 0 ; i < k ; i++) {
			String[] fftt = in.readLine().split(" ");
			int fx = Integer.valueOf(fftt[0]);
			int fy = Integer.valueOf(fftt[1]);
			int tx = Integer.valueOf(fftt[2]);
			int ty = Integer.valueOf(fftt[3]);
			if (fx == tx) {
				vcut.add(new Vcut(fx, fy, ty));
			} else {
				hcut.add(new Vcut(fy, fx, tx));
			}
		}
		Collections.sort(vcut);
		Collections.sort(hcut);

		int vl = vcut.size();
		int hl = hcut.size();
		int game = 0;
		
		List<Stone> pile = new ArrayList<Stone>();
		
		{
			int nv = 0;
			int cutCnt = 0;
			while (nv < vl) {
				Vcut next = vcut.get(nv);
				int tv = nv;
				while (tv < vl && vcut.get(tv).c == next.c) {
					tv++;
				}
				int lft = m - count(vcut, nv, tv, m);
				pile.add(new Stone(lft, next.c, true, nv, tv));
				game ^= lft;
				cutCnt++;
				nv = tv;
			}
			if (((n-1) - cutCnt) >= 1) {
				pile.add(new Stone(m, findEmpty(vcut, n), true, 0, 0));
			}
			if (((n-1) - cutCnt) % 2 == 1) {
				game ^= m;
			}
		}
		
		
		{
			int nh = 0;
			int cutCnt = 0;
			while (nh < hl) {
				Vcut next = hcut.get(nh);
				int th = nh;
				cutCnt++;
				while (th < hl && hcut.get(th).c == next.c) {
					th++;
				}
				int lft = n - count(hcut, nh, th, n);
				pile.add(new Stone(lft, next.c, false, nh, th));
				game ^= lft;
				nh = th;
			}
			if (((m-1) - cutCnt) >= 1) {
				pile.add(new Stone(n, findEmpty(hcut, m), false, 0, 0));
			}
			if (((m-1) - cutCnt) % 2 == 1) {
				game ^= n;
			}
		}
		
		int ofx = -1;
		int ofy = -1;
		int otx = -1;
		int oty = -1;
		if (game != 0) {
			for (Stone stone : pile) {
				if ((game ^ stone.left) <= stone.left) {
					int shouldTake = stone.left - (game ^ stone.left);
					if (stone.fr == stone.to) {
						if (stone.isX) {
							ofx = otx = stone.c;
							ofy = 0;
							oty = shouldTake;
						} else {
							ofy = oty = stone.c;
							ofx = 0;
							otx = shouldTake;
						}
					} else {
						if (stone.isX) {
							ofx = otx = stone.c;
							ofy = 0;
							oty = findEqualGame(vcut, stone.c, shouldTake, m, stone.fr, stone.to);
						} else {
							ofy = oty = stone.c;
							ofx = 0;
							otx = findEqualGame(hcut, stone.c, shouldTake, n, stone.fr, stone.to);
						}

					}
					// break;
				}
			}
		}
		
		out.println(game == 0 ? "SECOND" : "FIRST");
		if (ofx != -1) {
			out.println(ofx + " " + ofy + " " + otx + " " + oty);
		}
		out.flush();
	}
	
	private static int findEqualGame(List<Vcut> vcut, int bestC, int game, int m, int fi, int ti) {
		int max = m;
		int min = 0;
		while (max - min > 1) {
			int med = (max + min) / 2;
			if (med - count(vcut, fi, ti, med) >= game) {
				max = med;
			} else {
				min = med;
			}
		}
		return max;
	}

	private static int findEmpty(List<Vcut> list, int max) {
		int l = list.size();
		if (l == 0) {
			return 1;
		}
		if (list.get(0).c >= 2) {
			return 1;
		} else if (list.get(l-1).c <= max-2){
			return max-1;
		}
		for (int i = 0 ; i < l-1 ; i++) {
			Vcut cut1 = list.get(i);
			Vcut cut2 = list.get(i+1);
			if (cut2.c - cut1.c >= 2) {
				return cut1.c + 1;
			}
		}
		return 0;
	}

	// count : [nv,tv)
	private static int count(List<Vcut> vcut, int nv, int tv, int max) {
		int fr = vcut.get(nv).fr;
		int cnt = 0;
		int idx = nv;
		while (idx < tv) {
			int tidx = idx;
			int to = fr;
			while (tidx < tv && to >= vcut.get(tidx).fr && to <= max) {
				to = Math.max(to, vcut.get(tidx).to);
				tidx++;
			}
			cnt += Math.max(0, (Math.min(to,max) - fr));
			if (tidx == tv || to > max) {
				break;
			}
			fr = vcut.get(tidx).fr;
			idx = tidx;
		}
		return cnt;
	}

	public static void debug(Object... o) {
		System.err.println(Arrays.deepToString(o));
	}
}