Language: C

main(){int l=250000,r,q,n=1;char c[600000];gets(c+250000);scanf("%d",&q);for(r=l;c[r]!='\0';++r);do c[0]=='1'?++n:(c[2]^n&1?c[r++]=c[4]:c[--l]=c[4]);while(q--&&gets(c));if(n&1)for(;l<r;putchar(c[l++]));else for(;l<r;putchar(c[--r]));}

Compiler output:
main.c:1:1: error: return type defaults to 'int' [-Wimplicit-int]
    1 | main(){int l=250000,r,q,n=1;char c[600000];gets(c+250000);scanf("%d",&q);for(r=l;c[r]!='\0';++r);do c[0]=='1'?++n:(c[2]^n&1?c[r++]=c[4]:c[--l]=c[4]);while(q--&&gets(c));if(n&1)for(;l<r;putchar(c[l++]));else for(;l<r;putchar(c[--r]));}
      | ^~~~
main.c: In function 'main':
main.c:1:44: error: implicit declaration of function 'gets' [-Wimplicit-function-declaration]
    1 | main(){int l=250000,r,q,n=1;char c[600000];gets(c+250000);scanf("%d",&q);for(r=l;c[r]!='\0';++r);do c[0]=='1'?++n:(c[2]^n&1?c[r++]=c[4]:c[--l]=c[4]);while(q--&&gets(c));if(n&1)for(;l<r;putchar(c[l++]));else for(;l<r;putchar(c[--r]));}
      |                                            ^~~~
main.c:1:59: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    1 | main(){int l=250000,r,q,n=1;char c[600000];gets(c+250000);scanf("%d",&q);for(r=l;c[r]!='\0';++r);do c[0]=='1'?++n:(c[2]^n&1?c[r++]=c[4]:c[--l]=c[4]);while(q--&&gets(c));if(n&1)for(;l<r;putchar(c[l++]));else for(;l<r;putchar(c[--r]));}
      |                                                           ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | main(){int l=250000,r,q,n=1;char c[600000];gets(c+250000);scanf("%d",&q);for(r=l;c[r]!='\0';++r);do c[0]=='1'?++n:(c[2]^n&1?c[r++]=c[4]:c[--l]=c[4]);while(q--&&gets(c));if(n&1)for(;l<r;putchar(c[l++]));else for(;l<r;putchar(c[--r]));}
main.c:1:59: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    1 | main(){int l=250000,r,q,n=1;char c[600000];gets(c+250000);scanf("%d",&q);for(r=l;c[r]!='\0';++r);do c[0]=='1'?++n:(c[2]^n&1?c[r++]=c[4]:c[--l]=c[4]);while(q--&&gets(c));if(n&1)for(;l<r;putchar(c[l++]));else for(;l<r;putchar(c[--r]));}
      |                                                           ^~~~~
main.c:1:59: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:1:143: error: lvalue required as left operand of assignment
    1 | main(){int l=250000,r,q,n=1;char c[600000];gets(c+250000);scanf("%d",&q);for(r=l;c[r]!='\0';++r);do c[0]=='1'?++n:(c[2]^n&1?c[r++]=c[4]:c[--l]=c[4]);while(q--&&gets(c));if(n&1)for(;l<r;putchar(c[l++]));else for(;l<r;putchar(c[--r]));}
      |                                                                                                                                               ^
main.c:1:186: error: implicit declaration of function 'putchar' [-Wimplicit-function-declaration]
    1 | main(){int l=250000,r,q,n=1;char c[600000];gets(c+250000);scanf("%d",&q);for(r=l;c[r]!='\0';++r);do c[0]=='1'?++n:(c[2]^n&1?c[r++]=c[4]:c[--l]=c[4]);while(q--&&gets(c));if(n&1)for(;l<r;putchar(c[l++]));else for(;l<r;putchar(c[--r]));}
      |                                                                                                                                                                                          ^~~~~~~
main.c:1:186: note: include '<stdio.h>' or provide a declaration of 'putchar'