#include<stdio.h>
#include<windows.h>
#include<stdlib.h>
#define uchar unsigned char
#define wide 50
#define high 25
uchar up = 0, down = 0, left = 0, right = 0;
uchar key;
int i = 0, j = 1;
int flag;
int k;
int x[] = { 0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,
24,48,
0,2,4,6,8,12,14,16,18,20,24,28,30,32,34,36,38,40,44,46,48,
0,12,20,24,40,44,48,
0,4,6,8,10,12,16,20,24,26,28,30,32,36,38,40,44,48,
0,12,16,24,36,44,48,
0,4,6,8,12,16,18,20,22,24,28,30,32,34,36,40,42,44,48,
0,8,12,16,28,36,44,48,
0,2,4,6,8,12,14,16,20,22,24,26,28,30,32,36,38,40,44,48,
0,12,20,36,44,48,
0,4,6,8,10,12,16,18,20,24,26,28,30,32,36,40,42,44,48,
0,4,16,20,32,36,48,
0,4,8,10,12,14,16,20,24,26,28,32,34,36,38,40,42,44,46,48,
0,4,12,20,28,48,
0,4,6,8,12,16,18,20,22,24,28,30,32,34,36,38,40,44,48,
0,12,16,28,36,44,48,
0,4,6,8,10,12,16,20,22,24,26,28,30,32,36,40,42,44,48,
0,12,36,40,48,
0,2,4,6,8,12,14,16,18,20,22,24,26,28,30,32,34,36,40,42,44,46,48,
0,8,16,36,48,
0,4,6,8,10,12,16,20,22,24,26,28,30,32,36,38,40,42,44,48,
0,4,12,20,32,44,48,
0,4,8,12,14,16,18,20,24,28,30,32,34,36,38,40,44,48,
0,8,24,
0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48 };
int y[] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1,1,
2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
3,3,3,3,3,3,3,
4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
5,5,5,5,5,5,5,
6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
7,7,7,7,7,7,7,7,
8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
9,9,9,9,9,9,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
11,11,11,11,11,11,11,
12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
13,13,13,13,13,13,
14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,
15,15,15,15,15,15,15,
16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
17,17,17,17,17,
18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,
19,19,19,19,19,
20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,
21,21,21,21,21,21,21,
22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,
23,23,23,