#include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
struct aa{
    int x1,y1,x2,y2;
}a[100010],b[100010];
struct aaa{
    int len,x1,x2,y1,y2;
}ans[500000];
int sum=0;
int sta,cnt;
int n,m,t;
int cmp1(aa x,aa y){
    if (x.x1!=y.x1) return x.x1<y.x1;
    return x.y1<y.y1;
}
int cmp2(aa x,aa y){
    if (x.y1!=y.y1) return x.y1<y.y1;
    return x.x1<y.x1;
}
void updata(int len,int x1,int x2,int y1,int y2){
    if (len>0){
        printf("%d\n",len);
        //printf("%d\n",len);
        ans[sum].len=len;
        ans[sum].x1=x1;ans[sum].x2=x2;
        ans[sum].y1=y1;ans[sum].y2=y2;
        sum++;
    }
}
void solve(){
    int i,t,j,len;
    sta=t=0;
    for (i=0;i<sum;i++){
        if (ans[i].x1==ans[i].x2){
            t+=ans[i].len;
            if (i==sum-1||(i<sum-1&&ans[i+1].x1==ans[i+1].x2&&ans[i+1].x1>ans[i].x1)
                ||(i<sum-1&&ans[i+1].y1==ans[i+1].y2)){
                sta=sta^t;
                t=0;
            }
        }else{
            t+=ans[i].len;
            if (i==sum-1||(i<sum-1&&ans[i+1].y1>ans[i].y1)){
                sta=sta^t;
                t=0;
            }
        }
    }
    if (sta==0){
        printf("SECOND\n");
        return;
    }
    printf("FIRST\n");
    for (i=0;i<sum;i++){
        if (ans[i].x1==ans[i].x2){
            t+=ans[i].len;
            if (i==sum-1||(i<sum-1&&ans[i+1].x1==ans[i+1].x2&&ans[i+1].x1>ans[i].x1)
                ||(i<sum-1&&ans[i+1].y1==ans[i+1].y2)){
                len=t-(sta^t);
                if (len>0){
                    for (j=i;;j--){
                        t-=ans[j].len;
                        if (t<len) break;
                    }
                    if (t>0)
                        printf("%d %d %d %d\n",ans[i].x1,0,ans[i].x1,ans[j].y1+len-t);
                    else
                        printf("%d %d %d %d\n",ans[i].x1,0,ans[i].x1,len);
                    return;
                }
                t=0;
            }
        }else{
            t+=ans[i].len;
            if (i==sum-1||(i<sum-1&&ans[i+1].y1>ans[i].y1)){
                len=t-(sta^t);
                if (len>0){
                    for (j=i;;j--){
                        t-=ans[j].len;
                        if (t<len) break;
                    }
                    if (t>0)
                        printf("%d %d %d %d\n",0,ans[i].y1,ans[j].x1+len-t,ans[i].y1);
                    else
                        printf("%d %d %d %d\n",0,ans[i].y1,len,ans[i].y1);
                    return;
                }
                t=0;
            }
        }
    }

}

int main(){
    //freopen("c.in","r",stdin);
    int i,len,tx,ty;
    scanf("%d%d%d",&n,&m,&t);
    for (i=0;i<t;i++){
        scanf("%d%d%d%d",&a[i].x1,&a[i].y1,&a[i].x2,&a[i].y2);
    }
    b[0].x1=b[0].x2=0;
    b[0].y1=0;b[0].y2=m;
    cnt=1;
    for (i=0;i<t;i++){
        if (a[i].x1==a[i].x2){
            b[cnt]=a[i];
            if (b[cnt].y1>b[cnt].y2) swap(b[cnt].y1,b[cnt].y2);
            cnt++;
        }
    }
    b[cnt].x1=b[cnt].x2=n;
    b[cnt].y1=0;b[cnt].y2=m;
    cnt++;
    sta=0;
    sort(b,b+cnt,cmp1);
    tx=0;ty=m;
    for (i=1;i<cnt;i++){
        if (b[i].x1!=b[i-1].x1){
            len=m-ty;
            updata(len,b[i-1].x1,b[i-1].x1,b[i-1].y2,m);
            if (b[i].x1-b[i-1].x1>1){
                if ((b[i].x1-b[i-1].x1-1)%2==1)
                    updata(m,b[i].x1-1,b[i].x1-1,0,m);
            }
            len=b[i].y1;
            updata(len,b[i].x1,b[i].x1,ty,b[i].y1);
            ty=b[i].y2;
        }else{
            len=b[i].y1-ty;
            if (len>0){
                updata(len,b[i].x1,b[i].x1,ty,b[i].y1);
            }
            ty=max(ty,b[i].y2);
        }
    }
    b[0].y1=b[0].y1=0;
    b[0].x1=0;b[0].x2=n;
    cnt=1;
    for (i=0;i<t;i++){
        if (a[i].y1==a[i].y2){
            b[cnt]=a[i];
            if (b[cnt].x1>b[cnt].x2) swap(b[cnt].x1,b[cnt].x2);
            cnt++;
        }
    }
    b[cnt].y1=b[cnt].y2=m;
    b[cnt].x1=0;b[cnt].x2=n;
    cnt++;
    sort(b,b+cnt,cmp2);
    tx=n;
    for (i=1;i<cnt;i++){
        if (b[i].y1!=b[i-1].y1){
            len=n-tx;
            updata(len,b[i-1].x2,n,b[i-1].y1,b[i-1].y1);
            if (b[i].y1-b[i-1].y1>1){
                if ((b[i].y1-b[i-1].y1-1)%2==1){
                    updata(n,0,n,b[i].y1-1,b[i].y1-1);
                }
            }
            len=b[i].x1;
            updata(len,0,b[i].x1,b[i].y1,b[i].y2);
            tx=b[i].x2;
        }else{
            len=b[i].x1-tx;
            if (len>0){
                updata(len,tx,b[i].x1,b[i].y1,b[i].y1);
            }
            tx=max(b[i].x2,tx);
        }
    }
    solve();
    //while (1);
    return 0;
}


#include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
struct aa{
    int x1,y1,x2,y2;
}a[100010],b[100010];
struct aaa{
    int len,x1,x2,y1,y2;
}ans[500000];
int sum=0;
int sta,cnt;
int n,m,t;
int cmp1(aa x,aa y){
    if (x.x1!=y.x1) return x.x1<y.x1;
    return x.y1<y.y1;
}
int cmp2(aa x,aa y){
    if (x.y1!=y.y1) return x.y1<y.y1;
    return x.x1<y.x1;
}
void updata(int len,int x1,int x2,int y1,int y2){
    if (len>0){
        ans[sum].len=len;
        ans[sum].x1=x1;ans[sum].x2=x2;
        ans[sum].y1=y1;ans[sum].y2=y2;
        sum++;
    }
}
int main(){
    //freopen("c.in","r",stdin);
    int i,len,tx,ty;
    scanf("%d%d%d",&n,&m,&t);
    for (i=0;i<t;i++){
        scanf("%d%d%d%d",&a[i].x1,&a[i].y1,&a[i].x2,&a[i].y2);
    }
    b[0].x1=b[0].x2=0;
    b[0].y1=0;b[0].y2=m;
    cnt=1;
    for (i=0;i<t;i++){
        if (a[i].x1==a[i].x2){
            b[cnt]=a[i];
            if (b[cnt].y1>b[cnt].y2) swap(b[cnt].y1,b[cnt].y2);
            cnt++;
        }
    }
    b[cnt].x1=b[cnt].x2=n;
    b[cnt].y1=0;b[cnt].y2=m;
    cnt++;
    sta=0;
    sort(b,b+cnt,cmp1);
    tx=0;ty=m;
    for (i=1;i<cnt;i++){
        if (b[i].x1!=b[i-1].x1){
            len=m-ty;
            sta^=len;
            updata(len,b[i-1].x1,b[i-1].x1,b[i-1].y2,m);
            sta^=((b[i].x1-b[i-1].x1-1)%2*m);
            if (b[i].x1-b[i-1].x1>1) updata(m,b[i].x1-1,b[i].x1-1,0,m);
            len=b[i].y1;
            sta^=len;
            updata(len,b[i].x1,b[i].x1,ty,b[i].y1);
            ty=b[i].y2;
        }else{
            len=b[i].y1-ty;
            if (len>0){
                sta^=len;
                updata(len,b[i].x1,b[i].x1,ty,b[i].y1);
            }
            ty=max(ty,b[i].y2);
        }
    }
    b[0].y1=b[0].y1=0;
    b[0].x1=0;b[0].x2=n;
    cnt=1;
    for (i=0;i<t;i++){
        if (a[i].y1==a[i].y2){
            b[cnt]=a[i];
            if (b[cnt].x1>b[cnt].x2) swap(b[cnt].x1,b[cnt].x2);
            cnt++;
        }
    }
    b[cnt].y1=b[cnt].y2=m;
    b[cnt].x1=0;b[cnt].x2=n;
    cnt++;
    sort(b,b+cnt,cmp2);
    tx=n;
    for (i=1;i<cnt;i++){
        if (b[i].y1!=b[i-1].y1){
            len=n-tx;
            sta^=len;
            updata(len,b[i-1].x2,n,b[i-1].y1,b[i-1].y1);
            sta^=((b[i].y1-b[i-1].y1-1)%2*n);
            if (b[i].y1-b[i-1].y1>1) updata(n,0,n,b[i].y1-1,b[i].y1-1);
            len=b[i].x1;
            sta^=len;
            updata(len,0,b[i].x1,b[i].y1,b[i].y2);
            tx=b[i].x2;
        }else{
            len=b[i].x1-tx;
            if (len>0){
                sta^=len;
                updata(len,b[i-1].x2,b[i].x1,b[i].y1,b[i].y1);
            }
            tx=max(b[i].x2,tx);
        }
    }
    //printf("%d\n",sta);
    if (sta==0){
        printf("SECOND\n");
    }else{
        printf("FIRST\n");
        for (i=0;i<sum;i++){
            len=ans[i].len-(sta^ans[i].len);
            if (len>0){
                if (ans[i].x1==ans[i].x2) printf("%d %d %d %d\n",ans[i].x1,ans[i].y1,ans[i].x2,ans[i].y1+len);
                else printf("%d %d %d %d\n",ans[i].x1,ans[i].y1,ans[i].x1+len,ans[i].y2);
                break;
            }
        }
    }
    //while (1);
    return 0;
}


#include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
struct aa{
    int x1,y1,x2,y2;
}a[100010],b[100010];
struct aaa{
    int len,x1,x2,y1,y2;
}ans[500000];
int sum=0;
int sta,cnt;
int n,m,t;
int cmp1(aa x,aa y){
    if (x.x1!=y.x1) return x.x1<y.x1;
    return x.y1<y.y1;
}
int cmp2(aa x,aa y){
    if (x.y1!=y.y1) return x.y1<y.y1;
    return x.x1<y.x1;
}
void updata(int len,int x1,int x2,int y1,int y2){
    if (len>0){
        ans[sum].len=len;
        ans[sum].x1=x1;ans[sum].x2=x2;
        ans[sum].y1=y1;ans[sum].y2=y2;
        sum++;
    }
}
int main(){
    //freopen("c.in","r",stdin);
    int i,len,tx,ty;
    scanf("%d%d%d",&n,&m,&t);
    for (i=0;i<t;i++){
        scanf("%d%d%d%d",&a[i].x1,&a[i].y1,&a[i].x2,&a[i].y2);
    }
    b[0].x1=b[0].x2=0;
    b[0].y1=0;b[0].y2=m;
    cnt=1;
    for (i=0;i<t;i++){
        if (a[i].x1==a[i].x2){
            b[cnt]=a[i];
            if (b[cnt].y1>b[cnt].y2) swap(b[cnt].y1,b[cnt].y2);
            cnt++;
        }
    }
    b[cnt].x1=b[cnt].x2=n;
    b[cnt].y1=0;b[cnt].y2=m;
    cnt++;
    sta=0;
    sort(b,b+cnt,cmp1);
    tx=0;ty=m;
    for (i=1;i<cnt;i++){
        if (b[i].x1!=b[i-1].x1){
            len=m-ty;
            sta^=len;
            updata(len,b[i-1].x1,b[i-1].x1,b[i-1].y2,m);
            sta^=((b[i].x1-b[i-1].x1-1)%2*m);
            if (b[i].x1-b[i-1].x1>1) updata(m,b[i].x1-1,b[i].x1-1,0,m);
            len=b[i].y1;
            sta^=len;
            updata(len,b[i].x1,b[i].x1,ty,b[i].y1);
            ty=b[i].y2;
        }else{
            len=b[i].y1-ty;
            if (len>0){
                sta^=len;
                updata(len,b[i].x1,b[i].x1,ty,b[i].y1);
            }
            ty=max(ty,b[i].y2);
        }
    }
    b[0].y1=b[0].y1=0;
    b[0].x1=0;b[0].x2=n;
    cnt=1;
    for (i=0;i<t;i++){
        if (a[i].y1==a[i].y2){
            b[cnt]=a[i];
            if (b[cnt].x1>b[cnt].x2) swap(b[cnt].x1,b[cnt].x2);
            cnt++;
        }
    }
    b[cnt].y1=b[cnt].y2=m;
    b[cnt].x1=0;b[cnt].x2=n;
    cnt++;
    sort(b,b+cnt,cmp2);
    tx=n;
    for (i=1;i<cnt;i++){
        if (b[i].y1!=b[i-1].y1){
            len=n-tx;
            sta^=len;
            updata(len,b[i-1].x2,n,b[i-1].y1,b[i-1].y1);
            sta^=((b[i].y1-b[i-1].y1-1)%2*n);
            if (b[i].y1-b[i-1].y1>1) updata(n,0,n,b[i].y1-1,b[i].y1-1);
            len=b[i].x1;
            sta^=len;
            updata(len,0,b[i].x1,b[i].y1,b[i].y2);
            tx=b[i].x2;
        }else{
            len=b[i].x1-tx;
            if (len>0){
                sta^=len;
                updata(len,b[i-1].x2,b[i].x1,b[i].y1,b[i].y1);
            }
            tx=max(b[i].x2,tx);
        }
    }
    //printf("%d\n",sta);
    if (sta==0){
        printf("SECOND\n");
    }else{
        printf("FIRST\n");
        for (i=0;i<sum;i++){
            len=ans[i].len-(sta^ans[i].len);
            if (len>0){
                if (ans[i].x1==ans[i].x2) printf("%d %d %d %d\n",ans[i].x1,ans[i].y1,ans[i].x2,ans[i].y1+len);
                else printf("%d %d %d %d\n",ans[sum].x1,ans[i].y1,ans[i].x1+len,ans[i].y2);
                break;
            }
        }
    }
    //while (1);
    return 0;
}


