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.Map;
import java.util.List;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.BufferedWriter;
import java.util.TreeMap;
import java.util.InputMismatchException;
import java.util.ArrayList;
import java.util.Set;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.Writer;
import java.util.Collections;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author Diego Huerfano ( diego.link )
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		OutputWriter out = new OutputWriter(outputStream);
		TaskE solver = new TaskE();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskE {
    public void solve(int testNumber, InputReader in, OutputWriter out) {
        final int n=in.readInt(), m=in.readInt(), k=in.readInt();
        Map<Integer, Integer> mapRow=new TreeMap<Integer, Integer>();
        Map<Integer, Integer> mapCol=new TreeMap<Integer, Integer>();
        Map<Integer, Integer> invRow=new TreeMap<Integer, Integer>();
        Map<Integer, Integer> invCol=new TreeMap<Integer, Integer>();
        List<ArrayList<Pair<Integer, Integer>>> segsRow=new ArrayList<ArrayList<Pair<Integer, Integer>>>();
        List<ArrayList<Pair<Integer, Integer>>> segsCol=new ArrayList<ArrayList<Pair<Integer, Integer>>>();
        int cntRow=0, cntCol=0;
        for( int i=0; i<k; i++ ) {
            int xb=in.readInt();
            int yb=in.readInt();
            int xe=in.readInt();
            int ye=in.readInt();
            if( xb==xe ) {
                if( !mapRow.containsKey( xb ) ) {
                     invRow.put( cntRow, xb );
                     mapRow.put( xb, cntRow++ );
                     segsRow.add( new ArrayList<Pair<Integer, Integer>>() );
                }
                if( yb>ye ) {
                    int tmp=yb;
                    yb=ye;
                    ye=tmp;
                }
                segsRow.get( mapRow.get( xb ) ).add( new Pair<Integer, Integer>( yb, ye ) );
            } else {
                if( !mapCol.containsKey( yb ) ){
                    invCol.put( cntCol, yb );
                    mapCol.put( yb, cntCol++ );
                    segsCol.add( new ArrayList<Pair<Integer, Integer>>() );
                }
                if( xb>xe ) {
                    int tmp=xb;
                    xb=xe;
                    xe=tmp;
                }
                segsCol.get( mapCol.get( yb ) ).add( new Pair<Integer, Integer>( xb, xe ) );
            }
        }

        for( int i=0; i<segsRow.size(); i++ )
            Collections.sort( segsRow.get( i ) );
        for( int i=0; i<segsCol.size(); i++ )
            Collections.sort( segsCol.get( i ) );

        List<Integer> piles=new ArrayList<Integer>( segsRow.size() + segsCol.size() );

        for( int i=0; i<segsRow.size(); i++  ){
            ArrayList<Pair<Integer, Integer>> row=segsRow.get( i );
            int last=0;
            int pileSize=0;
            for( int j=0; j<row.size(); j++ ) {
                pileSize+=row.get( j ).first-last;
                last=Math.max( last, row.get( j ).second );
                while( j+1<row.size() && row.get( j+1 ).first<=last  ) {
                    j++;
                    last=Math.max( last, row.get( j ).second );
                }
            }
            pileSize+=m-last;
            piles.add( pileSize );
        }
        for( int i=0; i<segsCol.size(); i++  ){
            ArrayList<Pair<Integer, Integer>> col=segsCol.get( i );
            int last=0;
            int pileSize=0;
            for( int j=0; j<col.size(); j++ ) {
                pileSize+=col.get( j ).first-last;
                last=Math.max( last, col.get( j ).second );
                while( j+1<col.size() && col.get( j+1 ).first<=last  ) {
                    j++;
                    last=Math.max( last, col.get( j ).second );
                }
            }
            pileSize+=n-last;
            piles.add( pileSize );
        }
        int addRow=0, addCol=0;
        if( (n-1-segsRow.size())%2!=0 ) addRow=m;
        if( (m-1-segsCol.size())%2!=0 ) addCol=n;

        int nim=addRow^addCol;
        for( int size : piles ) {
            nim^=size;
        }
        if( nim==0 ) out.printLine( "SECOND" );
        else {
            out.printLine( "FIRST" );
            int freeRow=1, freeCol=1;
            for( int key : mapRow.keySet() ) {
                if( freeRow!=key ) break;
                freeRow++;
            }
            for( int key : mapCol.keySet() ) {
                if( freeCol!=key ) break;
                freeCol++;
            }
            for( int i=0; i<piles.size(); i++ ) {
                if( (nim^piles.get( i )) < piles.get( i ) ) {
                    int len=piles.get( i )-(nim^piles.get( i ));
                    if( i<segsRow.size() ) {
                        ArrayList<Pair<Integer, Integer>> row=segsRow.get( i );
                        int last=0;
                        int acc=0;
                        for( int j=0; j<row.size(); j++ ) {
                            acc+=row.get( j ).first-last;
                            if( acc>=len ) {
                                out.printLine( invRow.get(i) + " " + 0 + " " + invRow.get(i) + " " + (row.get( j ).first-(acc-len)) );
                                return;
                            }
                            last=Math.max( last, row.get( j ).second );
                            while( j+1<row.size() && row.get( j+1 ).first<=last  ) {
                                j++;
                                last=Math.max( last, row.get( j ).second );
                            }
                        }
                        acc+=m-last;
                        out.printLine( invRow.get(i) + " " + 0 + " " + invRow.get(i) + " " + (m-(acc-len)) );
                    } else {
                        ArrayList<Pair<Integer, Integer>> col=segsCol.get( i-segsRow.size() );
                        int last=0;
                        int acc=0;
                        for( int j=0; j<col.size(); j++ ) {
                            acc+=col.get( j ).first-last;
                            if( acc>=len ) {
                                out.printLine( 0 + " " + invCol.get(i-segsRow.size()) + " " + (col.get( j ).first-(acc-len)) + " " + invCol.get(i-segsRow.size()) );
                                return;
                            }
                            last=Math.max( last, col.get( j ).second );
                            while( j+1<col.size() && col.get( j+1 ).first<=last  ) {
                                j++;
                                last=Math.max( last, col.get( j ).second );
                            }
                        }
                        acc+=n-last;
                        out.printLine( 0 + " " + invCol.get(i-segsRow.size()) + " " + (n-(acc-len)) + " " + invCol.get(i-segsRow.size()) );
                    }
                    return;
                }
            }
            if( (nim^addRow)<addRow ) {
                int len=addRow-(nim^addRow);
                out.printLine( freeRow + " " + 0 + " " + freeRow + " " + len );
            } else {
                int len=addCol-(nim^addCol);
                out.printLine( 0 + " " + freeCol + " " + len + " " + freeCol );
            }
        }
    }
}

