#include #include #include #include #include #include #define WIDTH 80 #define HEIGHT 90 #define MAXPIXEL 7200 #define DELAY 10 #define RED 0 #define GREEN 1 #define BLUE 2 static int clist[2] = {0,17}; static int colors[96] = {0,255,255,255,255,0,0,0,0,0,80,0,0,121,0,0,141,39,39,33,74,0,100,79,28,0,100,54,59,146,106,63,68,164,57,70,148,128,59,141,131,110,97,59,145,166,0,136,167,54,177,0,151,0,80,151,59,121,151,90,131,141,90,162,151,80,172,162,28,197,177,59,233,217,55,100,192,100,162,141,121,182,162,131,213,192,151,121,151,172,233,213,172,49,141,223}; static int frames[2][7200] = { {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,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,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,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,0,0,0,0,2,2,2,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,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,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,0,2,2,8,2,2,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,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,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,8,10,10,2,2,2,2,2,2,2,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,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,8,10,16,15,8,8,2,2,10,8,2,2,0,0,0,0,0,0,0,0,0,0,0,2,2,2,2,2,2,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,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,2,8,16,16,15,15,8,2,10,15,10,8,2,2,0,0,0,0,0,0,0,0,2,2,2,12,12,22,22,2,2,2,2,2,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,8,16,15,11,15,15,8,8,16,16,15,8,2,2,0,0,0,0,0,0,2,2,12,22,23,24,24,24,24,24,22,22,2,2,2,2,2,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,8,15,15,15,11,11,10,8,15,15,15,15,8,2,2,0,0,0,0,2,2,12,22,22,23,23,23,23,24,24,24,24,24,22,23,22,2,2,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,8,15,8,10,15,10,11,10,15,11,11,15,15,8,2,0,0,0,2,2,12,22,22,23,23,23,23,24,24,24,24,24,24,24,24,24,12,2,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,8,8,15,15,15,10,6,8,11,15,16,15,15,11,8,2,2,0,0,2,10,22,22,22,22,23,24,24,24,24,24,24,24,24,24,24,24,24,2,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,8,15,16,15,15,11,11,15,15,8,8,15,15,15,11,8,2,0,2,2,12,22,22,22,22,22,22,23,24,24,24,24,24,24,24,24,24,24,2,2,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,8,15,16,15,15,15,15,15,15,13,6,11,11,15,11,8,2,2,2,10,22,22,23,24,23,22,22,22,22,23,23,24,24,24,24,24,24,24,12,2,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,8,15,15,15,10,15,10,15,6,21,19,10,11,15,15,10,8,2,2,12,22,22,24,24,24,13,27,27,21,22,22,22,22,23,22,23,24,24,10,2,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,6,6,15,15,15,15,15,15,21,21,25,8,8,15,8,21,12,2,2,22,22,22,24,24,24,13,27,27,27,24,28,28,28,28,28,22,22,12,2,2,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,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,8,15,8,15,8,11,15,11,23,18,17,7,8,15,21,20,25,8,2,22,22,22,24,24,24,13,26,26,27,28,28,28,28,28,28,28,21,2,2,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,10,15,14,31,9,6,15,15,15,23,7,5,5,8,10,23,19,18,7,2,22,22,23,24,24,24,13,27,13,26,27,28,28,28,28,27,27,12,2,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,15,9,31,9,15,15,11,15,20,21,5,7,7,7,8,23,19,5,7,10,22,22,23,24,24,24,27,27,28,27,2,30,28,28,27,27,27,2,2,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,10,10,15,15,15,15,11,15,10,23,7,7,10,15,8,8,20,5,7,5,19,22,22,24,24,24,23,27,28,30,30,30,30,28,30,30,10,26,2,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,10,15,15,15,15,15,11,11,21,20,7,10,15,15,15,10,6,7,10,13,22,22,23,24,24,24,13,27,28,28,28,28,28,28,30,30,28,24,2,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,8,15,15,15,15,15,8,13,12,19,7,15,15,16,15,15,15,6,10,15,22,22,23,24,24,24,24,13,13,27,28,28,28,28,27,28,28,28,24,2,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,8,10,15,15,15,15,11,10,21,18,7,15,16,14,9,9,15,15,8,21,22,22,23,24,24,24,24,13,13,26,27,28,28,28,28,27,27,28,13,2,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,8,8,15,15,15,8,11,6,23,18,7,15,16,9,27,27,14,15,12,22,22,23,23,24,24,24,24,24,13,13,27,28,28,28,27,30,28,27,20,2,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,8,15,15,15,15,15,15,10,19,8,15,16,9,23,29,29,15,22,22,22,23,23,24,24,24,24,24,21,13,26,27,28,11,11,11,11,23,22,2,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,8,10,15,10,15,15,15,11,17,7,8,16,16,14,27,27,16,22,22,22,22,23,22,22,22,23,24,28,27,13,26,28,28,26,26,27,24,12,2,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,8,16,16,15,15,15,12,22,5,5,15,15,16,14,29,9,22,22,22,18,17,17,17,17,17,20,30,28,28,27,13,26,27,27,24,24,10,2,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,8,2,10,15,15,15,15,11,10,21,12,21,15,15,15,9,15,26,22,4,17,17,17,17,17,17,17,28,28,28,27,21,24,23,24,24,23,2,2,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,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,6,8,15,8,8,8,8,8,11,11,15,15,11,8,15,15,15,15,13,13,17,17,17,17,17,17,17,17,17,28,28,27,23,23,24,24,23,22,2,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,8,6,15,15,15,15,15,15,8,8,8,15,15,15,11,11,15,10,13,27,27,19,17,17,17,17,17,17,17,17,28,28,28,23,23,23,23,12,2,2,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,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,6,8,16,15,11,12,12,12,13,15,15,10,8,10,8,10,10,12,27,27,27,28,19,17,17,17,17,17,17,17,26,28,28,28,22,22,22,10,2,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,8,6,15,15,10,23,22,10,20,22,13,14,15,8,15,15,15,13,26,27,27,27,27,28,17,17,4,4,17,17,17,17,27,28,28,17,17,20,13,2,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,8,6,15,15,15,10,15,15,10,22,23,31,11,15,9,11,13,26,27,27,27,27,27,27,13,4,4,17,17,17,17,17,20,28,30,17,28,30,27,2,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,8,6,15,15,10,12,13,21,21,22,24,29,9,10,9,13,26,27,27,27,27,27,26,13,13,4,17,17,17,17,17,17,19,30,30,17,28,30,28,2,2,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,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,6,15,16,15,10,23,21,12,12,12,10,8,10,13,13,27,27,27,27,26,13,13,13,4,4,17,17,17,17,17,17,17,28,28,17,28,30,30,10,2,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,8,15,16,15,11,11,12,22,12,12,12,14,13,13,26,27,27,27,26,13,13,10,4,4,4,4,17,17,17,17,17,17,27,27,17,27,28,30,27,2,2,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,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,8,15,16,15,6,12,12,24,23,22,12,13,26,27,27,27,13,13,11,11,4,4,4,4,4,4,17,17,17,17,17,26,20,17,20,28,30,30,10,2,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,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,8,15,15,12,21,22,12,13,10,21,26,26,27,27,27,26,13,21,15,22,4,4,4,4,4,4,17,17,17,17,17,27,17,17,17,27,28,30,27,2,2,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,0,0,0,0,0,0,0,0,0,0,0,2,2,8,10,15,13,21,10,12,10,15,13,26,26,27,27,27,13,13,15,23,21,4,4,4,4,4,4,4,4,17,17,17,17,17,17,17,4,27,28,30,28,10,2,2,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,0,0,0,0,0,0,0,0,0,2,2,8,15,8,15,10,13,15,13,15,13,26,27,27,27,27,26,20,8,15,12,11,4,4,4,4,4,4,4,4,4,17,17,4,17,17,17,18,13,28,30,30,27,10,2,2,2,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,0,0,0,0,0,0,0,2,10,10,2,8,15,15,15,15,10,13,26,26,26,26,26,13,13,13,15,15,15,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,10,13,27,28,28,28,28,28,13,2,2,2,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,0,0,0,0,0,2,2,2,2,2,15,16,16,15,13,26,26,26,26,13,13,13,15,15,15,10,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,2,2,13,13,27,28,28,28,28,28,28,13,2,2,2,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,0,0,0,0,0,0,0,2,2,8,15,13,13,26,13,13,13,13,16,15,16,10,4,4,17,17,17,17,17,4,4,4,4,4,4,2,2,2,2,2,2,2,2,13,26,27,28,28,28,28,28,28,28,13,2,2,2,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,0,0,0,0,0,0,2,2,13,26,13,26,13,13,13,8,10,4,4,4,17,17,17,17,17,17,17,17,17,4,4,4,4,2,0,0,0,0,0,0,2,10,13,13,26,27,27,28,28,28,28,28,28,13,2,2,2,2,2,2,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,13,26,26,26,26,13,10,3,4,4,4,17,17,17,17,17,17,17,17,17,17,17,4,4,4,2,2,0,0,0,0,0,0,2,2,10,10,13,13,13,26,27,27,27,28,28,28,28,27,27,27,26,2,2,2,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,10,13,26,26,26,26,13,18,4,4,4,4,17,17,17,17,17,17,17,17,17,17,17,4,4,4,2,2,0,0,0,0,0,0,0,0,2,2,2,2,10,10,13,13,13,26,26,27,27,13,26,26,13,13,27,26,2,2,2,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,13,26,26,27,27,26,13,18,4,4,4,4,4,17,17,17,17,17,17,17,17,17,17,4,4,4,4,2,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,2,2,10,10,13,13,13,13,13,13,13,26,28,27,28,26,2,2,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,13,26,27,27,27,27,27,19,17,4,4,4,4,4,17,17,17,17,17,17,17,17,17,4,4,17,4,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,2,10,13,13,27,27,27,27,28,27,26,27,27,2,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,13,13,27,27,27,27,26,17,17,4,4,4,4,4,17,17,17,17,17,17,17,17,4,4,4,4,4,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,10,13,26,27,27,27,20,27,10,13,2,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,10,13,13,26,27,26,26,20,17,17,17,4,17,17,17,4,17,17,17,17,17,17,4,4,4,4,4,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,10,13,28,13,26,10,27,2,2,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,13,13,27,13,19,20,4,4,17,4,17,17,17,17,17,4,17,17,17,4,4,4,4,17,4,4,2,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,2,2,2,13,27,10,2,2,2,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,10,19,13,13,19,13,10,4,17,17,17,17,17,17,17,17,17,4,4,4,4,4,4,17,17,4,2,2,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,0,0,2,2,10,2,2,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,18,13,10,2,2,3,17,17,4,4,17,17,17,17,17,17,17,17,4,4,17,17,17,17,4,3,2,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,0,0,0,0,2,2,2,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,10,2,3,17,17,4,4,4,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,4,2,2,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,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,0,0,2,2,2,4,17,4,2,4,4,17,17,4,4,17,17,17,17,17,17,17,17,17,17,17,17,4,2,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,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,0,0,0,2,3,3,2,2,2,4,4,17,17,4,4,17,17,17,17,17,17,17,17,17,17,17,17,17,4,2,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,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,0,0,0,2,2,2,2,2,2,19,17,17,4,4,17,17,17,4,17,17,17,17,17,17,17,17,17,17,3,2,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,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,0,0,0,0,0,0,2,2,19,18,19,4,4,17,17,4,4,17,17,17,17,17,17,17,17,17,17,4,3,2,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,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,0,0,0,0,0,0,2,4,20,13,13,13,4,17,4,4,4,17,17,4,17,17,17,17,17,17,17,4,3,2,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,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,0,0,0,0,0,0,2,13,13,13,13,13,18,4,4,4,17,17,4,4,17,4,17,17,17,17,17,4,2,2,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,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,0,0,0,0,0,2,2,13,13,13,13,18,19,26,20,4,17,17,2,19,17,26,20,17,17,17,17,4,2,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,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,0,0,0,0,0,2,2,10,13,13,13,19,20,13,13,13,19,18,3,2,18,18,27,17,13,13,19,13,4,2,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,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,0,0,0,0,0,2,10,13,13,13,20,20,13,13,13,13,17,10,2,2,17,20,27,17,27,13,13,13,4,2,2,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,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,0,2,2,2,2,13,13,13,13,13,13,13,13,13,18,3,2,2,4,18,13,13,17,28,13,13,13,3,4,2,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,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,2,2,10,13,27,13,13,13,13,13,13,13,13,20,3,2,2,2,17,20,13,19,13,28,19,28,20,2,4,2,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,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,2,2,13,13,26,26,13,13,13,26,26,13,13,13,18,2,2,2,2,4,13,13,19,27,28,17,28,20,2,2,2,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,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,2,2,13,26,26,26,13,13,26,26,26,26,13,13,10,2,2,0,2,4,2,13,13,18,27,28,19,28,20,2,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,2,2,13,13,13,13,13,13,13,13,13,26,26,13,10,2,2,0,0,2,2,2,13,13,20,27,28,13,27,20,2,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,2,2,13,13,13,26,13,13,13,13,13,13,13,13,10,2,2,0,0,0,0,0,2,13,13,13,27,28,13,27,10,2,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,2,10,13,13,13,26,26,13,13,13,13,13,10,2,2,2,0,0,0,0,2,2,2,13,13,26,27,27,28,26,10,2,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,2,10,13,13,13,26,13,13,13,13,10,2,2,2,0,0,0,2,2,2,2,10,10,13,13,27,27,28,27,26,2,2,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,2,2,13,13,13,13,13,13,13,13,2,2,2,0,0,0,2,2,2,10,26,27,27,13,13,26,27,27,27,27,13,2,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,2,10,13,13,13,13,13,13,13,2,2,0,0,0,0,2,2,10,26,27,27,27,26,13,13,26,27,27,27,13,10,2,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,2,2,13,13,13,13,13,13,13,2,2,0,0,0,0,2,2,13,26,27,27,27,27,26,13,13,26,26,26,13,13,2,2,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,2,2,2,2,2,10,13,13,13,13,13,13,2,2,0,0,0,0,2,2,13,13,26,26,26,26,26,13,13,13,13,13,13,13,2,2,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,2,2,10,13,10,2,13,13,13,13,13,13,2,2,0,0,0,0,2,2,10,13,13,26,13,13,13,13,13,13,13,13,13,13,10,2,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,2,10,27,28,28,26,13,13,13,13,13,2,2,0,0,0,0,2,2,10,13,13,13,13,13,13,13,13,13,13,13,13,10,2,2,2,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,2,10,26,27,28,27,13,13,13,13,2,2,2,2,2,2,2,2,10,13,13,13,13,13,13,13,13,13,13,10,2,2,2,2,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,2,10,26,26,27,27,26,13,13,2,2,0,2,10,28,28,10,13,13,13,13,13,13,13,13,13,13,10,2,2,2,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,2,13,13,13,26,13,13,13,10,2,0,0,2,26,28,28,27,13,13,13,13,13,13,13,13,10,2,2,2,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,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, 0,2,13,13,13,13,13,13,13,2,2,0,2,2,13,27,28,13,13,13,13,13,13,13,10,2,2,2,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,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,0,0, 2,2,13,26,26,13,13,10,2,2,0,0,2,10,13,27,28,26,26,13,13,13,13,2,2,2,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,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,0,0,0,0, 2,10,27,26,13,13,13,2,2,0,0,2,2,10,26,27,27,26,13,13,13,10,2,2,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,0,0,0,0,0,0,0,0,0,0,0,0,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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,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,0,0,0,0,0,0,0,0,2,2,8,15,16,15,15,8,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,2,2,2,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,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,8,15,16,16,15,15,15,8,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,12,12,22,22,2,2,2,2,2,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,8,15,16,11,11,15,15,16,15,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,12,22,23,24,24,24,24,24,22,22,2,2,2,2,2,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,0,0,0,0,0,0,0,0,0,0,0,2,8,15,16,15,15,15,15,15,15,8,2,2,0,0,0,0,0,0,0,0,0,0,2,2,2,2,2,12,22,22,23,23,23,23,24,24,24,24,24,22,23,22,2,2,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,0,0,0,0,0,0,0,0,0,0,2,8,15,15,15,15,15,15,15,15,15,8,2,2,0,0,0,0,0,0,0,0,2,2,10,8,2,12,22,22,23,23,23,23,24,24,24,24,24,24,24,24,24,12,2,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,0,0,0,0,0,0,0,0,0,0,2,8,15,15,15,15,15,15,15,15,15,15,8,2,0,0,0,0,0,0,0,0,2,6,15,10,10,22,22,22,22,23,24,24,24,24,24,24,24,24,24,24,24,24,2,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,0,0,0,0,0,0,0,0,0,0,2,8,15,16,15,15,11,11,11,15,15,15,8,2,2,0,0,0,0,0,0,2,2,9,15,10,12,22,22,22,22,22,22,23,24,24,24,24,24,24,24,24,24,24,2,2,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,0,0,0,0,0,0,0,0,0,2,8,15,16,16,15,15,15,15,15,15,15,26,8,2,2,0,0,0,0,0,2,8,15,15,12,22,22,23,24,23,22,22,22,22,23,23,24,24,24,24,24,24,24,12,2,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,0,0,0,0,0,0,0,0,0,2,8,15,15,15,10,15,15,15,15,15,8,21,21,8,2,2,0,0,0,0,2,10,10,15,12,22,22,24,24,24,13,27,27,21,22,22,22,22,23,22,23,24,24,10,2,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,0,0,0,0,0,0,0,0,0,2,8,9,16,15,11,15,15,15,15,15,23,13,25,25,8,2,2,0,0,2,2,8,10,11,22,22,22,24,24,24,13,27,27,27,24,28,28,28,28,28,22,22,12,2,2,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,0,0,0,0,0,0,0,0,2,2,9,9,15,15,15,15,15,15,15,13,24,21,18,5,8,8,2,0,0,2,8,15,10,11,22,22,22,24,24,24,13,26,26,27,28,28,28,28,28,28,28,21,2,2,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,0,0,0,0,0,0,0,0,0,2,8,15,15,31,31,9,15,10,11,15,14,24,18,5,5,7,8,2,2,0,2,8,16,15,15,22,22,23,24,24,24,13,27,13,26,27,28,28,28,28,27,27,12,2,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,0,0,0,0,0,0,0,0,0,2,2,15,15,14,31,14,15,15,15,11,15,15,23,18,7,7,5,7,8,2,2,2,8,15,15,13,22,22,23,24,24,24,27,27,28,27,2,30,28,28,27,27,27,2,2,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,0,0,0,0,0,0,0,0,0,2,8,15,15,9,9,15,15,15,11,15,15,21,20,7,8,10,15,8,8,8,2,2,6,8,15,12,22,22,24,24,24,23,27,28,30,30,30,30,28,30,30,10,26,2,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,0,0,0,0,0,0,0,0,0,0,2,15,15,15,16,15,8,15,15,11,15,10,24,17,7,10,15,15,15,15,6,8,8,9,9,11,22,22,23,24,24,24,13,27,28,28,28,28,28,28,30,30,28,24,2,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,0,0,0,0,0,0,0,0,0,2,2,15,15,15,15,15,15,11,11,21,24,24,18,7,15,15,15,15,15,15,15,6,6,9,15,12,22,23,24,24,24,24,13,13,27,28,28,28,28,27,28,28,28,24,2,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,0,0,0,0,0,0,0,0,0,2,8,15,15,15,15,15,15,15,15,9,20,18,7,8,15,15,16,9,9,9,15,15,8,9,21,22,22,23,24,24,24,24,13,13,26,27,28,28,28,28,27,27,28,13,2,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,0,0,0,0,0,0,0,0,0,2,8,8,15,15,15,15,15,15,11,15,24,25,5,7,15,16,9,31,28,29,14,15,8,13,22,22,23,23,24,24,24,24,24,13,13,27,28,28,28,27,30,28,27,20,2,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,0,0,0,0,0,0,0,0,0,2,2,8,15,15,15,8,8,15,15,15,21,24,5,7,15,16,15,28,30,29,29,15,15,8,22,22,23,23,24,24,24,24,24,21,13,26,27,28,11,11,11,11,23,22,2,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,0,0,0,0,0,0,0,0,0,0,2,2,8,15,15,10,8,15,15,15,15,12,19,7,10,16,16,9,28,30,28,9,16,9,21,22,22,23,22,22,22,23,24,28,27,13,26,28,28,26,26,27,24,12,2,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,0,0,0,0,0,0,0,0,0,0,0,2,2,15,15,16,15,15,15,15,15,24,23,5,7,11,16,16,9,29,28,9,16,15,22,22,18,17,17,17,17,17,20,30,28,28,27,13,26,27,27,24,24,10,2,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,0,0,0,0,0,0,0,0,0,0,2,2,2,8,15,16,16,15,15,15,15,21,21,23,18,20,15,15,15,16,9,14,16,15,10,4,17,17,17,17,17,17,17,28,28,28,27,21,24,23,24,24,23,2,2,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,0,0,0,0,0,0,0,0,0,2,2,8,8,8,8,8,15,16,15,15,15,11,15,10,21,23,21,15,15,15,15,15,15,26,13,17,17,17,17,17,17,17,17,17,28,28,27,23,23,24,24,23,22,2,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,0,0,0,0,0,0,0,0,0,0,2,8,8,8,15,15,15,15,15,8,15,15,15,15,15,15,15,15,15,15,15,15,15,13,27,27,19,17,17,17,17,17,17,17,17,28,28,28,23,23,23,23,12,2,2,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,0,0,0,0,0,0,0,0,0,2,2,8,6,8,15,15,15,15,16,16,15,15,15,15,8,8,10,15,15,15,15,15,12,27,27,27,28,19,17,17,17,17,17,17,17,26,28,28,28,22,22,22,10,2,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,0,0,0,0,0,0,0,0,0,0,2,8,6,8,16,16,15,11,12,24,23,22,23,16,8,8,15,15,15,15,15,15,13,26,27,27,27,27,28,17,17,4,4,17,17,17,17,27,28,28,17,17,20,13,2,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,0,0,0,0,0,0,0,0,0,0,2,8,8,15,16,15,10,23,12,11,11,13,22,24,31,9,11,14,14,15,15,13,26,27,27,27,27,27,27,13,4,4,17,17,17,17,17,20,28,30,17,28,30,27,2,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,0,0,0,0,0,0,0,0,0,0,2,8,8,15,15,15,15,11,15,15,15,13,22,22,29,31,15,11,31,14,13,26,27,27,27,27,27,26,13,13,4,17,17,17,17,17,17,19,30,30,17,28,30,28,2,2,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,0,0,0,0,0,0,0,0,0,2,2,8,8,15,15,20,21,23,21,21,21,23,12,21,9,9,10,8,13,13,27,27,27,27,26,13,13,13,4,4,17,17,17,17,17,17,17,28,28,17,28,30,30,10,2,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,0,0,0,0,0,0,0,0,0,0,2,8,8,15,16,15,13,21,24,23,22,22,24,21,21,9,10,12,13,26,27,27,27,26,13,13,10,4,4,4,4,17,17,17,17,17,17,27,27,17,27,28,30,27,2,2,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,0,0,0,0,0,0,0,0,0,2,8,8,15,16,16,15,11,10,23,24,21,24,24,22,24,13,13,26,27,27,27,13,13,12,10,4,4,4,4,4,4,17,17,17,17,17,26,20,17,20,28,30,30,10,2,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,0,0,0,0,0,0,0,0,0,2,2,2,15,15,16,15,11,12,23,21,23,13,23,23,13,26,26,27,27,27,26,21,12,12,7,4,4,4,4,4,4,17,17,17,17,17,27,17,17,17,27,28,30,27,2,2,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,0,0,0,0,0,0,0,0,2,2,2,8,15,15,16,23,21,24,26,15,15,23,13,26,26,27,27,27,13,13,10,12,12,4,4,4,4,4,4,4,4,17,17,17,17,17,17,17,4,27,28,30,28,10,2,2,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,0,0,0,0,0,0,2,2,8,8,15,15,15,21,21,16,23,15,15,13,13,26,27,27,27,27,26,12,20,12,13,10,4,4,4,4,4,4,4,4,4,17,17,4,17,17,17,18,13,28,30,30,27,10,2,2,2,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,0,0,0,2,2,8,10,15,15,15,15,8,26,15,23,11,15,20,26,26,26,26,26,13,13,10,6,10,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,10,13,27,28,28,28,28,28,13,2,2,2,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,0,2,8,15,10,2,2,15,16,16,16,16,20,15,13,26,26,26,26,13,13,13,10,15,8,20,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,2,2,13,13,27,28,28,28,28,28,28,13,2,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,2,8,8,2,2,2,2,15,16,16,15,15,13,13,26,13,13,13,13,10,15,14,4,4,4,17,17,17,17,17,4,4,4,4,4,4,2,2,2,2,2,2,2,2,13,26,27,28,28,28,28,28,28,28,13,2,2,2,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,2,2,2,2,0,0,2,2,8,8,8,13,26,13,26,13,13,13,2,4,4,4,4,17,17,17,17,17,17,17,17,17,4,4,4,4,2,0,0,0,0,0,0,2,10,13,13,26,27,27,28,28,28,28,28,28,13,2,2,2,2,2,2,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,13,26,26,26,26,13,10,3,4,4,4,17,17,17,17,17,17,17,17,17,17,17,4,4,4,2,2,0,0,0,0,0,0,2,2,10,10,13,13,13,26,27,27,27,28,28,28,28,27,27,27,26,2,2,2,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,10,13,26,26,26,26,13,18,4,4,4,4,17,17,17,17,17,17,17,17,17,17,17,4,4,4,2,2,0,0,0,0,0,0,0,0,2,2,2,2,10,10,13,13,13,26,26,27,27,13,26,26,13,13,27,26,2,2,2,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,13,26,26,27,27,26,13,18,4,4,4,4,4,17,17,17,17,17,17,17,17,17,17,4,4,4,4,2,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,2,2,10,10,13,13,13,13,13,13,13,26,28,27,28,26,2,2,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,13,26,27,27,27,27,27,19,17,4,4,4,4,4,17,17,17,17,17,17,17,17,17,4,4,17,4,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,2,10,13,13,27,27,27,27,28,27,26,27,27,2,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,13,13,27,27,27,27,26,17,17,4,4,4,4,4,17,17,17,17,17,17,17,17,4,4,4,4,4,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,10,13,26,27,27,27,20,27,10,13,2,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,10,13,13,26,27,26,26,20,17,17,17,4,17,17,17,4,17,17,17,17,17,17,4,4,4,4,4,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,10,13,28,13,26,10,27,2,2,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,13,13,27,13,19,20,4,4,17,4,17,17,17,17,17,4,17,17,17,4,4,4,4,17,4,4,2,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,2,2,2,13,27,10,2,2,2,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,10,19,13,13,19,13,10,4,17,17,17,17,17,17,17,17,17,4,4,4,4,4,4,17,17,4,2,2,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,0,0,2,2,10,2,2,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,18,13,10,2,2,3,17,17,4,4,17,17,17,17,17,17,17,17,4,4,17,17,17,17,4,3,2,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,0,0,0,0,2,2,2,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,10,2,3,17,17,4,4,4,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,4,2,2,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,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,0,0,2,2,2,4,17,4,2,4,4,17,17,4,4,17,17,17,17,17,17,17,17,17,17,17,17,4,2,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,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,0,0,0,2,3,3,2,2,2,4,4,17,17,4,4,17,17,17,17,17,17,17,17,17,17,17,17,17,4,2,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,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,0,0,0,2,2,2,2,2,2,19,17,17,4,4,17,17,17,4,17,17,17,17,17,17,17,17,17,17,3,2,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,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,0,0,0,0,0,0,2,2,19,18,19,4,4,17,17,4,4,17,17,17,17,17,17,17,17,17,17,4,3,2,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,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,0,0,0,0,0,0,2,4,20,13,13,13,4,17,4,4,4,17,17,4,17,17,17,17,17,17,17,4,3,2,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,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,0,0,0,0,0,0,2,13,13,13,13,13,18,4,4,4,17,17,4,4,17,4,17,17,17,17,17,4,2,2,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,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,0,0,0,0,0,2,2,13,13,13,13,18,19,26,20,4,17,17,2,19,17,26,20,17,17,17,17,4,2,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,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,0,0,0,0,0,2,2,10,13,13,13,19,20,13,13,13,19,18,3,2,18,18,27,17,13,13,19,13,4,2,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,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,0,0,0,0,0,2,10,13,13,13,20,20,13,13,13,13,17,10,2,2,17,20,27,17,27,13,13,13,4,2,2,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,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,0,2,2,2,2,13,13,13,13,13,13,13,13,13,18,3,2,2,4,18,13,13,17,28,13,13,13,3,4,2,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,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,2,2,10,13,27,13,13,13,13,13,13,13,13,20,3,2,2,2,17,20,13,19,13,28,19,28,20,2,4,2,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,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,2,2,13,13,26,26,13,13,13,26,26,13,13,13,18,2,2,2,2,4,13,13,19,27,28,17,28,20,2,2,2,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,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,2,2,13,26,26,26,13,13,26,26,26,26,13,13,10,2,2,0,2,4,2,13,13,18,27,28,19,28,20,2,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,2,2,13,13,13,13,13,13,13,13,13,26,26,13,10,2,2,0,0,2,2,2,13,13,20,27,28,13,27,20,2,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,2,2,13,13,13,26,13,13,13,13,13,13,13,13,10,2,2,0,0,0,0,0,2,13,13,13,27,28,13,27,10,2,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,2,10,13,13,13,26,26,13,13,13,13,13,10,2,2,2,0,0,0,0,2,2,2,13,13,26,27,27,28,26,10,2,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,2,10,13,13,13,26,13,13,13,13,10,2,2,2,0,0,0,2,2,2,2,10,10,13,13,27,27,28,27,26,2,2,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,2,2,13,13,13,13,13,13,13,13,2,2,2,0,0,0,2,2,2,10,26,27,27,13,13,26,27,27,27,27,13,2,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,2,10,13,13,13,13,13,13,13,2,2,0,0,0,0,2,2,10,26,27,27,27,26,13,13,26,27,27,27,13,10,2,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,2,2,13,13,13,13,13,13,13,2,2,0,0,0,0,2,2,13,26,27,27,27,27,26,13,13,26,26,26,13,13,2,2,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,2,2,2,2,2,10,13,13,13,13,13,13,2,2,0,0,0,0,2,2,13,13,26,26,26,26,26,13,13,13,13,13,13,13,2,2,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,2,2,10,13,10,2,13,13,13,13,13,13,2,2,0,0,0,0,2,2,10,13,13,26,13,13,13,13,13,13,13,13,13,13,10,2,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,2,10,27,28,28,26,13,13,13,13,13,2,2,0,0,0,0,2,2,10,13,13,13,13,13,13,13,13,13,13,13,13,10,2,2,2,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,2,10,26,27,28,27,13,13,13,13,2,2,2,2,2,2,2,2,10,13,13,13,13,13,13,13,13,13,13,10,2,2,2,2,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,2,10,26,26,27,27,26,13,13,2,2,0,2,10,28,28,10,13,13,13,13,13,13,13,13,13,13,10,2,2,2,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,2,13,13,13,26,13,13,13,10,2,0,0,2,26,28,28,27,13,13,13,13,13,13,13,13,10,2,2,2,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,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, 0,2,13,13,13,13,13,13,13,2,2,0,2,2,13,27,28,13,13,13,13,13,13,13,10,2,2,2,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,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,0,0, 2,2,13,26,26,13,13,10,2,2,0,0,2,10,13,27,28,26,26,13,13,13,13,2,2,2,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,0,0,0,0,0,0,0,0,0,0,0,0,0,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, 2,2,2,2,1,2, 0,2,1,1,2,2, 2,2,2,2,1,2, 2,1,2,2,1,2, 2,2,1,1,2,2, 0,2,2,2,2,0}, {0,0,2,2,2,0, 0,2,2,1,2,0, 2,2,1,1,2,0, 2,1,2,1,2,0, 2,1,2,1,2,2, 2,1,1,1,1,2, 2,2,2,1,2,2, 0,0,2,1,2,0, 0,0,2,2,2,0}, {2,2,2,2,2,2, 2,1,1,1,1,2, 2,1,2,2,2,2, 2,1,2,2,2,0, 2,2,1,1,2,2, 0,2,2,2,1,2, 2,2,2,2,1,2, 2,1,1,1,2,2, 2,2,2,2,2,0}, {0,2,2,2,2,0, 2,2,1,1,2,2, 2,1,2,2,1,2, 2,1,2,2,2,2, 2,1,1,1,2,2, 2,1,2,2,1,2, 2,1,2,2,1,2, 2,2,1,1,2,2, 0,2,2,2,2,0}, {2,2,2,2,2,2, 2,1,1,1,1,2, 2,2,2,2,1,2, 0,0,2,2,1,2, 0,0,2,1,2,2, 0,2,2,1,2,0, 0,2,1,2,2,0, 0,2,1,2,0,0, 0,2,2,2,0,0}, {0,2,2,2,2,0, 2,2,1,1,2,2, 2,1,2,2,1,2, 2,1,2,2,1,2, 2,2,1,1,2,2, 2,1,2,2,1,2, 2,1,2,2,1,2, 2,2,1,1,2,2, 0,2,2,2,2,0}, {0,2,2,2,2,0, 2,2,1,1,2,2, 2,1,2,2,1,2, 2,1,2,2,1,2, 2,2,1,1,1,2, 2,2,2,2,1,2, 2,1,2,2,1,2, 2,2,1,1,2,2, 0,2,2,2,2,0}, }; static int colormap[112][3] = { {255,255,255},{230,230,230},{222,222,222},{205,205,205},{180,180,180},{164,164,164},{156,156,156},{131,131,131}, {115,115,115},{98,98,98},{82,82,82},{65,65,65},{49,49,49},{32,32,32},{24,24,24},{0,0,0}, {255,0,0},{255,246,16},{82,255,24},{0,255,255},{0,41,255},{238,32,255},{205,172,139},{148,115,98}, {98,82,65},{65,49,41},{41,24,24},{205,148,90},{164,106,57},{131,82,41},{106,57,24},{74,41,16}, {255,139,98},{255,164,106},{255,197,123},{255,246,139},{205,222,139},{164,205,139},{123,189,139},{106,197,189}, {82,197,238},{98,148,197},{115,139,180},{115,106,164},{148,115,172},{180,123,172},{246,139,172},{255,139,139}, {246,82,57},{255,123,65},{255,164,74},{255,246,82},{172,205,90},{115,180,90},{49,164,98},{0,172,164}, {0,180,238},{16,123,180},{49,90,156},{65,57,131},{115,65,139},{156,74,139},{238,82,139},{246,82,98}, {230,0,41},{246,74,24},{255,131,8},{255,246,16},{131,189,32},{49,164,49},{24,139,82},{0,148,139}, {0,172,230},{0,90,164},{0,49,131},{0,16,98},{65,16,98},{123,16,106},{230,8,106},{230,0,74}, {139,0,24},{148,41,8},{156,82,8},{172,148,8},{82,115,16},{24,98,24},{16,90,49},{0,90,82}, {0,98,139},{0,57,98},{0,32,65},{0,8,57},{41,8,57},{74,8,57},{139,8,65},{139,0,41}, {98,0,16},{98,32,8},{106,49,0},{115,98,8},{49,74,8},{16,65,16},{8,57,32},{0,57,57}, {0,65,90},{0,32,65},{0,16,49},{0,0,41},{24,0,41},{49,0,41},{90,0,41},{98,0,16} }; static int a_count; int curr_frame; typedef int code_int; typedef long int count_int; static long pixel_index; #define BITS 12 #define HSIZE 5003 typedef char char_type; static int n_bits; static int maxbits = BITS; static code_int maxcode; static code_int maxmaxcode = (code_int)1 << BITS; # define MAXCODE(n_bits) (((code_int) 1 << (n_bits)) - 1) static count_int htab [HSIZE]; static unsigned short codetab [HSIZE]; #define HashTabOf(i) htab[i] #define CodeTabOf(i) codetab[i] static code_int hsize = HSIZE; #define tab_prefixof(i) CodeTabOf(i) #define tab_suffixof(i) ((char_type*)(htab))[i] #define de_stack ((char_type*)&tab_suffixof((code_int)1< 0 ) { fputc( a_count, stdout ); fwrite( accum, 1, a_count, stdout ); a_count = 0; } } static void char_init() { a_count = 0; } static void char_out( c ) int c; { accum[ a_count++ ] = c; if( a_count >= 254 ) flush_char(); } void output( code ) code_int code; { cur_accum &= masks[ cur_bits ]; if( cur_bits > 0 ) cur_accum |= ((long)code << cur_bits); else cur_accum = code; cur_bits += n_bits; while( cur_bits >= 8 ) { char_out( (unsigned int)(cur_accum & 0xff) ); cur_accum >>= 8; cur_bits -= 8; } if ( free_ent > maxcode || clear_flg ) { if( clear_flg ) { maxcode = MAXCODE (n_bits = g_init_bits); clear_flg = 0; } else { ++n_bits; if ( n_bits == maxbits ) maxcode = maxmaxcode; else maxcode = MAXCODE(n_bits); } } if( code == EOFCode ) { while( cur_bits > 0 ) { char_out( (unsigned int)(cur_accum & 0xff) ); cur_accum >>= 8; cur_bits -= 8; } flush_char(); fflush( stdout ); } } static void cl_hash(hsize) /* reset code table */ register count_int hsize; { register count_int *htab_p = htab+hsize; register long i; register long m1 = -1; i = hsize - 16; do { /* might use Sys V memset(3) here */ *(htab_p-16) = m1; *(htab_p-15) = m1; *(htab_p-12) = m1; *(htab_p-13) = m1; *(htab_p-12) = m1; *(htab_p-11) = m1; *(htab_p-10) = m1; *(htab_p-9) = m1; *(htab_p-8) = m1; *(htab_p-7) = m1; *(htab_p-6) = m1; *(htab_p-5) = m1; *(htab_p-4) = m1; *(htab_p-3) = m1; *(htab_p-2) = m1; *(htab_p-1) = m1; htab_p -= 16; } while ((i -= 16) >= 0); for ( i += 16; i > 0; --i ) *--htab_p = m1; } static void cl_block () /* table clear for block compress */ { cl_hash ( (count_int) hsize ); free_ent = ClearCode + 2; clear_flg = 1; output( (code_int)ClearCode ); } static void compress( init_bits, frame_num ) int init_bits; int frame_num; { register long fcode; register code_int i /* = 0 */; register int c; register code_int ent; register code_int disp; register code_int hsize_reg; register int hshift; long int q; long int m; m = -1; for(q = 0; q < HSIZE; q++) { htab[q] = m; codetab[q] = 0; } curr_frame = frame_num; in_count = 1; out_count = 0; cur_bits = 0; cur_accum = 0; sprintf(accum,""); pixel_index = -1; g_init_bits = init_bits; offset = 0; out_count = 0; clear_flg = 0; in_count = 1; maxcode = MAXCODE(n_bits = g_init_bits); ClearCode = (1 << (init_bits - 1)); EOFCode = ClearCode + 1; free_ent = ClearCode + 2; char_init(); cl_block(); ent = GIFNextPixel(frame_num); hshift = 0; for ( fcode = (long) hsize; fcode < 65536L; fcode *= 2L ) ++hshift; hshift = 8 - hshift; /* set hash code range bound */ hsize_reg = hsize; cl_hash( (count_int)hsize_reg); /* clear hash table */ output( (code_int)ClearCode ); while ( (c = GIFNextPixel(frame_num)) != EOF ) { ++in_count; fcode = (long) (((long) c << maxbits) + ent); i = (((code_int)c << hshift) ^ ent); /* xor hashing */ if ( HashTabOf (i) == fcode ) { ent = CodeTabOf (i); continue; } else if ( (long)HashTabOf (i) < 0 ) /* empty slot */ goto nomatch; disp = hsize_reg - i; /* secondary hash (after G. Knott) */ if ( i == 0 ) disp = 1; probe: if ( (i -= disp) < 0 ) i += hsize_reg; if ( HashTabOf (i) == fcode ) { ent = CodeTabOf (i); continue; } if ( (long)HashTabOf (i) > 0 ) goto probe; nomatch: output ( (code_int) ent ); ++out_count; ent = c; if ( free_ent < maxmaxcode ) { CodeTabOf (i) = free_ent++; /* code -> hashtable */ HashTabOf (i) = fcode; } else cl_block(); } /* * Put out the final code. */ output( (code_int)ent ); ++out_count; output( (code_int)EOFCode ); } main(argc,argv) int argc; char *argv[]; { static char s[256] = ""; static char count[10] = "0"; static char option[80] = "none"; static char url[512] = ""; static char dchar[1] = ""; char *token; FILE *fp; FILE *catout; long i; long x; int y; int z; int q; int mon; int row; int col; int countpos = 0; int border = 1; struct tm when; time_t now; time(&now); if(getenv("PATH_INFO") != NULL) { strcpy(s,getenv("PATH_INFO")+1); } else { strcpy(s,argv[1]); } if(strpbrk(s,"=") != NULL) { token = strtok(s,"="); strcpy(count,token); token = strtok(NULL,"="); clist[1] = atoi(token); token = strtok(NULL,"="); countpos = atoi(token); token = strtok(NULL,"="); border = atoi(token); } /* Build palette */ for(q=0; q < 2; q++) { i = clist[q]; x = q*3; colors[x] = colormap[i][RED]; colors[x+1] = colormap[i][GREEN]; colors[x+2] = colormap[i][BLUE]; } /* Place digits */ if(countpos > 1) { countpos = now%2; } if(countpos == 0) { /* vertical */ for(q=0; q < 2; q++) { i = strlen(count); x = 4; y = 36 - (i*10)/2; for(i = 0; i < strlen(count); i++) { sprintf(dchar,"%c",count[i]); z = atoi(dchar); for(row = 0; row < 9; row++) { for(col = 0; col < 6; col++) { if(digits[z][col + row*6] != 0) { if(digits[z][col + row*6] != 2 || border == 1) { frames[q][col+x + (row+y)*WIDTH] = digits[z][col + row*6]; } } } } y += 10; } } } if(countpos == 1) { /* horizontal */ for(q=0; q < 2; q++) { i = strlen(count); x = 40 - (i*7)/2; y = 50; for(i = 0; i < strlen(count); i++) { sprintf(dchar,"%c",count[i]); z = atoi(dchar); for(row = 0; row < 9; row++) { for(col = 0; col < 6; col++) { if(digits[z][col + row*6] != 0) { if(digits[z][col + row*6] != 2 || border == 1) { frames[q][col+x + (row+y)*WIDTH] = digits[z][col + row*6]; } } } } x += 7; } } } if(getenv("PATH_INFO") != NULL) printf("Content-type: image/gif\n\n"); putc(0x47,stdout); /* G */ putc(0x49,stdout); /* I */ putc(0x46,stdout); /* F */ putc(0x38,stdout); /* 8 */ putc(0x39,stdout); /* 9 */ putc(0x61,stdout); /* a */ putc(WIDTH,stdout); putc(0,stdout); /* width */ putc(HEIGHT,stdout); putc(0,stdout); /* height */ putc(0xCC,stdout); /* global block */ putc(0x00,stdout); /* background color */ putc(0x00,stdout); /* pixel aspect */ for(i = 0;i < 96;i++) { putc(colors[i],stdout); } /* color table */ putc(0x21,stdout); /* extension block */ putc(0xF9,stdout); /* graphic control extension */ putc(0x04,stdout); /* block size (fixed) */ putc(0x09,stdout); /* flags */ putc(DELAY,stdout); putc(0x0,stdout); /* delay */ putc(0,stdout); /* transparent color */ putc(0x00,stdout); /* block terminator */ putc(0x21,stdout); /* extension block */ putc(0xFF,stdout); /* special purpose */ putc(0x0B,stdout); /* block size */ putc(0x4E,stdout); /* application identifier */ putc(0x45,stdout); putc(0x54,stdout); putc(0x53,stdout); putc(0x43,stdout); putc(0x41,stdout); putc(0x50,stdout); putc(0x45,stdout); putc(0x32,stdout); putc(0x2E,stdout); putc(0x30,stdout); putc(0x03,stdout); putc(0x01,stdout); putc(0x0F,stdout); putc(0x27,stdout); putc(0x00,stdout); /* terminator */ putc(0x2C,stdout); /* image seperator */ putc(0,stdout); /* x offset */ putc(0x00,stdout); putc(0,stdout); /* y offset */ putc(0x00,stdout); putc(WIDTH,stdout); /* width */ putc(0x00,stdout); putc(HEIGHT,stdout); /* height */ putc(0x00,stdout); putc(0x04,stdout); /* local table, etc */ /* output compressed frame 1 */ putc(5,stdout); compress(6,0); putc(0x00,stdout); /* terminator */ putc(0x21,stdout); /* extension block */ putc(0xF9,stdout); /* graphic control extension */ putc(0x04,stdout); /* block size (fixed) */ putc(0x09,stdout); /* flags */ putc(DELAY,stdout); putc(0x0,stdout); /* delay */ putc(0x00,stdout); /* transparent color */ putc(0x00,stdout); /* block terminator */ putc(0x2C,stdout); /* image seperator */ putc(0x00,stdout); /* x offset */ putc(0x00,stdout); putc(0x00,stdout); /* y offset */ putc(0x00,stdout); putc(WIDTH,stdout); /* width */ putc(0x00,stdout); putc(HEIGHT,stdout); /* height */ putc(0x00,stdout); putc(0x84,stdout); /* local table, etc */ for(i = 0;i < 96;i++) { putc(colors[i],stdout); } /* color table */ /* output compressed frame */ putc(5,stdout); compress(6,1); putc(0x00,stdout); /* terminator */ putc(0x3B,stdout); /* end of GIF */ exit(0); }