#include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
struct aa{
    int x1,y1,x2,y2;
}a[100010],b[100010];
struct aaa{
    int len,x1,x2,y1,y2;
}ans[500000];
int sum=0;
int sta,cnt;
int n,m,t;
int cmp1(aa x,aa y){
    if (x.x1!=y.x1) return x.x1<y.x1;
    return x.y1<y.y1;
}
int cmp2(aa x,aa y){
    if (x.y1!=y.y1) return x.y1<y.y1;
    return x.x1<y.x1;
}
void updata(int len,int x1,int x2,int y1,int y2){
    if (len>0){
        //printf("%d\n",len);
        if (sum>=500000) while (1);
        ans[sum].len=len;
        ans[sum].x1=x1;ans[sum].x2=x2;
        ans[sum].y1=y1;ans[sum].y2=y2;
        sum++;

    }
}
void solve(){
    int i,t,j,len;
    sta=t=0;
    for (i=0;i<sum;i++){
        if (ans[i].x1==ans[i].x2){
            t+=ans[i].len;
            if (i==sum-1||(i<sum-1&&ans[i+1].x1==ans[i+1].x2&&ans[i+1].x1>ans[i].x1)
                ||(i<sum-1&&ans[i+1].y1==ans[i+1].y2)){
                sta=sta^t;
                t=0;
            }
        }else{
            t+=ans[i].len;
            if (i==sum-1||(i<sum-1&&ans[i+1].y1>ans[i].y1)){
                sta=sta^t;
                t=0;
            }
        }
    }
    if (sta==0){
        printf("SECOND\n");
        return;
    }
    //printf("sta %d\n",sta);
    printf("FIRST\n");
    for (i=0;i<sum;i++){
        if (ans[i].x1==ans[i].x2){
            t+=ans[i].len;
            if (i==sum-1||(i<sum-1&&ans[i+1].x1==ans[i+1].x2&&ans[i+1].x1>ans[i].x1)
                ||(i<sum-1&&ans[i+1].y1==ans[i+1].y2)){
                len=t-(sta^t);
                if (len>0){
                    for (j=i;;j--){
                        t-=ans[j].len;
                        if (t<len) break;
                    }
                    if (n==1000&&m==1000&&t==100000)
                        printf("%d %d %d\n",len,t,ans[j].y1);
                    printf("%d %d %d %d\n",ans[i].x1,0,ans[i].x1,ans[j].y1+len-t);
                    return;
                }
                t=0;
            }
        }else{
            t+=ans[i].len;
            if (i==sum-1||(i<sum-1&&ans[i+1].y1>ans[i].y1)){
                len=t-(sta^t);
                if (len>0){
                    for (j=i;;j--){
                        t-=ans[j].len;
                        if (t<len) break;
                    }
                    printf("%d %d %d %d\n",0,ans[i].y1,ans[j].x1+len-t,ans[i].y1);
                    return;
                }
                t=0;
            }
        }
    }

}

int main(){
    //freopen("c.in","r",stdin);
    int i,len,tx,ty;
    scanf("%d%d%d",&n,&m,&t);
    for (i=0;i<t;i++){
        scanf("%d%d%d%d",&a[i].x1,&a[i].y1,&a[i].x2,&a[i].y2);
    }
    b[0].x1=b[0].x2=0;
    b[0].y1=0;b[0].y2=m;
    cnt=1;
    for (i=0;i<t;i++){
        if (a[i].x1==a[i].x2){
            b[cnt]=a[i];
            if (b[cnt].y1>b[cnt].y2) swap(b[cnt].y1,b[cnt].y2);
            cnt++;
        }
    }
    b[cnt].x1=b[cnt].x2=n;
    b[cnt].y1=0;b[cnt].y2=m;
    cnt++;
    sta=0;
    sort(b,b+cnt,cmp1);
    tx=0;ty=m;
    for (i=1;i<cnt;i++){
        if (b[i].x1!=b[i-1].x1){
            len=m-ty;
            updata(len,b[i-1].x1,b[i-1].x1,b[i-1].y2,m);
            if (b[i].x1-b[i-1].x1>1){
                if ((b[i].x1-b[i-1].x1-1)%2==1)
                    updata(m,b[i].x1-1,b[i].x1-1,0,m);
            }
            len=b[i].y1;
            updata(len,b[i].x1,b[i].x1,ty,b[i].y1);
            ty=b[i].y2;
        }else{
            len=b[i].y1-ty;
            if (len>0){
                updata(len,b[i].x1,b[i].x1,ty,b[i].y1);
            }
            ty=max(ty,b[i].y2);
        }
    }
    b[0].y1=b[0].y1=0;
    b[0].x1=0;b[0].x2=n;
    cnt=1;
    for (i=0;i<t;i++){
        if (a[i].y1==a[i].y2){
            b[cnt]=a[i];
            if (b[cnt].x1>b[cnt].x2) swap(b[cnt].x1,b[cnt].x2);
            cnt++;
        }
    }
    b[cnt].y1=b[cnt].y2=m;
    b[cnt].x1=0;b[cnt].x2=n;
    cnt++;
    sort(b,b+cnt,cmp2);
    tx=n;
    for (i=1;i<cnt;i++){
        if (b[i].y1!=b[i-1].y1){
            len=n-tx;
            updata(len,b[i-1].x2,n,b[i-1].y1,b[i-1].y1);
            if (b[i].y1-b[i-1].y1>1){
                if ((b[i].y1-b[i-1].y1-1)%2==1){
                    updata(n,0,n,b[i].y1-1,b[i].y1-1);
                }
            }
            len=b[i].x1;
            updata(len,0,b[i].x1,b[i].y1,b[i].y2);
            tx=b[i].x2;
        }else{
            len=b[i].x1-tx;
            if (len>0){
                updata(len,tx,b[i].x1,b[i].y1,b[i].y1);
            }
            tx=max(b[i].x2,tx);
        }
    }
    solve();
    //while (1);
    return 0;
}


#include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
struct aa{
    int x1,y1,x2,y2;
}a[100010],b[100010];
struct aaa{
    int len,x1,x2,y1,y2;
}ans[500000];
int sum=0;
int sta,cnt;
int n,m,tot;
int cmp1(aa x,aa y){
    if (x.x1!=y.x1) return x.x1<y.x1;
    return x.y1<y.y1;
}
int cmp2(aa x,aa y){
    if (x.y1!=y.y1) return x.y1<y.y1;
    return x.x1<y.x1;
}
void updata(int len,int x1,int x2,int y1,int y2){
    if (len>0){
        //printf("%d\n",len);
        if (sum>=500000) while (1);
        ans[sum].len=len;
        ans[sum].x1=x1;ans[sum].x2=x2;
        ans[sum].y1=y1;ans[sum].y2=y2;
        sum++;

    }
}
void solve(){
    int i,t,j,len;
    sta=t=0;
    for (i=0;i<sum;i++){
        if (ans[i].x1==ans[i].x2){
            t+=ans[i].len;
            if (i==sum-1||(i<sum-1&&ans[i+1].x1==ans[i+1].x2&&ans[i+1].x1>ans[i].x1)
                ||(i<sum-1&&ans[i+1].y1==ans[i+1].y2)){
                sta=sta^t;
                t=0;
            }
        }else{
            t+=ans[i].len;
            if (i==sum-1||(i<sum-1&&ans[i+1].y1>ans[i].y1)){
                sta=sta^t;
                t=0;
            }
        }
    }
    if (sta==0){
        printf("SECOND\n");
        return;
    }
    //printf("sta %d\n",sta);
    printf("FIRST\n");
    for (i=0;i<sum;i++){
        if (ans[i].x1==ans[i].x2){
            t+=ans[i].len;
            if (i==sum-1||(i<sum-1&&ans[i+1].x1==ans[i+1].x2&&ans[i+1].x1>ans[i].x1)
                ||(i<sum-1&&ans[i+1].y1==ans[i+1].y2)){
                len=t-(sta^t);
                if (len>0){
                    for (j=i;;j--){
                        t-=ans[j].len;
                        if (t<len) break;
                    }
                   // if (n==1000&&m==1000&&tot==100000)
                     //   printf("%d %d %d %d %d %d\n",len,t,ans[j].y1,ans[j].y2,j,ans[j].len);
                    printf("%d %d %d %d\n",ans[i].x1,0,ans[i].x1,ans[j].y1+len-t);
                    return;
                }
                t=0;
            }
        }else{
            t+=ans[i].len;
            if (i==sum-1||(i<sum-1&&ans[i+1].y1>ans[i].y1)){
                len=t-(sta^t);
                if (len>0){
                    for (j=i;;j--){
                        t-=ans[j].len;
                        if (t<len) break;
                    }
                    printf("%d %d %d %d\n",0,ans[i].y1,ans[j].x1+len-t,ans[i].y1);
                    return;
                }
                t=0;
            }
        }
    }

}

int main(){
    //freopen("c.in","r",stdin);
    int i,len,tx,ty;
    scanf("%d%d%d",&n,&m,&tot);
    for (i=0;i<tot;i++){
        scanf("%d%d%d%d",&a[i].x1,&a[i].y1,&a[i].x2,&a[i].y2);
    }
    b[0].x1=b[0].x2=0;
    b[0].y1=0;b[0].y2=m;
    cnt=1;
    for (i=0;i<tot;i++){
        if (a[i].x1==a[i].x2){
            b[cnt]=a[i];
            if (b[cnt].y1>b[cnt].y2) swap(b[cnt].y1,b[cnt].y2);
            cnt++;
        }
    }
    b[cnt].x1=b[cnt].x2=n;
    b[cnt].y1=0;b[cnt].y2=m;
    cnt++;
    sta=0;
    sort(b,b+cnt,cmp1);
    tx=0;ty=m;
    for (i=1;i<cnt;i++){
        if (b[i].x1!=b[i-1].x1){
            len=m-ty;
            updata(len,b[i-1].x1,b[i-1].x1,ty,m);
            if (b[i].x1-b[i-1].x1>1){
                if ((b[i].x1-b[i-1].x1-1)%2==1)
                    updata(m,b[i].x1-1,b[i].x1-1,0,m);
            }
            len=b[i].y1;
            updata(len,b[i].x1,b[i].x1,ty,b[i].y1);
            ty=b[i].y2;
        }else{
            len=b[i].y1-ty;
            if (len>0){
                updata(len,b[i].x1,b[i].x1,ty,b[i].y1);
            }
            ty=max(ty,b[i].y2);
        }
    }
    b[0].y1=b[0].y1=0;
    b[0].x1=0;b[0].x2=n;
    cnt=1;
    for (i=0;i<tot;i++){
        if (a[i].y1==a[i].y2){
            b[cnt]=a[i];
            if (b[cnt].x1>b[cnt].x2) swap(b[cnt].x1,b[cnt].x2);
            cnt++;
        }
    }
    b[cnt].y1=b[cnt].y2=m;
    b[cnt].x1=0;b[cnt].x2=n;
    cnt++;
    sort(b,b+cnt,cmp2);
    tx=n;
    for (i=1;i<cnt;i++){
        if (b[i].y1!=b[i-1].y1){
            len=n-tx;
            updata(len,tx,n,b[i-1].y1,b[i-1].y1);
            if (b[i].y1-b[i-1].y1>1){
                if ((b[i].y1-b[i-1].y1-1)%2==1){
                    updata(n,0,n,b[i].y1-1,b[i].y1-1);
                }
            }
            len=b[i].x1;
            updata(len,0,b[i].x1,b[i].y1,b[i].y2);
            tx=b[i].x2;
        }else{
            len=b[i].x1-tx;
            if (len>0){
                updata(len,tx,b[i].x1,b[i].y1,b[i].y1);
            }
            tx=max(b[i].x2,tx);
        }
    }
    solve();
    //while (1);
    return 0;
}


#include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
struct aa{
    int x1,y1,x2,y2;
}a[100010],b[100010];
struct aaa{
    int len,x1,x2,y1,y2;
}ans[500000];
int sum=0;
int sta,cnt;
int n,m,tot;
int cmp1(aa x,aa y){
    if (x.x1!=y.x1) return x.x1<y.x1;
    return x.y1<y.y1;
}
int cmp2(aa x,aa y){
    if (x.y1!=y.y1) return x.y1<y.y1;
    return x.x1<y.x1;
}
void updata(int len,int x1,int x2,int y1,int y2){
    if (len>0){
        //printf("%d\n",len);
        if (sum>=500000) while (1);
        ans[sum].len=len;
        ans[sum].x1=x1;ans[sum].x2=x2;
        ans[sum].y1=y1;ans[sum].y2=y2;
        sum++;

    }
}
void solve(){
    int i,t,j,len;
    sta=t=0;
    for (i=0;i<sum;i++){
        if (ans[i].x1==ans[i].x2){
            t+=ans[i].len;
            if (i==sum-1||(i<sum-1&&ans[i+1].x1==ans[i+1].x2&&ans[i+1].x1>ans[i].x1)
                ||(i<sum-1&&ans[i+1].y1==ans[i+1].y2)){
                sta=sta^t;
                t=0;
            }
        }else{
            t+=ans[i].len;
            if (i==sum-1||(i<sum-1&&ans[i+1].y1>ans[i].y1)){
                sta=sta^t;
                t=0;
            }
        }
    }
    if (sta==0){
        printf("SECOND\n");
        return;
    }
    //printf("sta %d\n",sta);
    printf("FIRST\n");
    for (i=0;i<sum;i++){
        if (ans[i].x1==ans[i].x2){
            t+=ans[i].len;
            if (i==sum-1||(i<sum-1&&ans[i+1].x1==ans[i+1].x2&&ans[i+1].x1>ans[i].x1)
                ||(i<sum-1&&ans[i+1].y1==ans[i+1].y2)){
                len=t-(sta^t);
                if (len>0){
                    for (j=i;;j--){
                        t-=ans[j].len;
                        if (t<len) break;
                    }
                   // if (n==1000&&m==1000&&tot==100000)
                     //   printf("%d %d %d %d %d %d\n",len,t,ans[j].y1,ans[j].y2,j,ans[j].len);
                    printf("%d %d %d %d\n",ans[i].x1,0,ans[i].x1,ans[j].y1+len-t);
                    return;
                }
                t=0;
            }
        }else{
            t+=ans[i].len;
            if (i==sum-1||(i<sum-1&&ans[i+1].y1>ans[i].y1)){
                len=t-(sta^t);
                if (len>0){
                    for (j=i;;j--){
                        t-=ans[j].len;
                        if (t<len) break;
                    }
                    printf("%d %d %d %d\n",0,ans[i].y1,ans[j].x1+len-t,ans[i].y1);
                    return;
                }
                t=0;
            }
        }
    }

}

int main(){
    //freopen("c.in","r",stdin);
    int i,len,tx,ty;
    scanf("%d%d%d",&n,&m,&tot);
    for (i=0;i<tot;i++){
        scanf("%d%d%d%d",&a[i].x1,&a[i].y1,&a[i].x2,&a[i].y2);
    }
    b[0].x1=b[0].x2=0;
    b[0].y1=0;b[0].y2=m;
    cnt=1;
    for (i=0;i<tot;i++){
        if (a[i].x1==a[i].x2){
            b[cnt]=a[i];
            if (b[cnt].y1>b[cnt].y2) swap(b[cnt].y1,b[cnt].y2);
            cnt++;
        }
    }
    b[cnt].x1=b[cnt].x2=n;
    b[cnt].y1=0;b[cnt].y2=m;
    cnt++;
    sta=0;
    sort(b,b+cnt,cmp1);
    tx=0;ty=m;
    for (i=1;i<cnt;i++){
        if (b[i].x1!=b[i-1].x1){
            len=m-ty;
            updata(len,b[i-1].x1,b[i-1].x1,ty,m);
            if (b[i].x1-b[i-1].x1>1){
                if ((b[i].x1-b[i-1].x1-1)%2==1)
                    updata(m,b[i].x1-1,b[i].x1-1,0,m);
            }
            len=b[i].y1;
            updata(len,b[i].x1,b[i].x1,0,b[i].y1);
            ty=b[i].y2;
        }else{
            len=b[i].y1-ty;
            if (len>0){
                updata(len,b[i].x1,b[i].x1,ty,b[i].y1);
            }
            ty=max(ty,b[i].y2);
        }
    }
    b[0].y1=b[0].y1=0;
    b[0].x1=0;b[0].x2=n;
    cnt=1;
    for (i=0;i<tot;i++){
        if (a[i].y1==a[i].y2){
            b[cnt]=a[i];
            if (b[cnt].x1>b[cnt].x2) swap(b[cnt].x1,b[cnt].x2);
            cnt++;
        }
    }
    b[cnt].y1=b[cnt].y2=m;
    b[cnt].x1=0;b[cnt].x2=n;
    cnt++;
    sort(b,b+cnt,cmp2);
    tx=n;
    for (i=1;i<cnt;i++){
        if (b[i].y1!=b[i-1].y1){
            len=n-tx;
            updata(len,tx,n,b[i-1].y1,b[i-1].y1);
            if (b[i].y1-b[i-1].y1>1){
                if ((b[i].y1-b[i-1].y1-1)%2==1){
                    updata(n,0,n,b[i].y1-1,b[i].y1-1);
                }
            }
            len=b[i].x1;
            updata(len,0,b[i].x1,b[i].y1,b[i].y2);
            tx=b[i].x2;
        }else{
            len=b[i].x1-tx;
            if (len>0){
                updata(len,tx,b[i].x1,b[i].y1,b[i].y1);
            }
            tx=max(b[i].x2,tx);
        }
    }
    solve();
    //while (1);
    return 0;
}