class InputReader {

    private InputStream stream;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;
    private SpaceCharFilter filter;

    public InputReader(InputStream stream) {
        this.stream = stream;
    }

    public int read() {
        if (numChars == -1)
            throw new InputMismatchException();
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (numChars <= 0)
                return -1;
        }
        return buf[curChar++];
    }

    public int readInt() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public boolean isSpaceChar(int c) {
        if (filter != null)
            return filter.isSpaceChar(c);
        return isWhitespace(c);
    }

    public static boolean isWhitespace(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    public interface SpaceCharFilter {
        public boolean isSpaceChar(int ch);
    }
}

class OutputWriter {
    private final PrintWriter writer;

    public OutputWriter(OutputStream outputStream) {
        writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
    }

    public OutputWriter(Writer writer) {
        this.writer = new PrintWriter(writer);
    }

    public void print(Object...objects) {
        for (int i = 0; i < objects.length; i++) {
            if (i != 0)
                writer.print(' ');
            writer.print(objects[i]);
        }
    }

    public void printLine(Object...objects) {
        print( objects );
        writer.println();
    }

    public void close() {
        writer.close();
    }
}

class Pair<U extends Comparable<U>, V extends Comparable<V> > implements Comparable<Pair<U, V> >{

    public U first;
    public V second;

    public Pair( U first, V second ) {
        this.first =first;
        this.second=second;
    }

    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof Pair)) return false;
        Pair pair = (Pair) o;
        if (!first.equals(pair.first)) return false;
        if (!second.equals(pair.second)) return false;
        return true;
    }

    public int hashCode() {
        int result = first.hashCode();
        result = 31 * result + second.hashCode();
        return result;
    }

    public int compareTo(Pair<U, V> o) {
        int cmp=first.compareTo( o.first );
        if( cmp==0 ) return second.compareTo( second );
        else return cmp;
    }
}