Language: C

main(){int l,r,q,n=1;char c[600000];scanf("%s%d",c+(l=200000),&q);r=l+strlen(c+200000);do *c=='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,r,q,n=1;char c[600000];scanf("%s%d",c+(l=200000),&q);r=l+strlen(c+200000);do *c=='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:37: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    1 | main(){int l,r,q,n=1;char c[600000];scanf("%s%d",c+(l=200000),&q);r=l+strlen(c+200000);do *c=='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,r,q,n=1;char c[600000];scanf("%s%d",c+(l=200000),&q);r=l+strlen(c+200000);do *c=='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:37: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    1 | main(){int l,r,q,n=1;char c[600000];scanf("%s%d",c+(l=200000),&q);r=l+strlen(c+200000);do *c=='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:37: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:1:71: error: implicit declaration of function 'strlen' [-Wimplicit-function-declaration]
    1 | main(){int l,r,q,n=1;char c[600000];scanf("%s%d",c+(l=200000),&q);r=l+strlen(c+200000);do *c=='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 '<string.h>' or provide a declaration of 'strlen'
  +++ |+#include <string.h>
    1 | main(){int l,r,q,n=1;char c[600000];scanf("%s%d",c+(l=200000),&q);r=l+strlen(c+200000);do *c=='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:71: warning: incompatible implicit declaration of built-in function 'strlen' [-Wbuiltin-declaration-mismatch]
    1 | main(){int l,r,q,n=1;char c[600000];scanf("%s%d",c+(l=200000),&q);r=l+strlen(c+200000);do *c=='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:71: note: include '<string.h>' or provide a declaration of 'strlen'
main.c:1:139: error: lvalue required as left operand of assignment
    1 | main(){int l,r,q,n=1;char c[600000];scanf("%s%d",c+(l=200000),&q);r=l+strlen(c+200000);do *c=='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:159: error: implicit declaration of function 'gets' [-Wimplicit-function-declaration]
    1 | main(){int l,r,q,n=1;char c[600000];scanf("%s%d",c+(l=200000),&q);r=l+strlen(c+200000);do *c=='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:184: error: implicit declaration of function 'putchar' [-Wimplicit-function-declaration]
    1 | main(){int l,r,q,n=1;char c[600000];scanf("%s%d",c+(l=200000),&q);r=l+strlen(c+200000);do *c=='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:184: note: include '<stdio.h>' or provide a declaration of 'putchar'