#include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
struct aa{
    int x1,y1,x2,y2;
}a[100010],b[100010];
struct aaa{
    int len,x1,x2,y1,y2;
}ans[500000];
int sum=0;
int sta,cnt;
int n,m,tot;
int cmp1(aa x,aa y){
    if (x.x1!=y.x1) return x.x1<y.x1;
    return x.y1<y.y1;
}
int cmp2(aa x,aa y){
    if (x.y1!=y.y1) return x.y1<y.y1;
    return x.x1<y.x1;
}
void updata(int len,int x1,int x2,int y1,int y2){
    if (len>0){
        //printf("%d\n",len);
        if (sum>=500000) while (1);
        ans[sum].len=len;
        ans[sum].x1=x1;ans[sum].x2=x2;
        ans[sum].y1=y1;ans[sum].y2=y2;
        sum++;

    }
}
void solve(){
    int i,t,j,len;
    sta=t=0;
    for (i=0;i<sum;i++){
        if (ans[i].x1==ans[i].x2){
            t+=ans[i].len;
            if (i==sum-1||(i<sum-1&&ans[i+1].x1==ans[i+1].x2&&ans[i+1].x1>ans[i].x1)
                ||(i<sum-1&&ans[i+1].y1==ans[i+1].y2)){
                sta=sta^t;
                t=0;
            }
        }else{
            t+=ans[i].len;
            if (i==sum-1||(i<sum-1&&ans[i+1].y1>ans[i].y1)){
                sta=sta^t;
                t=0;
            }
        }
    }
    if (sta==0){
        printf("SECOND\n");
        return;
    }
    //printf("sta %d\n",sta);
    printf("FIRST\n");
    for (i=0;i<sum;i++){
        if (ans[i].x1==ans[i].x2){
            t+=ans[i].len;
            if (i==sum-1||(i<sum-1&&ans[i+1].x1==ans[i+1].x2&&ans[i+1].x1>ans[i].x1)
                ||(i<sum-1&&ans[i+1].y1==ans[i+1].y2)){
                len=t-(sta^t);
                if (len>0){
                    for (j=i;;j--){
                        t-=ans[j].len;
                        if (t<len) break;
                    }
                    if (n==1000&&m==1000&&tot==100000)
                        printf("%d %d %d\n",len,t,ans[j].y1);
                    printf("%d %d %d %d\n",ans[i].x1,0,ans[i].x1,ans[j].y1+len-t);
                    return;
                }
                t=0;
            }
        }else{
            t+=ans[i].len;
            if (i==sum-1||(i<sum-1&&ans[i+1].y1>ans[i].y1)){
                len=t-(sta^t);
                if (len>0){
                    for (j=i;;j--){
                        t-=ans[j].len;
                        if (t<len) break;
                    }
                    printf("%d %d %d %d\n",0,ans[i].y1,ans[j].x1+len-t,ans[i].y1);
                    return;
                }
                t=0;
            }
        }
    }

}

int main(){
    //freopen("c.in","r",stdin);
    int i,len,tx,ty;
    scanf("%d%d%d",&n,&m,&tot);
    for (i=0;i<tot;i++){
        scanf("%d%d%d%d",&a[i].x1,&a[i].y1,&a[i].x2,&a[i].y2);
    }
    b[0].x1=b[0].x2=0;
    b[0].y1=0;b[0].y2=m;
    cnt=1;
    for (i=0;i<tot;i++){
        if (a[i].x1==a[i].x2){
            b[cnt]=a[i];
            if (b[cnt].y1>b[cnt].y2) swap(b[cnt].y1,b[cnt].y2);
            cnt++;
        }
    }
    b[cnt].x1=b[cnt].x2=n;
    b[cnt].y1=0;b[cnt].y2=m;
    cnt++;
    sta=0;
    sort(b,b+cnt,cmp1);
    tx=0;ty=m;
    for (i=1;i<cnt;i++){
        if (b[i].x1!=b[i-1].x1){
            len=m-ty;
            updata(len,b[i-1].x1,b[i-1].x1,b[i-1].y2,m);
            if (b[i].x1-b[i-1].x1>1){
                if ((b[i].x1-b[i-1].x1-1)%2==1)
                    updata(m,b[i].x1-1,b[i].x1-1,0,m);
            }
            len=b[i].y1;
            updata(len,b[i].x1,b[i].x1,ty,b[i].y1);
            ty=b[i].y2;
        }else{
            len=b[i].y1-ty;
            if (len>0){
                updata(len,b[i].x1,b[i].x1,ty,b[i].y1);
            }
            ty=max(ty,b[i].y2);
        }
    }
    b[0].y1=b[0].y1=0;
    b[0].x1=0;b[0].x2=n;
    cnt=1;
    for (i=0;i<tot;i++){
        if (a[i].y1==a[i].y2){
            b[cnt]=a[i];
            if (b[cnt].x1>b[cnt].x2) swap(b[cnt].x1,b[cnt].x2);
            cnt++;
        }
    }
    b[cnt].y1=b[cnt].y2=m;
    b[cnt].x1=0;b[cnt].x2=n;
    cnt++;
    sort(b,b+cnt,cmp2);
    tx=n;
    for (i=1;i<cnt;i++){
        if (b[i].y1!=b[i-1].y1){
            len=n-tx;
            updata(len,b[i-1].x2,n,b[i-1].y1,b[i-1].y1);
            if (b[i].y1-b[i-1].y1>1){
                if ((b[i].y1-b[i-1].y1-1)%2==1){
                    updata(n,0,n,b[i].y1-1,b[i].y1-1);
                }
            }
            len=b[i].x1;
            updata(len,0,b[i].x1,b[i].y1,b[i].y2);
            tx=b[i].x2;
        }else{
            len=b[i].x1-tx;
            if (len>0){
                updata(len,tx,b[i].x1,b[i].y1,b[i].y1);
            }
            tx=max(b[i].x2,tx);
        }
    }
    solve();
    //while (1);
    return 0;
}


#include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
struct aa{
    int x1,y1,x2,y2;
}a[100010],b[100010];
struct aaa{
    int len,x1,x2,y1,y2;
}ans;
int sta,cnt;
int n,m,t;
int cmp1(aa x,aa y){
    if (x.x1!=y.x1) return x.x1<y.x1;
    return x.y1<y.y1;
}
int cmp2(aa x,aa y){
    if (x.y1!=y.y1) return x.y1<y.y1;
    return x.x1<y.x1;
}
void updata(int len,int x1,int x2,int y1,int y2){
    if (ans.len<len){
        ans.len=len;
        ans.x1=x1;ans.x2=x2;
        ans.y1=y1;ans.y2=y2;
    }
}
int main(){
    //freopen("c.in","r",stdin);
    int i,len,tx,ty;
    scanf("%d%d%d",&n,&m,&t);
    for (i=0;i<t;i++){
        scanf("%d%d%d%d",&a[i].x1,&a[i].y1,&a[i].x2,&a[i].y2);
    }
    ans.len=0;
    b[0].x1=b[0].x2=0;
    b[0].y1=0;b[0].y2=m;
    cnt=1;
    for (i=0;i<t;i++){
        if (a[i].x1==a[i].x2){
            b[cnt]=a[i];
            if (b[cnt].y1>b[cnt].y2) swap(b[cnt].y1,b[cnt].y2);
            cnt++;
        }
    }
    b[cnt].x1=b[cnt].x2=n;
    b[cnt].y1=0;b[cnt].y2=m;
    cnt++;
    sta=0;
    sort(b,b+cnt,cmp1);
    tx=0;ty=m;
    for (i=1;i<cnt;i++){
        if (b[i].x1!=b[i-1].x1){
            len=m-ty;
            sta^=len;
            updata(len,b[i-1].x1,b[i-1].x1,b[i-1].y2,m);
            sta^=((b[i].x1-b[i-1].x1-1)%2*m);
            if (b[i].x1-b[i-1].x1>1) updata(m,b[i].x1-1,b[i].x1-1,0,m);
            len=b[i].y1;
            sta^=len;
            updata(len,b[i].x1,b[i].x1,ty,b[i].y1);
            ty=b[i].y2;
        }else{
            len=b[i].y1-ty;
            if (len>0){
                sta^=len;
                updata(len,b[i].x1,b[i].x1,ty,b[i].y1);
            }
            ty=max(ty,b[i].y2);
        }
    }
    b[0].y1=b[0].y1=0;
    b[0].x1=0;b[0].x2=n;
    cnt=1;
    for (i=0;i<t;i++){
        if (a[i].y1==a[i].y2){
            b[cnt]=a[i];
            if (b[cnt].x1>b[cnt].x2) swap(b[cnt].x1,b[cnt].x2);
            cnt++;
        }
    }
    b[cnt].y1=b[cnt].y2=m;
    b[cnt].x1=0;b[cnt].x2=n;
    cnt++;
    sort(b,b+cnt,cmp2);
    tx=n;
    for (i=1;i<cnt;i++){
        if (b[i].y1!=b[i-1].y1){
            len=n-tx;
            sta^=len;
            updata(len,b[i-1].x2,n,b[i-1].y1,b[i-1].y1);
            sta^=((b[i].y1-b[i-1].y1-1)%2*m);
            if (b[i].y1-b[i-1].y1>1) updata(n,0,n,b[i].y1-1,b[i].y1-1);
            len=b[i].x1;
            sta^=len;
            updata(len,0,b[i].x1,b[i].y1,b[i].y2);
            tx=b[i].x2;
        }else{
            len=b[i].x1-tx;
            if (len>0){
                sta^=len;
                updata(len,b[i-1].x2,b[i].x1,b[i].y1,b[i].y1);
            }
            tx=max(b[i].x2,tx);
        }
    }
    if (sta==0){
        printf("SECOND\n");
    }else{
        printf("FIRST\n");
        if (ans.x1==ans.x2) printf("%d %d %d %d\n",ans.x1,ans.y1,ans.x2,ans.y1+sta);
        else printf("%d %d %d %d\n",ans.x1,ans.y1,ans.x1+sta,ans.y2);
    }
    //while (1);
    return 0;
}


#include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
struct aa{
    int x1,y1,x2,y2;
}a[100010],b[100010];
struct aaa{
    int len,x1,x2,y1,y2;
}ans[500000];
int sum=0;
int sta,cnt;
int n,m,t;
int cmp1(aa x,aa y){
    if (x.x1!=y.x1) return x.x1<y.x1;
    return x.y1<y.y1;
}
int cmp2(aa x,aa y){
    if (x.y1!=y.y1) return x.y1<y.y1;
    return x.x1<y.x1;
}
void updata(int len,int x1,int x2,int y1,int y2){
    if (len>0){
        //printf("%d\n",len);
        ans[sum].len=len;
        ans[sum].x1=x1;ans[sum].x2=x2;
        ans[sum].y1=y1;ans[sum].y2=y2;
        sum++;
    }
}
void solve(){
    int i,t,j,len;
    sta=t=0;
    for (i=0;i<sum;i++){
        if (ans[i].x1==ans[i].x2){
            t+=ans[i].len;
            if (i==sum-1||(i<sum-1&&ans[i+1].x1==ans[i+1].x2&&ans[i+1].x1>ans[i].x1)
                ||(i<sum-1&&ans[i+1].y1==ans[i+1].y2)){
                sta=sta^t;
                t=0;
            }
        }else{
            t+=ans[i].len;
            if (i==sum-1||(i<sum-1&&ans[i+1].y1>ans[i].y1)){
                sta=sta^t;
                t=0;
            }
        }
    }
    if (sta==0){
        printf("SECOND\n");
        return;
    }
    //printf("sta %d\n",sta);
    printf("FIRST\n");
    for (i=0;i<sum;i++){
        if (ans[i].x1==ans[i].x2){
            t+=ans[i].len;
            if (i==sum-1||(i<sum-1&&ans[i+1].x1==ans[i+1].x2&&ans[i+1].x1>ans[i].x1)
                ||(i<sum-1&&ans[i+1].y1==ans[i+1].y2)){
                len=t-(sta^t);
                if (len>0){
                    for (j=i;;j--){
                        t-=ans[j].len;
                        if (t<len) break;
                    }
                    printf("%d %d %d %d\n",ans[i].x1,0,ans[i].x1,ans[j].y1+len-t);
                    return;
                }
                t=0;
            }
        }else{
            t+=ans[i].len;
            if (i==sum-1||(i<sum-1&&ans[i+1].y1>ans[i].y1)){
                len=t-(sta^t);
                if (len>0){
                    for (j=i;;j--){
                        t-=ans[j].len;
                        if (t<len) break;
                    }
                    printf("%d %d %d %d\n",0,ans[i].y1,ans[j].x1+len-t,ans[i].y1);
                    return;
                }
                t=0;
            }
        }
    }

}

int main(){
    //freopen("c.in","r",stdin);
    int i,len,tx,ty;
    scanf("%d%d%d",&n,&m,&t);
    for (i=0;i<t;i++){
        scanf("%d%d%d%d",&a[i].x1,&a[i].y1,&a[i].x2,&a[i].y2);
    }
    b[0].x1=b[0].x2=0;
    b[0].y1=0;b[0].y2=m;
    cnt=1;
    for (i=0;i<t;i++){
        if (a[i].x1==a[i].x2){
            b[cnt]=a[i];
            if (b[cnt].y1>b[cnt].y2) swap(b[cnt].y1,b[cnt].y2);
            cnt++;
        }
    }
    b[cnt].x1=b[cnt].x2=n;
    b[cnt].y1=0;b[cnt].y2=m;
    cnt++;
    sta=0;
    sort(b,b+cnt,cmp1);
    tx=0;ty=m;
    for (i=1;i<cnt;i++){
        if (b[i].x1!=b[i-1].x1){
            len=m-ty;
            updata(len,b[i-1].x1,b[i-1].x1,b[i-1].y2,m);
            if (b[i].x1-b[i-1].x1>1){
                if ((b[i].x1-b[i-1].x1-1)%2==1)
                    updata(m,b[i].x1-1,b[i].x1-1,0,m);
            }
            len=b[i].y1;
            updata(len,b[i].x1,b[i].x1,ty,b[i].y1);
            ty=b[i].y2;
        }else{
            len=b[i].y1-ty;
            if (len>0){
                updata(len,b[i].x1,b[i].x1,ty,b[i].y1);
            }
            ty=max(ty,b[i].y2);
        }
    }
    b[0].y1=b[0].y1=0;
    b[0].x1=0;b[0].x2=n;
    cnt=1;
    for (i=0;i<t;i++){
        if (a[i].y1==a[i].y2){
            b[cnt]=a[i];
            if (b[cnt].x1>b[cnt].x2) swap(b[cnt].x1,b[cnt].x2);
            cnt++;
        }
    }
    b[cnt].y1=b[cnt].y2=m;
    b[cnt].x1=0;b[cnt].x2=n;
    cnt++;
    sort(b,b+cnt,cmp2);
    tx=n;
    for (i=1;i<cnt;i++){
        if (b[i].y1!=b[i-1].y1){
            len=n-tx;
            updata(len,b[i-1].x2,n,b[i-1].y1,b[i-1].y1);
            if (b[i].y1-b[i-1].y1>1){
                if ((b[i].y1-b[i-1].y1-1)%2==1){
                    updata(n,0,n,b[i].y1-1,b[i].y1-1);
                }
            }
            len=b[i].x1;
            updata(len,0,b[i].x1,b[i].y1,b[i].y2);
            tx=b[i].x2;
        }else{
            len=b[i].x1-tx;
            if (len>0){
                updata(len,tx,b[i].x1,b[i].y1,b[i].y1);
            }
            tx=max(b[i].x2,tx);
        }
    }
    solve();
    //while (1);
    return 0;
}


