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.List;
import java.io.IOException;
import java.util.Arrays;
import java.util.InputMismatchException;
import java.util.ArrayList;
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 emotionalBlind
 */
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);
		TaskC solver = new TaskC();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskC {
    public void solve(int testNumber, InputReader in, OutputWriter out) {
        int n = in.readInt();
        int m = in.readInt();
        List<Pair<Integer, Pair<Integer, Integer>>> vers = new ArrayList<Pair<Integer, Pair<Integer, Integer>>>(0);
        List<Pair<Integer, Pair<Integer, Integer>>> hors = new ArrayList<Pair<Integer, Pair<Integer, Integer>>>(0);
        int k = in.readInt();
        for (int i = 0; i < k; ++i) {
            int x1 = in.readInt();
            int y1 = in.readInt();
            int x2 = in.readInt();
            int y2 = in.readInt();

            if (x1 == x2) {  // vertical
                if (y1 > y2) {
                    int temp = y1;
                    y1 = y2;
                    y2 = temp;
                }
                vers.add(new Pair<Integer, Pair<Integer, Integer>>(x1, new Pair<Integer, Integer>(y1, y2)));
            } else {
                if (x1 > x2) {
                    int temp = x1;
                    x1 = x2;
                    x2 = temp;
                }
                hors.add(new Pair<Integer, Pair<Integer, Integer>>(y1, new Pair<Integer, Integer>(x1, x2)));
            }
        }
        Collections.sort(vers);
        Collections.sort(hors);
        int[] vs = new int[32];
        int[] vinds = new int[32];
        int[] hs = new int[32];
        int[] hinds = new int[32];
        Arrays.fill(vs, -1);
        Arrays.fill(hs, -1);
        Arrays.fill(vinds, -1);
        Arrays.fill(hinds, - 1);

        Result r1 = calc(vers, n, m, vinds, vs);
        Result r2 = calc(hors, m, n, hinds, hs);

        int xor = r1.xor ^ r2.xor;
        if (xor == 0) {
            out.printLine("SECOND");
        } else {
            out.printLine("FIRST");
            int num_bit = 0;
            int temp = xor;
            while (temp > 0) {
                num_bit++;
                temp /= 2;
            }
            if (vinds[num_bit - 1] != -1) {
                int take = toCut(xor, vs[num_bit - 1], num_bit - 1);
                int to = vs[num_bit - 1] == m ? take : getRange(vers, vinds[num_bit - 1], take, m);
                out.printLine(vinds[num_bit - 1] + " " + 0 + " " + vinds[num_bit - 1] + " " + to);
            } else {
                int take = toCut(xor, hs[num_bit - 1], num_bit - 1);
                int to = hs[num_bit - 1] == n ? take : getRange(hors, hinds[num_bit - 1], take, n);
                out.printLine(0 + " " + hinds[num_bit - 1] + " " + to + " " + hinds[num_bit - 1]);
            }
        }
    }



    int toCut(int xor, int max, int ind) {
        int take = 0;
        int _max = max;
        for (int i = ind; i >= 0; --i) {
            if ((xor & (1 << i)) > 0) {
                max ^= (1 << i);
            }
        }
        return _max - max;
    }

    static class Result {
        int max;
        int xor;
        int ind;
        boolean isfree = false;
    }

    int calc(int n, int m) {
        if (n % 2 == 0) return m;
        else return 0;
    }

    int getRange(List<Pair<Integer, Pair<Integer, Integer>>> segs, int ind, int take, int m) {
        int start = 0;
        while (start < segs.size()) {
            int cur_value = segs.get(start).getFirst().intValue();
            if (cur_value == ind) {
                break;
            }
            start++;
        }
        int end = start + 1;
        while (end < segs.size()) {
            int cur_value = segs.get(end).getFirst().intValue();
            if (cur_value != ind) {
                break;
            }
            end++;
        }
        int lo = 1;
        int hi = m;
        while (lo < hi) {
            int mid = (lo + hi) / 2;
            int to_cut = -1;
            int total_cut = 0;
            for (int i = start; i < end; ++i) {
                int u = segs.get(i).getSecond().getFirst().intValue();
                int v = segs.get(i).getSecond().getSecond().intValue();
                if (v > mid) v = mid;

                if (u >= mid) {
                    break;
                }
                if (u > to_cut) {
                    total_cut += v - u;
                } else {
                    if (v > to_cut) {
                        total_cut += v - to_cut;
                    }
                }
                to_cut = Math.max(to_cut, v);
            }
            if (mid - total_cut >= take) {
                hi = mid;
            } else {
                lo = mid + 1;
            }
        }
        return lo;
    }

    void update(int n, int ind, int[] inds, int[] vals) {
        int i = 0;
        int _n = n;
        while (n > 0) {
            if (n % 2 == 1) {
                vals[i] = _n;
                inds[i] = ind;
            }
            n /= 2;
            i++;
        }
    }

    Result calc(List<Pair<Integer, Pair<Integer, Integer>>> segs, int n, int m, int[] inds, int[] vals) {
        int last = 0;
        Result r = new Result();
        r.max = 0;
        int pos = 0;
        r.xor = calc(n, m);
        while (pos < segs.size()) {
            int last_pos = pos + 1;
            int cur_value = segs.get(pos).getFirst().intValue();
            while (last_pos < segs.size() && segs.get(last_pos).getFirst().intValue() == cur_value) {
                last_pos++;
            }
            int to_cut = -1;
            int total_cut = 0;
            for (int i = pos; i < last_pos; ++i) {
                int u = segs.get(i).getSecond().getFirst().intValue();
                int v = segs.get(i).getSecond().getSecond().intValue();
                if (u > to_cut) {
                    total_cut += v - u;
                } else {
                    if (v > to_cut) {
                        total_cut += v - to_cut;
                    }
                }
                to_cut = Math.max(to_cut, v);
            }
            int new_m = m - total_cut;
            update(new_m, cur_value, inds, vals);
            r.xor ^= m;
            r.xor ^= new_m;

            pos = last_pos;

            if (cur_value - 1 > last) {
                r.max = m;
                r.isfree = true;
                r.ind = cur_value - 1;
                update(m, cur_value - 1, inds, vals);
            } else {
                if (new_m > r.max) {
                    r.max = new_m;
                    r.ind = cur_value;
                }
            }
            last = cur_value;
        }
        if (last < n - 1) {
            r.max = m;
            r.isfree = true;
            r.ind = n - 1;
            update(m, n - 1, inds, vals);
        }
        return r;
    }
}

class InputReader {

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

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

    public int read() {
        // InputMismatchException -> UnknownError
        if (numChars == -1)
            throw new UnknownError();
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = stream.read(buf);
            } catch (IOException e) {
                throw new UnknownError();
            }
            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();
        } else if (c == '+') {
            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 static boolean isSpaceChar(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    }

class OutputWriter {
    private final PrintWriter writer;

    public OutputWriter(OutputStream outputStream) {
        writer = new PrintWriter(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<T extends Comparable<T>, S extends Comparable<S>>
    implements Comparable<Pair<T, S>>
{
    public Pair(T f, S s)
    {
        first = f;
        second = s;
    }

    public T getFirst()
    {
        return first;
    }

    public S getSecond()
    {
        return second;
    }

    public String toString()
    {
        return "(" + first.toString() + ", " + second.toString() + ")";
    }

    public int compareTo(Pair<T, S> that)
    {
        int c = this.first.compareTo(that.getFirst());
        if (c == 0) {
            return this.second.compareTo(that.getSecond());
        }
        return c;
    }

    private T first;
    private S second;
}