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.Arrays;
import java.util.Comparator;
import java.util.StringTokenizer;


public class E {	
	BufferedReader reader;
    StringTokenizer tokenizer;
    PrintWriter out;
    
    public class Cut{
    	int start;
    	int end;
    	public Cut(int start, int end){
    		this.start = start;
    		this.end = end;
    	}
    }
    
	public void solve() throws IOException {				
		int N = nextInt(); int M = nextInt(); int K = nextInt();
		
		int xcuts_size = 0; 
		int ycuts_size = 0;
		int[][] xcuts = new int[K][]; 
		int[][] ycuts = new int[K][];
		
		for(int i = 0; i < K; i++){
			int xb = nextInt(); int yb = nextInt(); int xe = nextInt(); int ye = nextInt();
			if( xb == xe )
				ycuts[ycuts_size++] = new int[]{xb, Math.min(yb, ye), Math.max(yb, ye)};
			else
				xcuts[xcuts_size++] = new int[]{yb, Math.min(xb, xe), Math.max(xb, xe)};
		}
		
		xcuts = Arrays.copyOf(xcuts, xcuts_size);
		ycuts = Arrays.copyOf(ycuts, ycuts_size);
		Comparator<int[]> cmp = new Comparator<int[]>(){
			public int compare(int[] a, int[] b) {
				if(a[0] != b[0])return a[0] - b[0];
				return a[1] - b[1];
			}
		};		
		Arrays.sort(xcuts, cmp);
		Arrays.sort(ycuts, cmp);
		int nim1 = getNim(xcuts, M, N);
		int nim2 = getNim(ycuts, N, M);
		int nim = nim1 ^ nim2;
		if( nim == 0){
			out.println("SECOND");
		}
		else{
			out.println("FIRST");
			if( !firstMove(xcuts, M, N, nim, true) ){
				firstMove(ycuts, N, M, nim, false);
			}
		}
	}
	
	public boolean firstMove(int[][] xcuts, int N, int M, int nim, boolean isX){
		int i = 0;
		int cut_count = 0;
		
		while(i < xcuts.length){
			int j = i;
			while(j < xcuts.length-1 && xcuts[j+1][0] == xcuts[i][0]) j++;			
			int len = 0;
			int last = 0;
			for(int k = i; k <= j; k++){
				int real_start = Math.max( last, xcuts[k][1] );
				len += Math.max(0, xcuts[k][2] - real_start);
				last = Math.max(last, xcuts[k][2]);				
			}
			len = M - len;
						
			if( len >= (len ^ nim) ){
				int cut_need = len - (len ^ nim);
				int cut_till = 0;
				int cut_len = 0;
				int unfirst = 0;				
				for(int k = i; k <= j; k++){
					int cur_len = Math.max(0, xcuts[k][1] - unfirst);
					if(cur_len > 0){
						if( cut_len + cur_len <= cut_need ){
							cut_len += cur_len;
							cut_till = xcuts[k][1];
							if(cut_len == cut_need)
								break;
						}
						else{
							cut_till = unfirst + (cut_need-cut_len); 
							break;
						}						
					}
					unfirst = Math.max(unfirst, xcuts[k][2]);					
					if( k == j && cut_len < cut_need ){
						cut_till = unfirst + (cut_need - cut_len);
					}
				}
				
				if( isX )
					out.println( 0 + " " + xcuts[i][0] + " " + cut_till + " " + xcuts[i][0] );															
				else
					out.println( xcuts[i][0] + " " + 0 + " " + xcuts[i][0] + " " + cut_till );
				return true;
			}	
			i = j+1;
			cut_count++;
		}
		
//		out.println( "conditions: " + nim + ", " + M + ", " + (M^nim)  + ", " + isX);
		
		if( N-1 > cut_count) {			
			if( M >= (M ^ nim) ){
				int cut_need = M - (M ^ nim);
				
				int current_m = 1;
				for(int k = 0; k < xcuts.length; k++){
					if( xcuts[k][0] > current_m){
						break;
					}		
					else if( xcuts[k][0] == current_m ){
						current_m++;
					}
				}	
				
//				out.println( (N-1) + ": " + cut_count + ", " + xcuts.length + ": " + isX );
				
				if( isX )
					out.println( 0 + " " + current_m + " " + cut_need + " " + current_m );															
				else
					out.println( current_m + " " + 0 + " " + current_m + " " + cut_need );
				
				return true;
			}
		}
		
		return false;
	}
	
	public int getNim(int[][] xcuts, int N, int M){
		int nim = 0;
		int i = 0;
		int cut_count = 0;
		while(i < xcuts.length){
			int j = i;
			while(j < xcuts.length-1 && xcuts[j+1][0] == xcuts[i][0]) j++;
			int len = 0;
			int last = 0;
			for(int k = i; k <= j; k++){
				int real_start = Math.max( last, xcuts[k][1] );
				len += Math.max(0, xcuts[k][2] - real_start);
				last = Math.max(last, xcuts[k][2]);				
			}
			len = M - len;
			nim = nim ^ len;
			i = j+1;
			cut_count++;
		}
		if( (N-1-cut_count) % 2 == 1){
			nim = nim ^ M;
		}
		return nim;
	}
	
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		new E().run();
	}
	
	public void run() {
        try {
            reader = new BufferedReader(new InputStreamReader(System.in));
            tokenizer = null;
            out = new PrintWriter(System.out);
            solve();
            reader.close();
            out.close();
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(1);
        }
    }

    int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }

    long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }

    double nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }

    String nextToken() throws IOException {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            tokenizer = new StringTokenizer(reader.readLine());
        }
        return tokenizer.nextToken();
    }

}