#include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
struct aa{
    int x1,y1,x2,y2;
}a[100010],b[100010];
struct aaa{
    int len,x1,x2,y1,y2;
}ans;
int sta,cnt;
int n,m,t;
int cmp1(aa x,aa y){
    if (x.x1!=y.x1) return x.x1<y.x1;
    return x.y1<y.y1;
}
int cmp2(aa x,aa y){
    if (x.y1!=y.y1) return x.y1<y.y1;
    return x.x1<y.x1;
}
void updata(int len,int x1,int x2,int y1,int y2){
    if (ans.len<len){
        ans.len=len;
        ans.x1=x1;ans.x2=x2;
        ans.y1=y1;ans.y2=y2;
    }
}
int main(){
    //freopen("c.in","r",stdin);
    int i,len,tx,ty;
    scanf("%d%d%d",&n,&m,&t);
    for (i=0;i<t;i++){
        scanf("%d%d%d%d",&a[i].x1,&a[i].y1,&a[i].x2,&a[i].y2);
    }
    ans.len=0;
    b[0].x1=b[0].x2=0;
    b[0].y1=0;b[0].y2=m;
    cnt=1;
    for (i=0;i<t;i++){
        if (a[i].x1==a[i].x2){
            b[cnt]=a[i];
            if (b[cnt].y1>b[cnt].y2) swap(b[cnt].y1,b[cnt].y2);
            cnt++;
        }
    }
    b[cnt].x1=b[cnt].x2=n;
    b[cnt].y1=0;b[cnt].y2=m;
    cnt++;
    sta=0;
    sort(b,b+cnt,cmp1);
    tx=0;ty=m;
    for (i=1;i<cnt;i++){
        if (b[i].x1!=b[i-1].x1){
            len=m-ty;
            sta^=len;
            updata(len,b[i-1].x1,b[i-1].x1,b[i-1].y2,m);
            sta^=((b[i].x1-b[i-1].x1-1)%2*m);
            if (b[i].x1-b[i-1].x1>1) updata(m,b[i].x1-1,b[i].x1-1,0,m);
            len=b[i].y1;
            sta^=len;
            updata(len,b[i].x1,b[i].x1,ty,b[i].y1);
            ty=b[i].y2;
        }else{
            len=b[i].y1-ty;
            if (len>0){
                sta^=len;
                updata(len,b[i].x1,b[i].x1,ty,b[i].y1);
            }
            ty=max(ty,b[i].y2);
        }
    }
    b[0].y1=b[0].y1=0;
    b[0].x1=0;b[0].x2=n;
    cnt=1;
    for (i=0;i<t;i++){
        if (a[i].y1==a[i].y2){
            b[cnt]=a[i];
            if (b[cnt].x1>b[cnt].x2) swap(b[cnt].x1,b[cnt].x2);
            cnt++;
        }
    }
    b[cnt].y1=b[cnt].y2=m;
    b[cnt].x1=0;b[cnt].x2=n;
    cnt++;
    sort(b,b+cnt,cmp2);
    tx=n;
    for (i=1;i<cnt;i++){
        if (b[i].y1!=b[i-1].y1){
            len=n-tx;
            sta^=len;
            updata(len,b[i-1].x2,n,b[i-1].y1,b[i-1].y1);
            sta^=((b[i].y1-b[i-1].y1-1)%2*n);
            if (b[i].y1-b[i-1].y1>1) updata(n,0,n,b[i].y1-1,b[i].y1-1);
            len=b[i].x1;
            sta^=len;
            updata(len,0,b[i].x1,b[i].y1,b[i].y2);
            tx=b[i].x2;
        }else{
            len=b[i].x1-tx;
            if (len>0){
                sta^=len;
                updata(len,b[i-1].x2,b[i].x1,b[i].y1,b[i].y1);
            }
            tx=max(b[i].x2,tx);
        }
    }
    printf("%d %d\n",sta,ans.len);
    if (sta==0){
        printf("SECOND\n");
    }else{
        printf("FIRST\n");
        len=ans.len-(ans.len^sta);
        if (ans.x1==ans.x2) printf("%d %d %d %d\n",ans.x1,ans.y1,ans.x2,ans.y1+len);
        else printf("%d %d %d %d\n",ans.x1,ans.y1,ans.x1+len,ans.y2);

    }
    //while (1);
    return 0;
}


#include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
struct aa{
    int x1,y1,x2,y2;
}a[100010],b[100010];
struct aaa{
    int len,x1,x2,y1,y2;
}ans[500000];
int sum=0;
int sta,cnt;
int n,m,tot;
int cmp1(aa x,aa y){
    if (x.x1!=y.x1) return x.x1<y.x1;
    return x.y1<y.y1;
}
int cmp2(aa x,aa y){
    if (x.y1!=y.y1) return x.y1<y.y1;
    return x.x1<y.x1;
}
void updata(int len,int x1,int x2,int y1,int y2){
    if (len>0){
        //printf("%d\n",len);
        if (sum>=500000) while (1);
        ans[sum].len=len;
        ans[sum].x1=x1;ans[sum].x2=x2;
        ans[sum].y1=y1;ans[sum].y2=y2;
        sum++;

    }
}
void solve(){
    int i,t,j,len;
    sta=t=0;
    for (i=0;i<sum;i++){
        if (ans[i].x1==ans[i].x2){
            t+=ans[i].len;
            if (i==sum-1||(i<sum-1&&ans[i+1].x1==ans[i+1].x2&&ans[i+1].x1>ans[i].x1)
                ||(i<sum-1&&ans[i+1].y1==ans[i+1].y2)){
                sta=sta^t;
                t=0;
            }
        }else{
            t+=ans[i].len;
            if (i==sum-1||(i<sum-1&&ans[i+1].y1>ans[i].y1)){
                sta=sta^t;
                t=0;
            }
        }
    }
    if (sta==0){
        printf("SECOND\n");
        return;
    }
    //printf("sta %d\n",sta);
    printf("FIRST\n");
    for (i=0;i<sum;i++){
        if (ans[i].x1==ans[i].x2){
            t+=ans[i].len;
            if (i==sum-1||(i<sum-1&&ans[i+1].x1==ans[i+1].x2&&ans[i+1].x1>ans[i].x1)
                ||(i<sum-1&&ans[i+1].y1==ans[i+1].y2)){
                len=t-(sta^t);
                if (len>0){
                    for (j=i;;j--){
                        t-=ans[j].len;
                        if (t<len) break;
                    }
                    if (n==1000&&m==1000&&tot==100000)
                        printf("%d %d %d %d\n",len,t,ans[j].y1,ans[j].y2);
                    printf("%d %d %d %d\n",ans[i].x1,0,ans[i].x1,ans[j].y1+len-t);
                    return;
                }
                t=0;
            }
        }else{
            t+=ans[i].len;
            if (i==sum-1||(i<sum-1&&ans[i+1].y1>ans[i].y1)){
                len=t-(sta^t);
                if (len>0){
                    for (j=i;;j--){
                        t-=ans[j].len;
                        if (t<len) break;
                    }
                    printf("%d %d %d %d\n",0,ans[i].y1,ans[j].x1+len-t,ans[i].y1);
                    return;
                }
                t=0;
            }
        }
    }

}

int main(){
    //freopen("c.in","r",stdin);
    int i,len,tx,ty;
    scanf("%d%d%d",&n,&m,&tot);
    for (i=0;i<tot;i++){
        scanf("%d%d%d%d",&a[i].x1,&a[i].y1,&a[i].x2,&a[i].y2);
    }
    b[0].x1=b[0].x2=0;
    b[0].y1=0;b[0].y2=m;
    cnt=1;
    for (i=0;i<tot;i++){
        if (a[i].x1==a[i].x2){
            b[cnt]=a[i];
            if (b[cnt].y1>b[cnt].y2) swap(b[cnt].y1,b[cnt].y2);
            cnt++;
        }
    }
    b[cnt].x1=b[cnt].x2=n;
    b[cnt].y1=0;b[cnt].y2=m;
    cnt++;
    sta=0;
    sort(b,b+cnt,cmp1);
    tx=0;ty=m;
    for (i=1;i<cnt;i++){
        if (b[i].x1!=b[i-1].x1){
            len=m-ty;
            updata(len,b[i-1].x1,b[i-1].x1,b[i-1].y2,m);
            if (b[i].x1-b[i-1].x1>1){
                if ((b[i].x1-b[i-1].x1-1)%2==1)
                    updata(m,b[i].x1-1,b[i].x1-1,0,m);
            }
            len=b[i].y1;
            updata(len,b[i].x1,b[i].x1,ty,b[i].y1);
            ty=b[i].y2;
        }else{
            len=b[i].y1-ty;
            if (len>0){
                updata(len,b[i].x1,b[i].x1,ty,b[i].y1);
            }
            ty=max(ty,b[i].y2);
        }
    }
    b[0].y1=b[0].y1=0;
    b[0].x1=0;b[0].x2=n;
    cnt=1;
    for (i=0;i<tot;i++){
        if (a[i].y1==a[i].y2){
            b[cnt]=a[i];
            if (b[cnt].x1>b[cnt].x2) swap(b[cnt].x1,b[cnt].x2);
            cnt++;
        }
    }
    b[cnt].y1=b[cnt].y2=m;
    b[cnt].x1=0;b[cnt].x2=n;
    cnt++;
    sort(b,b+cnt,cmp2);
    tx=n;
    for (i=1;i<cnt;i++){
        if (b[i].y1!=b[i-1].y1){
            len=n-tx;
            updata(len,b[i-1].x2,n,b[i-1].y1,b[i-1].y1);
            if (b[i].y1-b[i-1].y1>1){
                if ((b[i].y1-b[i-1].y1-1)%2==1){
                    updata(n,0,n,b[i].y1-1,b[i].y1-1);
                }
            }
            len=b[i].x1;
            updata(len,0,b[i].x1,b[i].y1,b[i].y2);
            tx=b[i].x2;
        }else{
            len=b[i].x1-tx;
            if (len>0){
                updata(len,tx,b[i].x1,b[i].y1,b[i].y1);
            }
            tx=max(b[i].x2,tx);
        }
    }
    solve();
    //while (1);
    return 0;
}


#include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
struct aa{
    int x1,y1,x2,y2;
}a[100010],b[100010];
struct aaa{
    int len,x1,x2,y1,y2;
}ans;
int sta,cnt;
int n,m,t;
int cmp1(aa x,aa y){
    if (x.x1!=y.x1) return x.x1<y.x1;
    return x.y1<y.y1;
}
int cmp2(aa x,aa y){
    if (x.y1!=y.y1) return x.y1<y.y1;
    return x.x1<y.x1;
}
void updata(int len,int x1,int x2,int y1,int y2){
    if (ans.len<len){
        ans.len=len;
        ans.x1=x1;ans.x2=x2;
        ans.y1=y1;ans.y2=y2;
    }
}
int main(){
    //freopen("c.in","r",stdin);
    int i,len,tx,ty;
    scanf("%d%d%d",&n,&m,&t);
    for (i=0;i<t;i++){
        scanf("%d%d%d%d",&a[i].x1,&a[i].y1,&a[i].x2,&a[i].y2);
    }
    ans.len=0;
    b[0].x1=b[0].x2=0;
    b[0].y1=0;b[0].y2=m;
    cnt=1;
    for (i=0;i<t;i++){
        if (a[i].x1==a[i].x2){
            b[cnt]=a[i];
            if (b[cnt].y1>b[cnt].y2) swap(b[cnt].y1,b[cnt].y2);
            cnt++;
        }
    }
    b[cnt].x1=b[cnt].x2=n;
    b[cnt].y1=0;b[cnt].y2=m;
    cnt++;
    sta=0;
    sort(b,b+cnt,cmp1);
    tx=0;ty=m;
    for (i=1;i<cnt;i++){
        if (b[i].x1!=b[i-1].x1){
            len=m-ty;
            sta^=len;
            updata(len,b[i-1].x1,b[i-1].x1,b[i-1].y2,m);
            sta^=((b[i].x1-b[i-1].x1-1)%2*m);
            if (b[i].x1-b[i-1].x1>1) updata(m,b[i].x1-1,b[i].x1-1,0,m);
            len=b[i].y1;
            sta^=len;
            updata(len,b[i].x1,b[i].x1,ty,b[i].y1);
            ty=b[i].y2;
        }else{
            len=b[i].y1-ty;
            if (len>0){
                sta^=len;
                updata(len,b[i].x1,b[i].x1,ty,b[i].y1);
            }
            ty=max(ty,b[i].y2);
        }
    }
    b[0].y1=b[0].y1=0;
    b[0].x1=0;b[0].x2=n;
    cnt=1;
    for (i=0;i<t;i++){
        if (a[i].y1==a[i].y2){
            b[cnt]=a[i];
            if (b[cnt].x1>b[cnt].x2) swap(b[cnt].x1,b[cnt].x2);
            cnt++;
        }
    }
    b[cnt].y1=b[cnt].y2=m;
    b[cnt].x1=0;b[cnt].x2=n;
    cnt++;
    sort(b,b+cnt,cmp2);
    tx=n;
    for (i=1;i<cnt;i++){
        if (b[i].y1!=b[i-1].y1){
            len=n-tx;
            sta^=len;
            updata(len,b[i-1].x2,n,b[i-1].y1,b[i-1].y1);
            sta^=((b[i].y1-b[i-1].y1-1)%2*m);
            if (b[i].y1-b[i-1].y1>1) updata(n,0,n,b[i].y1-1,b[i].y1-1);
            len=b[i].x1;
            sta^=len;
            updata(len,0,b[i].x1,b[i].y1,b[i].y2);
            tx=b[i].x2;
        }else{
            len=b[i].x1-tx;
            if (len>0){
                sta^=len;
                updata(len,b[i-1].x2,b[i].x1,b[i].y1,b[i].y1);
            }
            tx=max(b[i].x2,tx);
        }
    }
    if (sta==0){
        printf("SECOND\n");
    }else{
        printf("FIRST\n");
        len=ans.len^sta;
        if (ans.x1==ans.x2) printf("%d %d %d %d\n",ans.x1,ans.y1,ans.x2,ans.y1+len);
        else printf("%d %d %d %d\n",ans.x1,ans.y1,ans.x1+len,ans.y2);

    }
    //while (1);
    return 0;
}


