Language: C

#define X(V,N)0<=V+D[d][N]*(m-1)&&V+D[d][N]*(m-1)<n
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[7][7][7];main(n,m,p,I,x,y,i,j,k,c,d,z){for(;scanf("%d%d%d",&n,&m,&p),n;){
	for(memset(M,0,sizeof(M)),c=1,I=0;I<p;c*=-1){
		scanf("%d%d",&x,&y),x--,y--,I++;
		for(i=0;;i++)if(!M[x][y][i]){M[x][y][i]=c;break;}
		for(i=0;i<n;i++)for(j=0;j<n;j++)for(k=0;k<n;k++)for(d=0;d<13;d++)if(V(i,0)&&V(j,1)&&V(k,2)){
			for(z=0;z<m;z++)if(M[i+D[d][0]*z][j+D[d][1]*z][k+D[d][2]*z]!=c)break;
			if(z==m){printf("%s %d\n",c==1?"Black":"White",I);goto next;}
		}
	}
	puts("Draw");
next:
	for(;I<p;I++)scanf("%d%d",&x,&y);
}exit(0);}

Compiler output:
main.c:2:1: warning: data definition has no type or storage class
    2 | 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:1: error: type defaults to 'int' in declaration of 'D' [-Wimplicit-int]
main.c:3:1: warning: data definition has no type or storage class
    3 | M[7][7][7];main(n,m,p,I,x,y,i,j,k,c,d,z){for(;scanf("%d%d%d",&n,&m,&p),n;){
      | ^
main.c:3:1: error: type defaults to 'int' in declaration of 'M' [-Wimplicit-int]
main.c:3:12: error: return type defaults to 'int' [-Wimplicit-int]
    3 | M[7][7][7];main(n,m,p,I,x,y,i,j,k,c,d,z){for(;scanf("%d%d%d",&n,&m,&p),n;){
      |            ^~~~
main.c: In function 'main':
main.c:3:12: error: type of 'n' defaults to 'int' [-Wimplicit-int]
main.c:3:12: error: type of 'm' defaults to 'int' [-Wimplicit-int]
main.c:3:12: error: type of 'p' defaults to 'int' [-Wimplicit-int]
main.c:3:12: error: type of 'I' defaults to 'int' [-Wimplicit-int]
main.c:3:12: error: type of 'x' defaults to 'int' [-Wimplicit-int]
main.c:3:12: error: type of 'y' defaults to 'int' [-Wimplicit-int]
main.c:3:12: error: type of 'i' defaults to 'int' [-Wimplicit-int]
main.c:3:12: error: type of 'j' defaults to 'int' [-Wimplicit-int]
main.c:3:12: error: type of 'k' defaults to 'int' [-Wimplicit-int]
main.c:3:12: error: type of 'c' defaults to 'int' [-Wimplicit-int]
main.c:3:12: error: type of 'd' defaults to 'int' [-Wimplicit-int]
main.c:3:12: error: type of 'z' defaults to 'int' [-Wimplicit-int]
main.c:3:47: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    3 | M[7][7][7];main(n,m,p,I,x,y,i,j,k,c,d,z){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 | #define X(V,N)0<=V+D[d][N]*(m-1)&&V+D[d][N]*(m-1)<n
main.c:3:47: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    3 | M[7][7][7];main(n,m,p,I,x,y,i,j,k,c,d,z){for(;scanf("%d%d%d",&n,&m,&p),n;){
      |                                               ^~~~~
main.c:3:47: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:4:13: error: implicit declaration of function 'memset' [-Wimplicit-function-declaration]
    4 |         for(memset(M,0,sizeof(M)),c=1,I=0;I<p;c*=-1){
      |             ^~~~~~
main.c:1:1: note: include '<string.h>' or provide a declaration of 'memset'
  +++ |+#include <string.h>
    1 | #define X(V,N)0<=V+D[d][N]*(m-1)&&V+D[d][N]*(m-1)<n
main.c:4:13: warning: incompatible implicit declaration of built-in function 'memset' [-Wbuiltin-declaration-mismatch]
    4 |         for(memset(M,0,sizeof(M)),c=1,I=0;I<p;c*=-1){
      |             ^~~~~~
main.c:4:13: note: include '<string.h>' or provide a declaration of 'memset'
main.c:7:85: error: implicit declaration of function 'V' [-Wimplicit-function-declaration]
    7 |                 for(i=0;i<n;i++)for(j=0;j<n;j++)for(k=0;k<n;k++)for(d=0;d<13;d++)if(V(i,0)&&V(j,1)&&V(k,2)){
      |                                                                                     ^
main.c:9:34: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    9 |                         if(z==m){printf("%s %d\n",c==1?"Black":"White",I);goto next;}
      |                                  ^~~~~~
main.c:9:34: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:9:34: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:9:34: 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 | #define X(V,N)0<=V+D[d][N]*(m-1)&&V+D[d][N]*(m-1)<n
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'