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.util.*;
import java.io.*;
public class Game
{
	public static void main(String[] args)
	{
		Scanner in = new Scanner(System.in);
		
		int n = in.nextInt();
		int m = in.nextInt();
		int k = in.nextInt();
		
		Cut[] cuts = new Cut[k];
		for(int x = 0; x < k; x++)
		{
			cuts[x] = new Cut(in.nextInt(), in.nextInt(), in.nextInt(), in.nextInt());
		}
		
		Arrays.sort(cuts);
		
		ArrayList<Integer> lines = new ArrayList<Integer>();
		ArrayList<Integer> locations = new ArrayList<Integer>();
		int horizontal = 0;
		int vertical = 0;
		int hLoc = 1;
		int vLoc = 1;
		for(int y = 0; y < cuts.length; y++)
		{
			int current = 0;
			if(cuts[y].y1 == cuts[y].y2)
			{
				locations.add(cuts[y].y1);
				
				if(hLoc == cuts[y].y1)
				{
					hLoc++;
				}
				
				current = cuts[y].x2 - cuts[y].x1;
				int max = cuts[y].x2;
				while(y < cuts.length - 1 && cuts[y + 1].y1 == cuts[y + 1].y2 && cuts[y + 1].y1 == cuts[y].y1)
				{
					if(cuts[y + 1].x1 >= max)
					{
						current += cuts[y + 1].x2 - cuts[y + 1].x1;
						max = cuts[y + 1].x2;
					}
					else
					{
						current += Math.max(0, cuts[y + 1].x2 - max);
						max = Math.max(max, cuts[y + 1].x2);
					}
					
					y++;
				}
				
				lines.add(n - current);
				horizontal++;
			}
			else
			{
				locations.add(m + 1 + cuts[y].x1);
				
				if(vLoc == cuts[y].x1)
				{
					vLoc++;
				}
				
				current = cuts[y].y2 - cuts[y].y1;
				int max = cuts[y].y2;
				while(y < cuts.length - 1 && cuts[y + 1].x1 == cuts[y + 1].x2 && cuts[y + 1].x1 == cuts[y].x1)
				{
					if(cuts[y + 1].y1 >= max)
					{
						current += cuts[y + 1].y2 - cuts[y + 1].y1;
						max = cuts[y + 1].y2;
					}
					else
					{
						current += Math.max(0, cuts[y + 1].y2 - max);
						max = Math.max(max, cuts[y + 1].y2);
					}
					
					y++;
				}
				
				lines.add(m - current);
				vertical++;
			}
		}
		
		if((m - horizontal) % 2 == 0)
		{
			lines.add(n);
			locations.add(hLoc);
		}
		
		if((n - vertical) % 2 == 0)
		{
			lines.add(m);
			locations.add(vLoc + m + 1);
		}
		
		int xor = 0;
		for(int z = 0; z < lines.size(); z++)
		{
			xor ^= lines.get(z);
		}
		
		int a;
		for(a = 30; a >= 0; a--)
		{
			if((xor & (1 << a)) > 0)
			{
				break;
			}
		}
		
		if(xor == 0)
		{
			System.out.println("SECOND");
		}
		else
		{
			System.out.println("FIRST");
			
			for(int b = 0; b < lines.size(); b++)
			{
				if((lines.get(b) & (1 << a)) > 0)
				{
					int nextMove = lines.get(b);
					
					for(int c = a; c >= 0; c--)
					{
						if((xor & (1 << c)) > 0)
						{
							nextMove ^= (1 << c);
						}
					}
					
					int amount = lines.get(b) - nextMove;
					
					int dir = locations.get(b);
					if(dir <= m)
					{
						Cut search = new Cut(0, dir, 1, dir);
						int index = Arrays.binarySearch(cuts, search);
						
						if(index < 0)
						{
							index = -(index + 1);
						}
						
						int end = amount;
						int max = 0;
						while(index < cuts.length && cuts[index].y1 == cuts[index].y2 && cuts[index].y1 == dir && cuts[index].x1 < end)
						{
							if(cuts[index].x1 < max)
							{
								end += Math.max(0, cuts[index].x2 - max);
								max = Math.max(max, cuts[index].x2);
							}
							else
							{
								end += cuts[index].x2 - cuts[index].x1;
								max = cuts[index].x2;
							}
							
							index++;
						}
						
						System.out.println("0 " + dir + " " + end + " " + dir);
					}
					else
					{
						dir -= m + 1;
						
						Cut search = new Cut(dir, 0, dir, 1);
						int index = Arrays.binarySearch(cuts, search);
						
						if(index < 0)
						{
							index = -(index + 1);
						}
						
						int end = amount;
						int max = 0;
						while(index < cuts.length && cuts[index].x1 == cuts[index].x2 && cuts[index].x1 == dir && cuts[index].y1 < end)
						{
							if(cuts[index].y1 < max)
							{
								end += Math.max(0, cuts[index].y2 - max);
								max = Math.max(max, cuts[index].y2);
							}
							else
							{
								end += cuts[index].y2 - cuts[index].y1;
								max = cuts[index].y2;
							}
							
							index++;
						}
						
						System.out.println(dir + " 0 " + dir + " " + end);
					}
					
					break;
				}
			}
		}	
	}
}

class Cut implements Comparable<Cut>
{
	int x1;
	int y1;
	int x2;
	int y2;
	
	public Cut(int xb, int yb, int xe, int ye)
	{
		if(yb == ye)
		{
			if(xb < xe)
			{
				x1 = xb;
				y1 = yb;
				x2 = xe;
				y2 = ye;
			}
			else
			{
				x1 = xe;
				y1 = ye;
				x2 = xb;
				y2 = yb;
			}
		}
		else
		{
			if(yb < ye)
			{
				x1 = xb;
				y1 = yb;
				x2 = xe;
				y2 = ye;
			}
			else
			{
				x1 = xe;
				y1 = ye;
				x2 = xb;
				y2 = yb;
			}
		}
	}
	
	public int compareTo(Cut o)
	{
		if(y1 == y2)
		{
			if(o.y1 == o.y2)
			{
				if(y1 != o.y1)
				{
					return y1 - o.y1;
				}
				else
				{
					return x1 - o.x1;
				}
			}
			else
			{
				return -1;
			}
		}
		else
		{
			if(o.x1 == o.x2)
			{
				if(x1 != o.x1)
				{
					return x1 - o.x1;
				}
				else
				{
					return y1 - o.y1;
				}
			}
			else
			{
				return 1;
			}
		}
	}
}