#include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
struct aa{
    int x1,y1,x2,y2;
}a[100010],b[100010];
struct aaa{
    int len,x1,x2,y1,y2;
}ans;
int sta,cnt;
int n,m,t;
int cmp1(aa x,aa y){
    if (x.x1!=y.x1) return x.x1<y.x1;
    return x.y1<y.y1;
}
int cmp2(aa x,aa y){
    if (x.y1!=y.y1) return x.y1<y.y1;
    return x.x1<y.x1;
}
void updata(int len,int x1,int x2,int y1,int y2){
    if (ans.len<len){
        ans.len=len;
        ans.x1=x1;ans.x2=x2;
        ans.y1=y1;ans.y2=y2;
    }
}
int main(){
    //freopen("c.in","r",stdin);
    int i,len,tx,ty;
    scanf("%d%d%d",&n,&m,&t);
    for (i=0;i<t;i++){
        scanf("%d%d%d%d",&a[i].x1,&a[i].y1,&a[i].x2,&a[i].y2);
    }
    ans.len=0;
    b[0].x1=b[0].x2=0;
    b[0].y1=0;b[0].y2=m;
    cnt=1;
    for (i=0;i<t;i++){
        if (a[i].x1==a[i].x2){
            b[cnt]=a[i];
            if (b[cnt].y1>b[cnt].y2) swap(b[cnt].y1,b[cnt].y2);
            cnt++;
        }
    }
    b[cnt].x1=b[cnt].x2=n;
    b[cnt].y1=0;b[cnt].y2=m;
    cnt++;
    sta=0;
    sort(b,b+cnt,cmp1);
    tx=0;ty=m;
    for (i=1;i<cnt;i++){
        if (b[i].x1!=b[i-1].x1){
            len=m-ty;
            sta^=len;
            updata(len,b[i-1].x1,b[i-1].x1,b[i-1].y2,m);
            sta^=((b[i].x1-b[i-1].x1-1)%2*m);
            if (b[i].x1-b[i-1].x1>1) updata(m,b[i].x1-1,b[i].x1-1,0,m);
            len=b[i].y1;
            sta^=len;
            updata(len,b[i].x1,b[i].x1,ty,b[i].y1);
            ty=b[i].y2;
        }else{
            len=b[i].y1-ty;
            if (len>0){
                sta^=len;
                updata(len,b[i].x1,b[i].x1,ty,b[i].y1);
            }
            ty=max(ty,b[i].y2);
        }
    }
    b[0].y1=b[0].y1=0;
    b[0].x1=0;b[0].x2=n;
    cnt=1;
    for (i=0;i<t;i++){
        if (a[i].y1==a[i].y2){
            b[cnt]=a[i];
            if (b[cnt].x1>b[cnt].x2) swap(b[cnt].x1,b[cnt].x2);
            cnt++;
        }
    }
    b[cnt].y1=b[cnt].y2=m;
    b[cnt].x1=0;b[cnt].x2=n;
    cnt++;
    sort(b,b+cnt,cmp2);
    tx=n;
    for (i=1;i<cnt;i++){
        if (b[i].y1!=b[i-1].y1){
            len=n-tx;
            sta^=len;
            updata(len,b[i-1].x2,n,b[i-1].y1,b[i-1].y1);
            sta^=((b[i].y1-b[i-1].y1-1)%2*n);
            if (b[i].y1-b[i-1].y1>1) updata(n,0,n,b[i].y1-1,b[i].y1-1);
            len=b[i].x1;
            sta^=len;
            updata(len,0,b[i].x1,b[i].y1,b[i].y2);
            tx=b[i].x2;
        }else{
            len=b[i].x1-tx;
            if (len>0){
                sta^=len;
                updata(len,b[i-1].x2,b[i].x1,b[i].y1,b[i].y1);
            }
            tx=max(b[i].x2,tx);
        }
    }
    if (sta==0){
        printf("SECOND\n");
    }else{
        printf("FIRST\n");
        len=ans.len-(ans.len^sta);
        if (ans.x1==ans.x2) printf("%d %d %d %d\n",ans.x1,ans.y1,ans.x2,ans.y1+len);
        else printf("%d %d %d %d\n",ans.x1,ans.y1,ans.x1+len,ans.y2);

    }
    //while (1);
    return 0;
}


#include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
struct aa{
    int x1,y1,x2,y2;
}a[100010],b[100010];
struct aaa{
    int len,x1,x2,y1,y2;
}ans[500000];
int sum=0;
int sta,cnt;
int n,m,t;
int cmp1(aa x,aa y){
    if (x.x1!=y.x1) return x.x1<y.x1;
    return x.y1<y.y1;
}
int cmp2(aa x,aa y){
    if (x.y1!=y.y1) return x.y1<y.y1;
    return x.x1<y.x1;
}
void updata(int len,int x1,int x2,int y1,int y2){
    if (len>0){
        //printf("%d\n",len);
        ans[sum].len=len;
        ans[sum].x1=x1;ans[sum].x2=x2;
        ans[sum].y1=y1;ans[sum].y2=y2;
        sum++;
    }
}
void solve(){
    int i,t,j,len;
    sta=t=0;
    for (i=0;i<sum;i++){
        if (ans[i].x1==ans[i].x2){
            t+=ans[i].len;
            if (i==sum-1||(i<sum-1&&ans[i+1].x1==ans[i+1].x2&&ans[i+1].x1>ans[i].x1)
                ||(i<sum-1&&ans[i+1].y1==ans[i+1].y2)){
                sta=sta^t;
                t=0;
            }
        }else{
            t+=ans[i].len;
            if (i==sum-1||(i<sum-1&&ans[i+1].y1>ans[i].y1)){
                sta=sta^t;
                t=0;
            }
        }
    }
    if (sta==0){
        printf("SECOND\n");
        return;
    }
    printf("FIRST\n");
    for (i=0;i<sum;i++){
        if (ans[i].x1==ans[i].x2){
            t+=ans[i].len;
            if (i==sum-1||(i<sum-1&&ans[i+1].x1==ans[i+1].x2&&ans[i+1].x1>ans[i].x1)
                ||(i<sum-1&&ans[i+1].y1==ans[i+1].y2)){
                len=t-(sta^t);
                if (len>0){
                    for (j=i;;j--){
                        t-=ans[j].len;
                        if (t<len) break;
                    }
                    if (t>0)
                        printf("%d %d %d %d\n",ans[i].x1,0,ans[i].x1,ans[j].y1+len-t);
                    else
                        printf("%d %d %d %d\n",ans[i].x1,0,ans[i].x1,len);
                    return;
                }
                t=0;
            }
        }else{
            t+=ans[i].len;
            if (i==sum-1||(i<sum-1&&ans[i+1].y1>ans[i].y1)){
                len=t-(sta^t);
                if (len>0){
                    for (j=i;;j--){
                        t-=ans[j].len;
                        if (t<len) break;
                    }
                    if (t>0)
                        printf("%d %d %d %d\n",0,ans[i].y1,ans[j].x1+len-t,ans[i].y1);
                    else
                        printf("%d %d %d %d\n",0,ans[i].y1,len,ans[i].y1);
                    return;
                }
                t=0;
            }
        }
    }

}

int main(){
    //freopen("c.in","r",stdin);
    int i,len,tx,ty;
    scanf("%d%d%d",&n,&m,&t);
    for (i=0;i<t;i++){
        scanf("%d%d%d%d",&a[i].x1,&a[i].y1,&a[i].x2,&a[i].y2);
    }
    b[0].x1=b[0].x2=0;
    b[0].y1=0;b[0].y2=m;
    cnt=1;
    for (i=0;i<t;i++){
        if (a[i].x1==a[i].x2){
            b[cnt]=a[i];
            if (b[cnt].y1>b[cnt].y2) swap(b[cnt].y1,b[cnt].y2);
            cnt++;
        }
    }
    b[cnt].x1=b[cnt].x2=n;
    b[cnt].y1=0;b[cnt].y2=m;
    cnt++;
    sta=0;
    sort(b,b+cnt,cmp1);
    tx=0;ty=m;
    for (i=1;i<cnt;i++){
        if (b[i].x1!=b[i-1].x1){
            len=m-ty;
            updata(len,b[i-1].x1,b[i-1].x1,b[i-1].y2,m);
            if (b[i].x1-b[i-1].x1>1){
                if ((b[i].x1-b[i-1].x1-1)%2==1)
                    updata(m,b[i].x1-1,b[i].x1-1,0,m);
            }
            len=b[i].y1;
            updata(len,b[i].x1,b[i].x1,ty,b[i].y1);
            ty=b[i].y2;
        }else{
            len=b[i].y1-ty;
            if (len>0){
                updata(len,b[i].x1,b[i].x1,ty,b[i].y1);
            }
            ty=max(ty,b[i].y2);
        }
    }
    b[0].y1=b[0].y1=0;
    b[0].x1=0;b[0].x2=n;
    cnt=1;
    for (i=0;i<t;i++){
        if (a[i].y1==a[i].y2){
            b[cnt]=a[i];
            if (b[cnt].x1>b[cnt].x2) swap(b[cnt].x1,b[cnt].x2);
            cnt++;
        }
    }
    b[cnt].y1=b[cnt].y2=m;
    b[cnt].x1=0;b[cnt].x2=n;
    cnt++;
    sort(b,b+cnt,cmp2);
    tx=n;
    for (i=1;i<cnt;i++){
        if (b[i].y1!=b[i-1].y1){
            len=n-tx;
            updata(len,b[i-1].x2,n,b[i-1].y1,b[i-1].y1);
            if (b[i].y1-b[i-1].y1>1){
                if ((b[i].y1-b[i-1].y1-1)%2==1){
                    updata(n,0,n,b[i].y1-1,b[i].y1-1);
                }
            }
            len=b[i].x1;
            updata(len,0,b[i].x1,b[i].y1,b[i].y2);
            tx=b[i].x2;
        }else{
            len=b[i].x1-tx;
            if (len>0){
                updata(len,tx,b[i].x1,b[i].y1,b[i].y1);
            }
            tx=max(b[i].x2,tx);
        }
    }
    solve();
    //while (1);
    return 0;
}


#include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
struct aa{
    int x1,y1,x2,y2;
}a[100010],b[100010];
struct aaa{
    int len,x1,x2,y1,y2;
}ans[500000];
int sum=0;
int sta,cnt;
int n,m,tot;
int cmp1(aa x,aa y){
    if (x.x1!=y.x1) return x.x1<y.x1;
    return x.y1<y.y1;
}
int cmp2(aa x,aa y){
    if (x.y1!=y.y1) return x.y1<y.y1;
    return x.x1<y.x1;
}
void updata(int len,int x1,int x2,int y1,int y2){
    if (len>0){
        //printf("%d\n",len);
        if (sum>=500000) while (1);
        ans[sum].len=len;
        ans[sum].x1=x1;ans[sum].x2=x2;
        ans[sum].y1=y1;ans[sum].y2=y2;
        sum++;

    }
}
void solve(){
    int i,t,j,len;
    sta=t=0;
    for (i=0;i<sum;i++){
        if (ans[i].x1==ans[i].x2){
            t+=ans[i].len;
            if (i==sum-1||(i<sum-1&&ans[i+1].x1==ans[i+1].x2&&ans[i+1].x1>ans[i].x1)
                ||(i<sum-1&&ans[i+1].y1==ans[i+1].y2)){
                sta=sta^t;
                t=0;
            }
        }else{
            t+=ans[i].len;
            if (i==sum-1||(i<sum-1&&ans[i+1].y1>ans[i].y1)){
                sta=sta^t;
                t=0;
            }
        }
    }
    if (sta==0){
        printf("SECOND\n");
        return;
    }
    //printf("sta %d\n",sta);
    printf("FIRST\n");
    for (i=0;i<sum;i++){
        if (ans[i].x1==ans[i].x2){
            t+=ans[i].len;
            if (i==sum-1||(i<sum-1&&ans[i+1].x1==ans[i+1].x2&&ans[i+1].x1>ans[i].x1)
                ||(i<sum-1&&ans[i+1].y1==ans[i+1].y2)){
                len=t-(sta^t);
                if (len>0){
                    for (j=i;;j--){
                        t-=ans[j].len;
                        if (t<len) break;
                    }
                    if (n==1000&&m==1000&&tot==100000)
                        printf("%d %d %d %d %d %d\n",len,t,ans[j].y1,ans[j].y2,j,ans[j].len);
                    printf("%d %d %d %d\n",ans[i].x1,0,ans[i].x1,ans[j].y1+len-t);
                    return;
                }
                t=0;
            }
        }else{
            t+=ans[i].len;
            if (i==sum-1||(i<sum-1&&ans[i+1].y1>ans[i].y1)){
                len=t-(sta^t);
                if (len>0){
                    for (j=i;;j--){
                        t-=ans[j].len;
                        if (t<len) break;
                    }
                    printf("%d %d %d %d\n",0,ans[i].y1,ans[j].x1+len-t,ans[i].y1);
                    return;
                }
                t=0;
            }
        }
    }

}

int main(){
    //freopen("c.in","r",stdin);
    int i,len,tx,ty;
    scanf("%d%d%d",&n,&m,&tot);
    for (i=0;i<tot;i++){
        scanf("%d%d%d%d",&a[i].x1,&a[i].y1,&a[i].x2,&a[i].y2);
    }
    b[0].x1=b[0].x2=0;
    b[0].y1=0;b[0].y2=m;
    cnt=1;
    for (i=0;i<tot;i++){
        if (a[i].x1==a[i].x2){
            b[cnt]=a[i];
            if (b[cnt].y1>b[cnt].y2) swap(b[cnt].y1,b[cnt].y2);
            cnt++;
        }
    }
    b[cnt].x1=b[cnt].x2=n;
    b[cnt].y1=0;b[cnt].y2=m;
    cnt++;
    sta=0;
    sort(b,b+cnt,cmp1);
    tx=0;ty=m;
    for (i=1;i<cnt;i++){
        if (b[i].x1!=b[i-1].x1){
            len=m-ty;
            updata(len,b[i-1].x1,b[i-1].x1,b[i-1].y2,m);
            if (b[i].x1-b[i-1].x1>1){
                if ((b[i].x1-b[i-1].x1-1)%2==1)
                    updata(m,b[i].x1-1,b[i].x1-1,0,m);
            }
            len=b[i].y1;
            updata(len,b[i].x1,b[i].x1,ty,b[i].y1);
            ty=b[i].y2;
        }else{
            len=b[i].y1-ty;
            if (len>0){
                updata(len,b[i].x1,b[i].x1,ty,b[i].y1);
            }
            ty=max(ty,b[i].y2);
        }
    }
    b[0].y1=b[0].y1=0;
    b[0].x1=0;b[0].x2=n;
    cnt=1;
    for (i=0;i<tot;i++){
        if (a[i].y1==a[i].y2){
            b[cnt]=a[i];
            if (b[cnt].x1>b[cnt].x2) swap(b[cnt].x1,b[cnt].x2);
            cnt++;
        }
    }
    b[cnt].y1=b[cnt].y2=m;
    b[cnt].x1=0;b[cnt].x2=n;
    cnt++;
    sort(b,b+cnt,cmp2);
    tx=n;
    for (i=1;i<cnt;i++){
        if (b[i].y1!=b[i-1].y1){
            len=n-tx;
            updata(len,b[i-1].x2,n,b[i-1].y1,b[i-1].y1);
            if (b[i].y1-b[i-1].y1>1){
                if ((b[i].y1-b[i-1].y1-1)%2==1){
                    updata(n,0,n,b[i].y1-1,b[i].y1-1);
                }
            }
            len=b[i].x1;
            updata(len,0,b[i].x1,b[i].y1,b[i].y2);
            tx=b[i].x2;
        }else{
            len=b[i].x1-tx;
            if (len>0){
                updata(len,tx,b[i].x1,b[i].y1,b[i].y1);
            }
            tx=max(b[i].x2,tx);
        }
    }
    solve();
    //while (1);
    return 0;
}


