Language: C

D[13][3]={{1,0,0},{0,1,0},{0,0,1},{1,1,0},{1,0,1},{0,1,1},{1,-1,0},{1,0,-1},{0,1,-1},{1,1,1},{-1,1,1},{1,-1,1},{1,1,-1}};
M[9][9][9],H[9][9],q[2];main(n,m,p,I,x,y,z,j,c,d,J){for(;scanf("%d%d%d",&n,&m,&p),n;){
	for(memset(M,I=0,sizeof(M)),memset(H,I=0,sizeof(H)),c=1;I++<p;c*=-1){
		scanf("%d%d",&x,&y);
		if(H[x][y]==0)H[x][y]=1;
		M[x][y][z=H[x][y]++]=c;
		for(d=0;d<13;d++){
			for(j=0;j<2;j++)for(J=,q[j]=J;;q[j]+=2*j-1)if(M[x+D[d][0]*q[j]][y+D[d][1]*q[j]][z+D[d][2]*q[j]]!=c)break;
			if(q[1]-q[0]-1>=m){printf(c==1?"Black %d\n":"White %d\n",I);goto next;}
		}
	}
	puts("Draw");
next:
	for(;I++<p;)scanf("%d%d",&x,&y);
}exit(0);}

Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | D[13][3]={{1,0,0},{0,1,0},{0,0,1},{1,1,0},{1,0,1},{0,1,1},{1,-1,0},{1,0,-1},{0,1,-1},{1,1,1},{-1,1,1},{1,-1,1},{1,1,-1}};
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 'D' [-Wimplicit-int]
main.c:2:1: warning: data definition has no type or storage class
    2 | M[9][9][9],H[9][9],q[2];main(n,m,p,I,x,y,z,j,c,d,J){for(;scanf("%d%d%d",&n,&m,&p),n;){
      | ^
main.c:2:1: error: type defaults to 'int' in declaration of 'M' [-Wimplicit-int]
main.c:2:12: error: type defaults to 'int' in declaration of 'H' [-Wimplicit-int]
    2 | M[9][9][9],H[9][9],q[2];main(n,m,p,I,x,y,z,j,c,d,J){for(;scanf("%d%d%d",&n,&m,&p),n;){
      |            ^
main.c:2:20: error: type defaults to 'int' in declaration of 'q' [-Wimplicit-int]
    2 | M[9][9][9],H[9][9],q[2];main(n,m,p,I,x,y,z,j,c,d,J){for(;scanf("%d%d%d",&n,&m,&p),n;){
      |                    ^
main.c:2:25: error: return type defaults to 'int' [-Wimplicit-int]
    2 | M[9][9][9],H[9][9],q[2];main(n,m,p,I,x,y,z,j,c,d,J){for(;scanf("%d%d%d",&n,&m,&p),n;){
      |                         ^~~~
main.c: In function 'main':
main.c:2:25: error: type of 'n' defaults to 'int' [-Wimplicit-int]
main.c:2:25: error: type of 'm' defaults to 'int' [-Wimplicit-int]
main.c:2:25: error: type of 'p' defaults to 'int' [-Wimplicit-int]
main.c:2:25: error: type of 'I' defaults to 'int' [-Wimplicit-int]
main.c:2:25: error: type of 'x' defaults to 'int' [-Wimplicit-int]
main.c:2:25: error: type of 'y' defaults to 'int' [-Wimplicit-int]
main.c:2:25: error: type of 'z' defaults to 'int' [-Wimplicit-int]
main.c:2:25: error: type of 'j' defaults to 'int' [-Wimplicit-int]
main.c:2:25: error: type of 'c' defaults to 'int' [-Wimplicit-int]
main.c:2:25: error: type of 'd' defaults to 'int' [-Wimplicit-int]
main.c:2:25: error: type of 'J' defaults to 'int' [-Wimplicit-int]
main.c:2:58: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    2 | M[9][9][9],H[9][9],q[2];main(n,m,p,I,x,y,z,j,c,d,J){for(;scanf("%d%d%d",&n,&m,&p),n;){
      |                                                          ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | D[13][3]={{1,0,0},{0,1,0},{0,0,1},{1,1,0},{1,0,1},{0,1,1},{1,-1,0},{1,0,-1},{0,1,-1},{1,1,1},{-1,1,1},{1,-1,1},{1,1,-1}};
main.c:2:58: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    2 | M[9][9][9],H[9][9],q[2];main(n,m,p,I,x,y,z,j,c,d,J){for(;scanf("%d%d%d",&n,&m,&p),n;){
      |                                                          ^~~~~
main.c:2:58: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:3:13: error: implicit declaration of function 'memset' [-Wimplicit-function-declaration]
    3 |         for(memset(M,I=0,sizeof(M)),memset(H,I=0,sizeof(H)),c=1;I++<p;c*=-1){
      |             ^~~~~~
main.c:1:1: note: include '<string.h>' or provide a declaration of 'memset'
  +++ |+#include <string.h>
    1 | D[13][3]={{1,0,0},{0,1,0},{0,0,1},{1,1,0},{1,0,1},{0,1,1},{1,-1,0},{1,0,-1},{0,1,-1},{1,1,1},{-1,1,1},{1,-1,1},{1,1,-1}};
main.c:3:13: warning: incompatible implicit declaration of built-in function 'memset' [-Wbuiltin-declaration-mismatch]
    3 |         for(memset(M,I=0,sizeof(M)),memset(H,I=0,sizeof(H)),c=1;I++<p;c*=-1){
      |             ^~~~~~
main.c:3:13: note: include '<string.h>' or provide a declaration of 'memset'
main.c:8:47: error: expected expression before ',' token
    8 |                         for(j=0;j<2;j++)for(J=,q[j]=J;;q[j]+=2*j-1)if(M[x+D[d][0]*q[j]][y+D[d][1]*q[j]][z+D[d][2]*q[j]]!=c)break;
      |                                               ^
main.c:9:44: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    9 |                         if(q[1]-q[0]-1>=m){printf(c==1?"Black %d\n":"White %d\n",I);goto next;}
      |                                            ^~~~~~
main.c:9:44: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:9:44: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:9:44: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:12:9: error: implicit declaration of function 'puts' [-Wimplicit-function-declaration]
   12 |         puts("Draw");
      |         ^~~~
main.c:12:9: note: include '<stdio.h>' or provide a declaration of 'puts'
main.c:15:2: error: implicit declaration of function 'exit' [-Wimplicit-function-declaration]
   15 | }exit(0);}
      |  ^~~~
main.c:1:1: note: include '<stdlib.h>' or provide a declaration of 'exit'
  +++ |+#include <stdlib.h>
    1 | D[13][3]={{1,0,0},{0,1,0},{0,0,1},{1,1,0},{1,0,1},{0,1,1},{1,-1,0},{1,0,-1},{0,1,-1},{1,1,1},{-1,1,1},{1,-1,1},{1,1,-1}};
main.c:15:2: warning: incompatible implicit declaration of built-in function 'exit' [-Wbuiltin-declaration-mismatch]
   15 | }exit(0);}
      |  ^~~~
main.c:15:2: note: include '<stdlib.h>' or provide a declaration of 'exit'