#include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
struct aa{
    int x1,y1,x2,y2;
}a[100010],b[100010];
struct aaa{
    int len,x1,x2,y1,y2;
}ans;
int sta,cnt;
int n,m,t;
int cmp1(aa x,aa y){
    if (x.x1!=y.x1) return x.x1<y.x1;
    return x.y1<y.y1;
}
int cmp2(aa x,aa y){
    if (x.y1!=y.y1) return x.y1<y.y1;
    return x.x1<y.x1;
}
void updata(int len,int x1,int x2,int y1,int y2){
    if (ans.len<len){
        ans.len=len;
        ans.x1=x1;ans.x2=x2;
        ans.y1=y1;ans.y2=y2;
    }
}
int main(){
    //freopen("c.in","r",stdin);
    int i,len,tx,ty;
    scanf("%d%d%d",&n,&m,&t);
    for (i=0;i<t;i++){
        scanf("%d%d%d%d",&a[i].x1,&a[i].y1,&a[i].x2,&a[i].y2);
    }
    ans.len=0;
    b[0].x1=b[0].x2=0;
    b[0].y1=0;b[0].y2=m;
    cnt=1;
    for (i=0;i<t;i++){
        if (a[i].x1==a[i].x2){
            b[cnt]=a[i];
            if (b[cnt].y1>b[cnt].y2) swap(b[cnt].y1,b[cnt].y2);
            cnt++;
        }
    }
    b[cnt].x1=b[cnt].x2=n;
    b[cnt].y1=0;b[cnt].y2=m;
    cnt++;
    sta=0;
    sort(b,b+cnt,cmp1);
    tx=0;ty=m;
    for (i=1;i<cnt;i++){
        if (b[i].x1!=b[i-1].x1){
            len=m-ty;
            sta^=len;
            updata(len,b[i-1].x1,b[i-1].x1,b[i-1].y2,m);
            sta^=((b[i].x1-b[i-1].x1-1)%2*m);
            if (b[i].x1-b[i-1].x1>1) updata(m,b[i].x1-1,b[i].x1-1,0,m);
            len=b[i].y1;
            sta^=len;
            updata(len,b[i].x1,b[i].x1,ty,b[i].y1);
            ty=b[i].y2;
        }else{
            len=b[i].y1-ty;
            if (len>0){
                sta^=len;
                updata(len,b[i].x1,b[i].x1,ty,b[i].y1);
            }
            ty=max(ty,b[i].y2);
        }
    }
    b[0].y1=b[0].y1=0;
    b[0].x1=0;b[0].x2=n;
    cnt=1;
    for (i=0;i<t;i++){
        if (a[i].y1==a[i].y2){
            b[cnt]=a[i];
            if (b[cnt].x1>b[cnt].x2) swap(b[cnt].x1,b[cnt].x2);
            cnt++;
        }
    }
    b[cnt].y1=b[cnt].y2=m;
    b[cnt].x1=0;b[cnt].x2=n;
    cnt++;
    sort(b,b+cnt,cmp2);
    tx=n;
    for (i=1;i<cnt;i++){
        if (b[i].y1!=b[i-1].y1){
            len=n-tx;
            sta^=len;
            updata(len,b[i-1].x2,n,b[i-1].y1,b[i-1].y1);
            sta^=((b[i].y1-b[i-1].y1-1)%2*m);
            if (b[i].y1-b[i-1].y1>1) updata(n,0,n,b[i].y1-1,b[i].y1-1);
            len=b[i].x1;
            sta^=len;
            updata(len,0,b[i].x1,b[i].y1,b[i].y2);
            tx=b[i].x2;
        }else{
            len=b[i].x1-tx;
            if (len>0){
                sta^=len;
                updata(len,b[i-1].x2,b[i].x1,b[i].y1,b[i].y1);
            }
            tx=max(b[i].x2,tx);
        }
    }
    if (sta==0){
        printf("SECOND\n");
    }else{
        printf("FIRST\n");
        len=ans.len-(ans.len^sta);
        if (ans.x1==ans.x2) printf("%d %d %d %d\n",ans.x1,ans.y1,ans.x2,ans.y1+len);
        else printf("%d %d %d %d\n",ans.x1,ans.y1,ans.x1+len,ans.y2);

    }
    //while (1);
    return 0;
}


#include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
struct aa{
    int x1,y1,x2,y2;
}a[100010],b[100010];
struct aaa{
    int len,x1,x2,y1,y2;
}ans[500000];
int sum=0;
int sta,cnt;
int n,m,t;
int cmp1(aa x,aa y){
    if (x.x1!=y.x1) return x.x1<y.x1;
    return x.y1<y.y1;
}
int cmp2(aa x,aa y){
    if (x.y1!=y.y1) return x.y1<y.y1;
    return x.x1<y.x1;
}
void updata(int len,int x1,int x2,int y1,int y2){
    if (len>0){
        //printf("%d\n",len);
        ans[sum].len=len;
        ans[sum].x1=x1;ans[sum].x2=x2;
        ans[sum].y1=y1;ans[sum].y2=y2;
        sum++;
    }
}
void solve(){
    int i,t,j,len;
    sta=t=0;
    for (i=0;i<sum;i++){
        if (ans[i].x1==ans[i].x2){
            t+=ans[i].len;
            if (i==sum-1||(i<sum-1&&ans[i+1].x1==ans[i+1].x2&&ans[i+1].x1>ans[i].x1)
                ||(i<sum-1&&ans[i+1].y1==ans[i+1].y2)){
                sta=sta^t;
                t=0;
            }
        }else{
            t+=ans[i].len;
            if (i==sum-1||(i<sum-1&&ans[i+1].y1>ans[i].y1)){
                sta=sta^t;
                t=0;
            }
        }
    }
    if (sta==0){
        printf("SECOND\n");
        return;
    }
    printf("FIRST\n");
    for (i=0;i<sum;i++){
        if (ans[i].x1==ans[i].x2){
            t+=ans[i].len;
            if (i==sum-1||(i<sum-1&&ans[i+1].x1==ans[i+1].x2&&ans[i+1].x1>ans[i].x1)
                ||(i<sum-1&&ans[i+1].y1==ans[i+1].y2)){
                len=t-(sta^t);
                if (len>0){
                    for (j=i;;j--){
                        t-=ans[j].len;
                        if (t<len) break;
                    }
                    if (t>0)
                        printf("%d %d %d %d\n",ans[i].x1,0,ans[i].x1,ans[j].y1+len-t);
                    else
                        printf("%d %d %d %d\n",ans[i].x1,0,ans[i].x1,len);
                    return;
                }
                t=0;
            }
        }else{
            t+=ans[i].len;
            if (i==sum-1||(i<sum-1&&ans[i+1].y1>ans[i].y1)){
                len=t-(sta^t);
                if (len>0){
                    for (j=i;;j--){
                        t-=ans[j].len;
                        if (t<len) break;
                    }
                    if (t>0)
                        printf("%d %d %d %d\n",0,ans[i].y1,ans[j].x1+len-t,ans[i].y1);
                    else
                        printf("%d %d %d %d\n",0,ans[i].y1,len,ans[i].y1);
                    return;
                }
                t=0;
            }
        }
    }

}

int main(){
    //freopen("c.in","r",stdin);
    int i,len,tx,ty;
    scanf("%d%d%d",&n,&m,&t);
    for (i=0;i<t;i++){
        scanf("%d%d%d%d",&a[i].x1,&a[i].y1,&a[i].x2,&a[i].y2);
    }
    b[0].x1=b[0].x2=0;
    b[0].y1=0;b[0].y2=m;
    cnt=1;
    for (i=0;i<t;i++){
        if (a[i].x1==a[i].x2){
            b[cnt]=a[i];
            if (b[cnt].y1>b[cnt].y2) swap(b[cnt].y1,b[cnt].y2);
            cnt++;
        }
    }
    b[cnt].x1=b[cnt].x2=n;
    b[cnt].y1=0;b[cnt].y2=m;
    cnt++;
    sta=0;
    sort(b,b+cnt,cmp1);
    tx=0;ty=m;
    for (i=1;i<cnt;i++){
        if (b[i].x1!=b[i-1].x1){
            len=m-ty;
            updata(len,b[i-1].x1,b[i-1].x1,b[i-1].y2,m);
            if (b[i].x1-b[i-1].x1>1) updata(m,b[i].x1-1,b[i].x1-1,0,m);
            len=b[i].y1;
            updata(len,b[i].x1,b[i].x1,ty,b[i].y1);
            ty=b[i].y2;
        }else{
            len=b[i].y1-ty;
            if (len>0){
                updata(len,b[i].x1,b[i].x1,ty,b[i].y1);
            }
            ty=max(ty,b[i].y2);
        }
    }
    b[0].y1=b[0].y1=0;
    b[0].x1=0;b[0].x2=n;
    cnt=1;
    for (i=0;i<t;i++){
        if (a[i].y1==a[i].y2){
            b[cnt]=a[i];
            if (b[cnt].x1>b[cnt].x2) swap(b[cnt].x1,b[cnt].x2);
            cnt++;
        }
    }
    b[cnt].y1=b[cnt].y2=m;
    b[cnt].x1=0;b[cnt].x2=n;
    cnt++;
    sort(b,b+cnt,cmp2);
    tx=n;
    for (i=1;i<cnt;i++){
        if (b[i].y1!=b[i-1].y1){
            len=n-tx;
            updata(len,b[i-1].x2,n,b[i-1].y1,b[i-1].y1);
            if (b[i].y1-b[i-1].y1>1){
                updata(n,0,n,b[i].y1-1,b[i].y1-1);
                if ((b[i].y1-b[i-1].y1-1)%2==0){
                    updata(n,0,n,b[i].y1-2,b[i].y1-2);
                }
            }
            len=b[i].x1;
            updata(len,0,b[i].x1,b[i].y1,b[i].y2);
            tx=b[i].x2;
        }else{
            len=b[i].x1-tx;
            if (len>0){
                updata(len,tx,b[i].x1,b[i].y1,b[i].y1);
            }
            tx=max(b[i].x2,tx);
        }
    }
    solve();
    //while (1);
    return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
using namespace std;

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef pair<int, int> P;
typedef set<P> SP;
typedef vector<P> VP;

int length(SP& s) {
  int mx = -100000, l = 0;
  for (SP::iterator it = s.begin(); it != s.end(); ++it) {
    if ((*it).first >= mx) {
      l += (*it).second - (*it).first;
      mx = (*it).second;
    }
    else {
      if ((*it).second > mx) {
	l += (*it).second - mx;
	mx = (*it).second;
      }
    }
  }
  return l;
}

int Buscar(SP& s, int xo) {
  int mx = -100000;
  for (SP::iterator it = s.begin(); it != s.end() and xo > 0; ++it) {
    if ((*it).first >= mx) {
      xo -= (*it).first - mx;
      mx = (*it).second;
    }
    else {
      if ((*it).second > mx) {
	mx = (*it).second;
      }
    }
  }
  return mx + xo;
}

int Buscar(int r, int xo, map<int, SP>& M) {
  for (map<int, SP>::iterator it = M.begin(); it != M.end(); ++it) {
    if (it->first == r) return Buscar(it->second, xo);
  }
  return -1;
}

int main() {
  int w, h, k; cin >> w >> h >> k;
  int xo = 0;
  map<int, SP> MV, MH;
  for (int i = 0; i < k; ++i) {
    int x1, y1, x2, y2; cin >> x1 >> y1 >> x2 >> y2;

    //Falta ver la interseccion
    if (x1 == x2) MV[x1].insert(P(min(y1, y2), max(y1, y2)));
    if (y1 == y2) MH[y1].insert(P(min(x1, x2), max(x1, x2)));
  }

  xo ^= w * abs((h - 1 - int(MH.size())) % 2);
//   cout << xo << endl;

  xo ^= h * abs((w - 1 - int(MV.size())) % 2);

//   cout << xo << endl;

  VP nimsh, nimsv;
  for (map<int, SP>::iterator it = MV.begin(); it != MV.end(); ++it) {
    nimsv.push_back(P(it->first, h - length(it->second)));
    xo ^= nimsv.back().second;
//     cout << nimsv.back().second << endl;
  }

  for (map<int, SP>::iterator it = MH.begin(); it != MH.end(); ++it) {
    nimsh.push_back(P(it->first, w - length(it->second)));
    xo ^= nimsh.back().second;
//     cout << nimsh.back().second << endl;
  }

//   cout << xo << endl;
  if (xo) {
    cout << "FIRST" << endl;
    bool found = false;
    int hcuts = nimsh.size();
    if (hcuts > 0) {
      int last = 0;
      for (int i = 0; i < hcuts; ++i) {
	if ((xo ^ w) <= w and nimsh[i].first > last + 1) {
	  cout << "0 " << last + 1 << " " << w - (xo ^ w)<< " " << last + 1 << endl;
	  found = true;
	}
	else if (w - nimsh[i].second >= (xo ^ (w - nimsh[i].second))) {
	  cout << "0 " << nimsh[i].first << " " << Buscar(w - nimsh[i].first, (xo ^ (w - nimsh[i].second)), MH)<< " " << nimsh[i].first << endl;
	  found = true;
	}
	last = nimsh[i].first;
      }
    }
    else if (h > 1 and (xo ^ w) <= w) {
      cout << "0 1 0 " << w - (xo ^ w) << endl;
      found = true;
    }
    if (not found) {
      int vcuts = nimsv.size();
      int last = 0;
      if (vcuts > 0) {
	for (int i = 0; i < vcuts; ++i) {
	  if ((xo ^ h) <= h and nimsv[i].first > last + 1) {
	    cout << last + 1 << " 0 " << last + 1 << " " << h - (xo ^ h) << endl;
	    found = true;
	  }
	  else if (h - nimsv[i].second >= (xo ^ (h - nimsv[i].second))) {
	    cout << nimsv[i].first << " 0 " << nimsv[i].first << " " << Buscar(nimsv[i].first, h - (xo ^ (h - nimsv[i].second)), MV) << endl;
	    found = true;
	  }
	  last = nimsv[i].first;
	}
      }
      else if (w > 1 and (xo ^ h) <= h) {
// 	    cout << "caca" << endl;
	cout << "1 0 1 " << h - (xo ^ h) << endl;
	found = true;
      }
    }
  }
  else cout << "SECOND" << endl;
}


#include <iostream>
#include <vector>
#include <map>
#include <set>
using namespace std;

typedef pair<int, int> PII;
typedef set<PII> SPII;
typedef map<int, SPII> MSPII;
typedef vector<PII> VPII;

int length(SPII& s) {
  int last = 0, len = 0;
  for (SPII::iterator it = s.begin(); it != s.end(); ++it) {
    if (last <= it->first) {
      len += it->second - it->first;
      last = it->second;
    }
    else if (it->second >= last) {
      len += it->second - last;
      last = it->second;
    }
  }
  return len;
}

int Buscar(SPII& s, int obj) {
  int last = 0, len = 0;
  for (SPII::iterator it = s.begin(); it != s.end(); ++it) {
    if (it->first >= last) {
      len += it->first - last;
      last = it->second;
      if (len >= obj) {
	return it->first - (len - obj);
      }
    }
    else last = max(last, it->second);
  }
  return last - (len - obj);
}

int main() {
  int w, h, k; cin >> w >> h >> k;
  MSPII hcuts, vcuts;
  for (int i = 0; i < k; ++i) {
    int x1, y1, x2, y2; cin >> x1 >> y1 >> x2 >> y2;
    if (x1 == x2) vcuts[x1].insert(PII(min(y1, y2), max(y1, y2)));
    else hcuts[y1].insert(PII(min(x1, x2), max(x1, x2)));
  }

  int nim = 0;
  nim ^= h * ((w - 1 - vcuts.size()) % 2);
  nim ^= w * ((h - 1 - hcuts.size()) % 2);

  VPII hc, vc;
  for (MSPII::iterator it = hcuts.begin(); it != hcuts.end(); ++it) {
    hc.push_back(PII(it->first, w - length(it->second)));
    nim ^= hc.back().second;
  }
  for (MSPII::iterator it = vcuts.begin(); it != vcuts.end(); ++it) {
    vc.push_back(PII(it->first, h - length(it->second)));
    nim ^= vc.back().second;
  }

//   cout << nim << endl;

  if (nim) {
    cout << "FIRST" << endl;
    bool found = false;
    //Cortes verticales
    int last = 0, nvc = vc.size();
    for (int j = 0; j < nvc and not found; ++j) {
      int col = vc[j].first;
      if (col > last + 1) {
	if ((nim ^ h) <= h) {
	  cout << last + 1 << " 0 " << last + 1 << " " << h - (nim ^ h) << endl;
	  found = true;
	}
      }
      if (not found) {
	int libre = vc[j].second;
	if ((nim ^ libre) <= libre) {
	  cout << col << " " << Buscar(vcuts[col], nim ^ libre) << " " << col << " " << h << endl;
	  found = true;
	}
      }
      last = col;
    }
    if (not found and w > last + 1) {
      if ((nim ^ h) <= h) {
	cout << last + 1 << " 0 " << last + 1 << " " << h - (nim ^ h) << endl;
	found = true;
      }
    }

    last = 0;
    int nhc = hc.size();
    for (int j = 0; j < nhc and not found; ++j) {
      int row = hc[j].first;
      if (row > last + 1) {
	if ((nim ^ w) <= w) {
	  cout << "0 " << last + 1 << " " << w - (nim ^ w) << " " << last + 1 << endl;
	  found = true;
	}
      }
      if (not found) {
	int libre = hc[j].second;
	if ((nim ^ libre) <= libre) {
	  cout << Buscar(hcuts[row], nim ^ libre) << " " << row << " " << w << " " << row << endl;
	  found = true;
	}
      }
      last = row;
    }
    if (not found and h > last + 1) {
      if ((nim ^ w) <= w) {
	cout << "0 " << last + 1 << " " << w - (nim ^ w) << " " << last + 1 << endl;
	found = true;
      }
    }
  }
  else cout << "SECOND" << endl;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
using namespace std;

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef pair<int, int> P;
typedef set<P> SP;
typedef vector<P> VP;

int length(SP& s) {
  int mx = -100000, l = 0;
  for (SP::iterator it = s.begin(); it != s.end(); ++it) {
    if ((*it).first >= mx) {
      l += (*it).second - (*it).first;
      mx = (*it).second;
    }
    else {
      if ((*it).second > mx) {
	l += (*it).second - mx;
	mx = (*it).second;
      }
    }
  }
  return l;
}

int Buscar(SP& s, int xo) {
  int mx = 0;
  for (SP::iterator it = s.begin(); it != s.end() and xo > 0; ++it) {
    if ((*it).first >= mx) {
      xo -= (*it).first - mx;
      mx = (*it).second;
    }
    else {
      if ((*it).second > mx) {
	mx = (*it).second;
      }
    }
  }
  return mx + xo;
}

int Buscar(int r, int xo, map<int, SP>& M) {
  for (map<int, SP>::iterator it = M.begin(); it != M.end(); ++it) {
    if (it->first == r) return Buscar(it->second, xo);
  }
  return -1;
}

int main() {
  int w, h, k; cin >> w >> h >> k;
  int xo = 0;
  map<int, SP> MV, MH;
  for (int i = 0; i < k; ++i) {
    int x1, y1, x2, y2; cin >> x1 >> y1 >> x2 >> y2;

    //Falta ver la interseccion
    if (x1 == x2) MV[x1].insert(P(min(y1, y2), max(y1, y2)));
    if (y1 == y2) MH[y1].insert(P(min(x1, x2), max(x1, x2)));
  }

  xo ^= w * abs((h - 1 - int(MH.size())) % 2);
//   cout << xo << endl;

  xo ^= h * abs((w - 1 - int(MV.size())) % 2);

//   cout << xo << endl;

  VP nimsh, nimsv;
  for (map<int, SP>::iterator it = MV.begin(); it != MV.end(); ++it) {
    nimsv.push_back(P(it->first, h - length(it->second)));
    xo ^= nimsv.back().second;
//     cout << nimsv.back().second << endl;
  }
//   cout << xo << endl;

  for (map<int, SP>::iterator it = MH.begin(); it != MH.end(); ++it) {
    nimsh.push_back(P(it->first, w - length(it->second)));
    xo ^= nimsh.back().second;
//     cout << nimsh.back().second << endl;
  }

//   cout << xo << endl;
  if (xo) {
    cout << "FIRST" << endl;
    bool found = false;
    int hcuts = nimsh.size();
    int last = 0;
    if (hcuts > 0) {
      for (int i = 0; i < hcuts and not found; ++i) {
	if ((xo ^ w) <= w and nimsh[i].first > last + 1) {
	  cout << "0 " << last + 1 << " " << w - (xo ^ w) << " " << last + 1 << endl;
	  found = true;
	}
	else if (nimsh[i].second >= (xo ^ (nimsh[i].second))) {
	  cout << "0 " << nimsh[i].first << " " << Buscar(nimsh[i].first, nimsh[i].second - (xo ^ (nimsh[i].second)), MH) << " " << nimsh[i].first << endl;
	  found = true;
	}
	last = nimsh[i].first;
      }
    }
    if (not found and h > last + 1 and (xo ^ w) <= w) {
      cout << "0 " << last + 1 << " " << w - (xo ^ w) << " " << last + 1 << endl;
      found = true;
    }
    if (not found) {
      int vcuts = nimsv.size();
      last = 0;
      if (vcuts > 0) {
	for (int i = 0; i < vcuts and not found; ++i) {
	  if ((xo ^ h) <= h and nimsv[i].first > last + 1) {
	    cout << last + 1 << " 0 " << last + 1 << " " << h - (xo ^ h) << endl;
	    found = true;
	  }
	  else if (nimsv[i].second >= (xo ^ (nimsv[i].second))) {
	    cout << nimsv[i].first << " 0 " << nimsv[i].first << " " << Buscar(nimsv[i].first, nimsv[i].second - (xo ^ (nimsv[i].second)), MV) << endl;
	    found = true;
	  }
	  last = nimsv[i].first;
	}
      }
      if (not found and w > last + 1 and (xo ^ h) <= h) {
	cout << last + 1 << " 0 " << last + 1 << " " << h - (xo ^ h) << endl;
	found = true;
      }
    }
  }
  else cout << "SECOND" << endl;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
using namespace std;

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef pair<int, int> P;
typedef set<P> SP;
typedef vector<P> VP;

int length(SP& s) {
  int mx = -100000, l = 0;
  for (SP::iterator it = s.begin(); it != s.end(); ++it) {
    if ((*it).first >= mx) {
      l += (*it).second - (*it).first;
      mx = (*it).second;
    }
    else {
      if ((*it).second > mx) {
	l += (*it).second - mx;
	mx = (*it).second;
      }
    }
  }
  return l;
}

int Buscar(SP& s, int xo) {
  int mx = 0;
  for (SP::iterator it = s.begin(); it != s.end() and xo > 0; ++it) {
    if ((*it).first >= mx) {
      xo -= (*it).first - mx;
      mx = (*it).second;
    }
    else {
      if ((*it).second > mx) {
	mx = (*it).second;
      }
    }
  }
  return mx + xo;
}

int Buscar(int r, int xo, map<int, SP>& M) {
  for (map<int, SP>::iterator it = M.begin(); it != M.end(); ++it) {
    if (it->first == r) return Buscar(it->second, xo);
  }
  return -1;
}

int main() {
  int w, h, k; cin >> w >> h >> k;
  int xo = 0;
  map<int, SP> MV, MH;
  for (int i = 0; i < k; ++i) {
    int x1, y1, x2, y2; cin >> x1 >> y1 >> x2 >> y2;

    //Falta ver la interseccion
    if (x1 == x2) MV[x1].insert(P(min(y1, y2), max(y1, y2)));
    if (y1 == y2) MH[y1].insert(P(min(x1, x2), max(x1, x2)));
  }

  xo ^= w * abs((h - 1 - int(MH.size())) % 2);
//   cout << xo << endl;

  xo ^= h * abs((w - 1 - int(MV.size())) % 2);

//   cout << xo << endl;

  VP nimsh, nimsv;
  for (map<int, SP>::iterator it = MV.begin(); it != MV.end(); ++it) {
    nimsv.push_back(P(it->first, h - length(it->second)));
    xo ^= nimsv.back().second;
//     cout << nimsv.back().second << endl;
  }
//   cout << xo << endl;

  for (map<int, SP>::iterator it = MH.begin(); it != MH.end(); ++it) {
    nimsh.push_back(P(it->first, w - length(it->second)));
    xo ^= nimsh.back().second;
//     cout << nimsh.back().second << endl;
  }

//   cout << xo << endl;
  if (xo) {
    cout << "FIRST" << endl;
    bool found = false;
    int hcuts = nimsh.size();
    int last = 0;
    if (hcuts > 0) {
      for (int i = 0; i < hcuts and not found; ++i) {
	if ((xo ^ w) <= w and nimsh[i].first > last + 1) {
	  cout << "0 " << last + 1 << " " << w - (xo ^ w) << " " << last + 1 << endl;
	  found = true;
	}
	else if (nimsh[i].second >= (xo ^ (nimsh[i].second))) {
	  cout << "0 " << nimsh[i].first << " " << Buscar(nimsh[i].first, nimsh[i].second - (xo ^ (nimsh[i].second)), MH) << " " << nimsh[i].first << endl;
	  found = true;
	}
	last = nimsh[i].first;
      }
    }
    if (not found and h > last + 1 and (xo ^ w) <= w) {
      cout << "0 " << last + 1 << " " << w - (xo ^ w) << " " << last + 1 << endl;
      found = true;
    }
    if (not found) {
      int vcuts = nimsv.size();
      last = 0;
      if (vcuts > 0) {
	for (int i = 0; i < vcuts and not found; ++i) {
	  cout << nimsv[i].first << " " << nimsv[i].second << endl;
	  if ((xo ^ h) <= h and nimsv[i].first > last + 1) {
	    cout << last + 1 << " 0 " << last + 1 << " " << h - (xo ^ h) << endl;
	    found = true;
	  }
	  else if (nimsv[i].second >= (xo ^ (nimsv[i].second))) {
	    cout << nimsv[i].first << " 0 " << nimsv[i].first << " " << Buscar(nimsv[i].first, nimsv[i].second - (xo ^ (nimsv[i].second)), MV) << endl;
	    found = true;
	  }
	  last = nimsv[i].first;
	}
      }
      if (not found and w > last + 1 and (xo ^ h) <= h) {
	cout << last + 1 << " 0 " << last + 1 << " " << h - (xo ^ h) << endl;
	found = true;
      }
    }
  }
  else cout << "SECOND" << endl;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
using namespace std;

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef pair<int, int> P;
typedef set<P> SP;
typedef vector<P> VP;

int length(SP& s) {
  int mx = -100000, l = 0;
  for (SP::iterator it = s.begin(); it != s.end(); ++it) {
    if ((*it).first >= mx) {
      l += (*it).second - (*it).first;
      mx = (*it).second;
    }
    else {
      if ((*it).second > mx) {
	l += (*it).second - mx;
	mx = (*it).second;
      }
    }
  }
  return l;
}

int Buscar(SP& s, int xo) {
  int mx = -100000;
  for (SP::iterator it = s.begin(); it != s.end() and xo > 0; ++it) {
    if ((*it).first >= mx) {
      xo -= (*it).first - mx;
      mx = (*it).second;
    }
    else {
      if ((*it).second > mx) {
	mx = (*it).second;
      }
    }
  }
  return mx + xo;
}

int Buscar(int r, int xo, map<int, SP>& M) {
  for (map<int, SP>::iterator it = M.begin(); it != M.end(); ++it) {
    if (it->first == r) return Buscar(it->second, xo);
  }
  return -1;
}

int main() {
  int n, m, k; cin >> n >> m >> k;
  int xo = 0;
  map<int, SP> MV, MH;
  for (int i = 0; i < k; ++i) {
    int x1, y1, x2, y2; cin >> x1 >> y1 >> x2 >> y2;

    //Falta ver la interseccion
    if (x1 == x2) MV[x1].insert(P(min(y1, y2), max(y1, y2)));
    if (y1 == y2) MH[y1].insert(P(min(x1, x2), max(x1, x2)));
  }

  xo ^= n * abs((m - 1 - int(MH.size())) % 2);
//   cout << xo << endl;

  xo ^= m * abs((n - 1 - int(MV.size())) % 2);

//   cout << xo << endl;

  VP nimsh, nimsv;
  for (map<int, SP>::iterator it = MV.begin(); it != MV.end(); ++it) {
    nimsv.push_back(P(it->first, m - length(it->second)));
    xo ^= nimsv.back().second;
//     cout << nimsv.back().second << endl;
  }

  for (map<int, SP>::iterator it = MH.begin(); it != MH.end(); ++it) {
    nimsh.push_back(P(it->first, n - length(it->second)));
    xo ^= nimsh.back().second;
//     cout << nimsh.back().second << endl;
  }

//   cout << xo << endl;
  if (xo) {
    cout << "FIRST" << endl;
    bool found = false;
    int hcuts = nimsh.size();
    if (hcuts > 0) {
      int last = 0;
      for (int i = 0; i < hcuts; ++i) {
	if ((xo ^ n) <= n and nimsh[i].first > last + 1) {
	  cout << "0 " << last + 1 << " " << n - (xo ^ n)<< " " << last + 1 << endl;
	  found = true;
	}
	else if (n - nimsh[i].second >= (xo ^ (n - nimsh[i].second))) {
	  cout << "0 " << nimsh[i].first << " " << Buscar(n - nimsh[i].first, (xo ^ (n - nimsh[i].second)), MH)<< " " << nimsh[i].first << endl;
	  found = true;
	}
	last = nimsh[i].first;
      }
    }
    else if (m > 1 and (xo ^ n) <= n) {
      cout << "1 0 1 " << n - (xo ^ n) << endl;
      found = true;
    }
    if (not found) {
      int vcuts = nimsv.size();
      int last = 0;
      if (vcuts > 0) {
	for (int i = 0; i < vcuts; ++i) {
	  if ((xo ^ m) <= m and nimsv[i].first > last + 1) {
	    cout << last + 1 << " 0 " << last + 1 << " " << m - (xo ^ m) << endl;
	    found = true;
	  }
	  else if (m - nimsv[i].second >= (xo ^ (m - nimsv[i].second))) {
	    cout << nimsv[i].first << " 0 " << nimsv[i].first << " " << Buscar(nimsv[i].first, m - (xo ^ (m - nimsv[i].second)), MV) << endl;
	    found = true;
	  }
	  last = nimsv[i].first;
	}
      }
      else if (n > 1 and (xo ^ m) <= m) {
// 	    cout << "caca" << endl;
	cout << "1 0 1 " << m - (xo ^ m) << endl;
	found = true;
      }
    }
  }
  else cout << "SECOND" << endl;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
using namespace std;

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef pair<int, int> P;
typedef set<P> SP;
typedef vector<P> VP;

int length(SP& s) {
  int mx = -100000, l = 0;
  for (SP::iterator it = s.begin(); it != s.end(); ++it) {
    if ((*it).first >= mx) {
      l += (*it).second - (*it).first;
      mx = (*it).second;
    }
    else {
      if ((*it).second > mx) {
    l += (*it).second - mx;
    mx = (*it).second;
      }
    }
  }
  return l;
}

int Buscar(SP& s, int xo) {
  int mx = -100000;
  for (SP::iterator it = s.begin(); it != s.end() and xo > 0; ++it) {
    if ((*it).first >= mx) {
      xo -= (*it).first - mx;
      mx = (*it).second;
    }
    else {
      if ((*it).second > mx) {
    mx = (*it).second;
      }
    }
  }
  return mx + xo;
}

int Buscar(int r, int xo, map<int, SP>& M) {
  for (map<int, SP>::iterator it = M.begin(); it != M.end(); ++it) {
    if (it->first == r) return Buscar(it->second, xo);
  }
  return -1;
}

int main() {
  int n, m, k; cin >> n >> m >> k;
  int xo = 0;
  map<int, SP> MV, MH;
  for (int i = 0; i < k; ++i) {
    int x1, y1, x2, y2; cin >> x1 >> y1 >> x2 >> y2;

    //Falta ver la interseccion
    if (x1 == x2) MV[x1].insert(P(min(y1, y2), max(y1, y2)));
    if (y1 == y2) MH[y1].insert(P(min(x1, x2), max(x1, x2)));
  }

  xo ^= n * abs((m - 1 - int(MH.size())) % 2);
//   cout << xo << endl;

  xo ^= m * abs((n - 1 - int(MV.size())) % 2);

//   cout << xo << endl;

  VP nimsh, nimsv;
  for (map<int, SP>::iterator it = MV.begin(); it != MV.end(); ++it) {
    nimsv.push_back(P(it->first, m - length(it->second)));
    xo ^= nimsv.back().second;
//     cout << nimsv.back().second << endl;
  }

  for (map<int, SP>::iterator it = MH.begin(); it != MH.end(); ++it) {
    nimsh.push_back(P(it->first, n - length(it->second)));
    xo ^= nimsh.back().second;
//     cout << nimsh.back().second << endl;
  }

  if (xo) {
    cout << "FIRST" << endl;
    bool found = false;
    int hcuts = nimsh.size();
    if (hcuts > 0) {
      int last = 0;
      for (int i = 0; i < hcuts; ++i) {
    if (nimsh[i].first > last + 1) {
      cout << last + 1 << " 0 " << last + 1 << " " << xo << endl;
      found = true;
    }
    else if (n - nimsh[i].second >= xo) {
      cout << nimsh[i].first << " 0 " << nimsh[i].first << " " << Buscar(nimsh[i].first, xo, MH) << endl;
      found = true;
    }
    last = nimsh[i].first;
      }
    }
    else if (n > 1) {
      cout << "1 0 1 " << xo << endl;
      found = true;
    }
    if (not found) {
      int vcuts = nimsv.size();
      int last = 0;
      if (vcuts > 0) {
    for (int i = 0; i < vcuts; ++i) {
      if (nimsv[i].first > last + 1) {
        cout << "0 " << last + 1 << " " << xo << " " << last + 1 << endl;
        found = true;
      }
      else if (m - nimsv[i].second >= xo) {
        cout << "0 " << nimsv[i].first << " " << Buscar(nimsv[i].first, xo, MV) << " " << nimsv[i].first << endl;
        found = true;
      }
      last = nimsv[i].first;
    }
      }
      else if (m > 1) {
    cout << "0 1 " << xo << " 1" << endl;
    found = true;
      }
    }
  }
  else cout << "SECOND" << endl;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
using namespace std;

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef pair<int, int> P;
typedef set<P> SP;
typedef vector<P> VP;

int length(SP& s) {
  int mx = -100000, l = 0;
  for (SP::iterator it = s.begin(); it != s.end(); ++it) {
    if ((*it).first >= mx) {
      l += (*it).second - (*it).first;
      mx = (*it).second;
    }
    else {
      if ((*it).second > mx) {
	l += (*it).second - mx;
	mx = (*it).second;
      }
    }
  }
  return l;
}

int Buscar(SP& s, int xo) {
  int mx = 0;
  for (SP::iterator it = s.begin(); it != s.end() and xo > 0; ++it) {
    if ((*it).first >= mx) {
      xo -= (*it).first - mx;
      mx = (*it).second;
    }
    else {
      if ((*it).second > mx) {
	mx = (*it).second;
      }
    }
  }
  return mx + xo;
}

int Buscar(int r, int xo, map<int, SP>& M) {
  for (map<int, SP>::iterator it = M.begin(); it != M.end(); ++it) {
    if (it->first == r) return Buscar(it->second, xo);
  }
  return -1;
}

int main() {
  int w, h, k; cin >> w >> h >> k;
  int xo = 0;
  map<int, SP> MV, MH;
  for (int i = 0; i < k; ++i) {
    int x1, y1, x2, y2; cin >> x1 >> y1 >> x2 >> y2;

    //Falta ver la interseccion
    if (x1 == x2) MV[x1].insert(P(min(y1, y2), max(y1, y2)));
    if (y1 == y2) MH[y1].insert(P(min(x1, x2), max(x1, x2)));
  }

  xo ^= w * abs((h - 1 - int(MH.size())) % 2);
//   cout << xo << endl;

  xo ^= h * abs((w - 1 - int(MV.size())) % 2);

//   cout << xo << endl;

  VP nimsh, nimsv;
  for (map<int, SP>::iterator it = MV.begin(); it != MV.end(); ++it) {
    nimsv.push_back(P(it->first, h - length(it->second)));
    xo ^= nimsv.back().second;
//     cout << nimsv.back().second << endl;
  }

  for (map<int, SP>::iterator it = MH.begin(); it != MH.end(); ++it) {
    nimsh.push_back(P(it->first, w - length(it->second)));
    xo ^= nimsh.back().second;
//     cout << nimsh.back().second << endl;
  }

//   cout << xo << endl;
  if (xo) {
    cout << "FIRST" << endl;
    bool found = false;
    int hcuts = nimsh.size();
    if (hcuts > 0) {
      int last = 0;
      for (int i = 0; i < hcuts and not found; ++i) {
	if ((xo ^ w) <= w and nimsh[i].first > last + 1) {
	  cout << "0 " << last + 1 << " " << w - (xo ^ w) << " " << last + 1 << endl;
	  found = true;
	}
	else if (nimsh[i].second >= (xo ^ (nimsh[i].second))) {
	  cout << "0 " << nimsh[i].first << " " << Buscar(nimsh[i].first, nimsh[i].second - (xo ^ (nimsh[i].second)), MH) << " " << nimsh[i].first << endl;
	  found = true;
	}
	last = nimsh[i].first;
      }
    }
    else if (h > 1 and (xo ^ w) <= w) {
      cout << "0 1 " << w - (xo ^ w) << " 1" << endl;
      found = true;
    }
    if (not found) {
      int vcuts = nimsv.size();
      int last = 0;
      if (vcuts > 0) {
	for (int i = 0; i < vcuts and not found; ++i) {
	  if ((xo ^ h) <= h and nimsv[i].first > last + 1) {
	    cout << last + 1 << " 0 " << last + 1 << " " << h - (xo ^ h) << endl;
	    found = true;
	  }
	  else if (nimsv[i].second >= (xo ^ (nimsv[i].second))) {
	    cout << nimsv[i].first << " 0 " << nimsv[i].first << " " << Buscar(nimsv[i].first, nimsv[i].second - (xo ^ (nimsv[i].second)), MV) << endl;
	    found = true;
	  }
	  last = nimsv[i].first;
	}
      }
      else if (w > 1 and (xo ^ h) <= h) {
	cout << "1 0 1 " << h - (xo ^ h) << endl;
	found = true;
      }
    }
  }
  else cout << "SECOND" << endl;
}


#include <iostream>
#include <vector>
#include <map>
#include <set>
using namespace std;

typedef pair<int, int> PII;
typedef set<PII> SPII;
typedef map<int, SPII> MSPII;
typedef vector<PII> VPII;

int length(SPII& s) {
  int last = 0, len = 0;
  for (SPII::iterator it = s.begin(); it != s.end(); ++it) {
    if (last <= it->first) {
      len += it->second - it->first;
      last = it->second;
    }
    else if (it->second >= last) {
      len += it->second - last;
      last = it->second;
    }
  }
  return len;
}

int Buscar(SPII& s, int obj) {
  int last = 0, len = 0;
  for (SPII::iterator it = s.begin(); it != s.end(); ++it) {
    if (it->first >= last) {
      len = it->first - last;
      last = it->second;
      if (len >= obj) {
	return last - (len - obj);
      }
    }
    else last = max(last, it->second);
  }
  return len;
}

int main() {
  int w, h, k; cin >> w >> h >> k;
  MSPII hcuts, vcuts;
  for (int i = 0; i < k; ++i) {
    int x1, y1, x2, y2; cin >> x1 >> y1 >> x2 >> y2;
    if (x1 == x2) vcuts[x1].insert(PII(min(y1, y2), max(y1, y2)));
    else hcuts[y1].insert(PII(min(x1, x2), max(x1, x2)));
  }

  int nim = 0;
  nim ^= h * ((w - 1 - vcuts.size()) % 2);
  nim ^= w * ((h - 1 - hcuts.size()) % 2);

  VPII hc, vc;
  for (MSPII::iterator it = hcuts.begin(); it != hcuts.end(); ++it) {
    hc.push_back(PII(it->first, w - length(it->second)));
    nim ^= hc.back().second;
  }
  for (MSPII::iterator it = vcuts.begin(); it != vcuts.end(); ++it) {
    vc.push_back(PII(it->first, h - length(it->second)));
    nim ^= vc.back().second;
  }

//   cout << nim << endl;

  if (nim) {
    cout << "FIRST" << endl;
    bool found = false;
    //Cortes verticales
    int last = 0, nvc = vc.size();
    for (int j = 0; j < nvc and not found; ++j) {
      int col = vc[j].first;
      if (col > last + 1) {
	if ((nim ^ h) <= h) {
	  cout << last + 1 << " 0 " << last + 1 << " " << h - (nim ^ h) << endl;
	  found = true;
	}
      }
      if (not found) {
	int libre = vc[j].second;
	if ((nim ^ libre) <= libre) {
	  cout << col << " " << Buscar(vcuts[col], nim ^ libre) << " " << col << " " << h << endl;
	  found = true;
	}
      }
      last = col;
    }
    if (not found and w > last + 1) {
      if ((nim ^ h) <= h) {
	cout << last + 1 << " 0 " << last + 1 << " " << h - (nim ^ h) << endl;
	found = true;
      }
    }

    last = 0;
    int nhc = hc.size();
    for (int j = 0; j < nhc and not found; ++j) {
      int row = hc[j].first;
      if (row > last + 1) {
	if ((nim ^ w) <= w) {
	  cout << last + 1 << " 0 " << last + 1 << " " << w - (nim ^ w) << endl;
	  found = true;
	}
      }
      if (not found) {
	int libre = hc[j].second;
	if ((nim ^ libre) <= libre) {
	  cout << row << " " << Buscar(hcuts[row], nim ^ libre) << " " << row << " " << w << endl;
	  found = true;
	}
      }
      last = row;
    }
    if (not found and h > last + 1) {
      if ((nim ^ w) <= w) {
	cout << last + 1 << " 0 " << last + 1 << " " << w - (nim ^ w) << endl;
	found = true;
      }
    }
  }
  else cout << "SECOND" << endl;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
using namespace std;

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef pair<int, int> P;
typedef set<P> SP;
typedef vector<P> VP;

int length(SP& s) {
  int mx = -100000, l = 0;
  for (SP::iterator it = s.begin(); it != s.end(); ++it) {
    if ((*it).first >= mx) {
      l += (*it).second - (*it).first;
      mx = (*it).second;
    }
    else {
      if ((*it).second > mx) {
	l += (*it).second - mx;
	mx = (*it).second;
      }
    }
  }
  return l;
}

int Buscar(SP& s, int xo) {
  int mx = -100000;
  for (SP::iterator it = s.begin(); it != s.end() and xo > 0; ++it) {
    if ((*it).first >= mx) {
      xo -= (*it).first - mx;
      mx = (*it).second;
    }
    else {
      if ((*it).second > mx) {
	mx = (*it).second;
      }
    }
  }
  return mx + xo;
}

int Buscar(int r, int xo, map<int, SP>& M) {
  for (map<int, SP>::iterator it = M.begin(); it != M.end(); ++it) {
    if (it->first == r) return Buscar(it->second, xo);
  }
  return -1;
}

int main() {
  int w, h, k; cin >> w >> h >> k;
  int xo = 0;
  map<int, SP> MV, MH;
  for (int i = 0; i < k; ++i) {
    int x1, y1, x2, y2; cin >> x1 >> y1 >> x2 >> y2;

    //Falta ver la interseccion
    if (x1 == x2) MV[x1].insert(P(min(y1, y2), max(y1, y2)));
    if (y1 == y2) MH[y1].insert(P(min(x1, x2), max(x1, x2)));
  }

  xo ^= w * abs((h - 1 - int(MH.size())) % 2);
//   cout << xo << endl;

  xo ^= h * abs((w - 1 - int(MV.size())) % 2);

//   cout << xo << endl;

  VP nimsh, nimsv;
  for (map<int, SP>::iterator it = MV.begin(); it != MV.end(); ++it) {
    nimsv.push_back(P(it->first, h - length(it->second)));
    xo ^= nimsv.back().second;
//     cout << nimsv.back().second << endl;
  }

  for (map<int, SP>::iterator it = MH.begin(); it != MH.end(); ++it) {
    nimsh.push_back(P(it->first, w - length(it->second)));
    xo ^= nimsh.back().second;
//     cout << nimsh.back().second << endl;
  }

//   cout << xo << endl;
  if (xo) {
    cout << "FIRST" << endl;
    bool found = false;
    int hcuts = nimsh.size();
    if (hcuts > 0) {
      int last = 0;
      for (int i = 0; i < hcuts; ++i) {
	if ((xo ^ w) <= w and nimsh[i].first > last + 1) {
	  cout << "0 " << last + 1 << " " << w - (xo ^ w)<< " " << last + 1 << endl;
	  found = true;
	}
	else if (nimsh[i].second >= (xo ^ (nimsh[i].second))) {
	  cout << "0 " << nimsh[i].first << " " << Buscar(nimsh[i].first, w - (xo ^ (nimsh[i].second)), MH) << " " << nimsh[i].first << endl;
	  found = true;
	}
	last = nimsh[i].first;
      }
    }
    else if (h > 1 and (xo ^ w) <= w) {
      cout << "0 1 " << w - (xo ^ w) << " 1" << endl;
      found = true;
    }
    if (not found) {
      int vcuts = nimsv.size();
      int last = 0;
      if (vcuts > 0) {
	for (int i = 0; i < vcuts; ++i) {
	  if ((xo ^ h) <= h and nimsv[i].first > last + 1) {
	    cout << last + 1 << " 0 " << last + 1 << " " << h - (xo ^ h) << endl;
	    found = true;
	  }
	  else if (nimsv[i].second >= (xo ^ (nimsv[i].second))) {
	    cout << nimsv[i].first << " 0 " << nimsv[i].first << " " << Buscar(nimsv[i].first, h - (xo ^ (nimsv[i].second)), MV) << endl;
	    found = true;
	  }
	  last = nimsv[i].first;
	}
      }
      else if (w > 1 and (xo ^ h) <= h) {
// 	    cout << "caca" << endl;
	cout << "1 0 1 " << h - (xo ^ h) << endl;
	found = true;
      }
    }
  }
  else cout << "SECOND" << endl;
}