blob: 97aef29b5761c2aae553d020a731fa23ec3e3157 [file] [log] [blame]
/***************************************************************************
* __________ __ ___.
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
* \/ \/ \/ \/ \/
* $Id$
*
* Copyright (C) 2005 Adam Boot
*
* Color graphics from Frozen Bubble (http://www.frozen-bubble.org/)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
****************************************************************************/
#include "plugin.h"
#ifdef HAVE_LCD_BITMAP
#include "xlcd.h"
#include "pluginlib_actions.h"
#include "fixedpoint.h"
PLUGIN_HEADER
/* files */
#define SCORE_FILE PLUGIN_GAMES_DIR "/bubbles.score"
#define SAVE_FILE PLUGIN_GAMES_DIR "/bubbles.save"
/* final game return status */
#define BB_NONE 5
#define BB_WIN 4
#define BB_END 3
#define BB_USB 2
#define BB_QUIT 1
#define BB_LOSE 0
/* play board dimension */
#define BB_HEIGHT 12
#define BB_WIDTH 8
#define BB_LEVEL_HEIGHT 10
/* various amounts */
#define NUM_SCORES 10
#define NUM_LEVELS 100
#define NUM_QUEUE 2
#define NUM_BUBBLES 8
#define MIN_ANGLE -76
#define MAX_ANGLE 76
#define NUM_COMPRESS 9
#define MAX_SHOTTIME 1000
/* keyboard layouts */
#if CONFIG_KEYPAD != SANSA_E200_PAD
/* sansa uses the wheel instead of left/right */
#define BUBBLES_LEFT PLA_LEFT
#define BUBBLES_LEFT_REP PLA_LEFT_REPEAT
#define BUBBLES_RIGHT PLA_RIGHT
#define BUBBLES_RIGHT_REP PLA_RIGHT_REPEAT
#define ANGLE_STEP 4
#define ANGLE_STEP_REP 4
#else
#define BUBBLES_LEFT PLA_UP
#define BUBBLES_LEFT_REP PLA_UP_REPEAT
#define BUBBLES_RIGHT PLA_DOWN
#define BUBBLES_RIGHT_REP PLA_DOWN_REPEAT
#define ANGLE_STEP 2
#define ANGLE_STEP_REP 4
#endif
#define BUBBLES_QUIT PLA_QUIT
#define BUBBLES_START PLA_START
#define BUBBLES_SELECT PLA_FIRE
#define BUBBLES_RESUME PLA_MENU
#if CONFIG_KEYPAD != ONDIO_PAD
#define BUBBLES_LVLINC PLA_UP
#define BUBBLES_LVLINC_REP PLA_UP_REPEAT
#define BUBBLES_LVLDEC PLA_DOWN
#define BUBBLES_LVLDEC_REP PLA_DOWN_REPEAT
#else /* ondio keys */
#define BUBBLES_LVLINC PLA_RIGHT
#define BUBBLES_LVLINC_REP PLA_RIGHT_REPEAT
#define BUBBLES_LVLDEC PLA_LEFT
#define BUBBLES_LVLDEC_REP PLA_LEFT_REPEAT
#endif
/* external bitmaps */
#ifdef HAVE_LCD_COLOR
#include "bubbles_background.h"
#endif
#include "bubbles_bubble.h"
#include "bubbles_emblem.h"
#define BUBBLE_WIDTH BMPWIDTH_bubbles_bubble
#define BUBBLE_HEIGHT BMPHEIGHT_bubbles_bubble
#define EMBLEM_WIDTH BMPWIDTH_bubbles_emblem
#define EMBLEM_HEIGHT (BMPHEIGHT_bubbles_emblem/8)
/* bubbles will consume height of ROW_HEIGHT*(BB_HEIGHT-1)+BUBBLE_HEIGHT*3/2 */
/* 22x22 bubbles (iPod Video) */
#if (LCD_HEIGHT == 240) && (LCD_WIDTH == 320)
#define XOFS 72
#define ROW_HEIGHT 18
#define ROW_INDENT 11
#define MAX_FPS 40
/* 22x22 bubbles (Gigabeat) */
#elif (LCD_HEIGHT == 320) && (LCD_WIDTH == 240)
#define XOFS 64
#define ROW_HEIGHT 18
#define ROW_INDENT 11
#define MAX_FPS 30
/* 16x16 bubbles (H300, iPod Color) */
#elif (LCD_HEIGHT == 176) && (LCD_WIDTH == 220)
#define XOFS 46
#define ROW_HEIGHT 14
#define ROW_INDENT 8
#define MAX_FPS 30
/* 16x16 bubbles (Sansa E200) */
#elif (LCD_HEIGHT == 220) && (LCD_WIDTH == 176)
#define XOFS 48
#define ROW_HEIGHT 14
#define ROW_INDENT 8
#define MAX_FPS 30
/* 12x12 bubbles (iPod Nano) */
#elif (LCD_HEIGHT == 132) && (LCD_WIDTH == 176)
#define XOFS 40
#define ROW_HEIGHT 10
#define ROW_INDENT 6
#define MAX_FPS 40
/* 12x12 bubbles (H100, H10, iAudio X5, iPod 3G, iPod 4G grayscale) */
#elif (LCD_HEIGHT == 128) && ((LCD_WIDTH == 160) || (LCD_WIDTH == 128))
#define XOFS 33
#define ROW_HEIGHT 10
#define ROW_INDENT 6
#define MAX_FPS 30
/* 10x10 bubbles (iPod Mini) */
#elif (LCD_HEIGHT == 110) && (LCD_WIDTH == 138)
#define XOFS 33
#define ROW_HEIGHT 8
#define ROW_INDENT 5
#define MAX_FPS 30
/* 9x9 bubbles (iAudio M3) */
#elif (LCD_HEIGHT == 96) && (LCD_WIDTH == 128)
#define XOFS 45
#define ROW_HEIGHT 7
#define ROW_INDENT 4
#define MAX_FPS 30
/* 8x8 bubbles (Sansa C200) */
#elif (LCD_HEIGHT == 80) && (LCD_WIDTH == 132)
#define XOFS 45
#define ROW_HEIGHT 6
#define ROW_INDENT 4
#define MAX_FPS 30
/* 8x7 bubbles (Archos recorder, Ondio) */
#elif (LCD_HEIGHT == 64) && (LCD_WIDTH == 112)
#define XOFS 33
#define ROW_HEIGHT 5
#define ROW_INDENT 4
#define MAX_FPS 20
#else
#error BUBBLES: Unsupported LCD type
#endif
#define TEXT_LINES (LCD_HEIGHT/8)
/* shot position */
#define SHOTX XOFS+ROW_INDENT+BUBBLE_WIDTH*3
#define SHOTY ROW_HEIGHT*(BB_HEIGHT-1)+BUBBLE_HEIGHT/2
/* collision distance squared */
#define MIN_DISTANCE ((BUBBLE_WIDTH*8)/10)*((BUBBLE_HEIGHT*8)/10)
/* global rockbox api */
static const struct plugin_api* rb;
/* levels */
char level[NUM_LEVELS][BB_LEVEL_HEIGHT][BB_WIDTH] = {
{{ 6, 6, 4, 4, 2, 2, 3, 3},
{ 6, 6, 4, 4, 2, 2, 3, -1},
{ 2, 2, 3, 3, 6, 6, 4, 4},
{ 2, 3, 3, 6, 6, 4, 4, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{-1, 7, 7, 7, 7, 7, 7, -1},
{-1, 1, 1, 1, 1, 1, -1, -1},
{-1, -1, 2, 2, 2, 2, -1, -1},
{-1, -1, -1, 2, -1, -1, -1, -1},
{-1, -1, -1, 2, 2, -1, -1, -1},
{-1, -1, -1, 5, -1, -1, -1, -1},
{-1, -1, -1, 5, 5, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{-1, -1, 7, -1, -1, 7, -1, -1},
{-1, -1, 7, 1, 7, -1, -1, -1},
{-1, -1, -1, 1, 2, -1, -1, -1},
{-1, -1, 1, 2, 1, -1, -1, -1},
{-1, -1, -1, 2, 5, -1, -1, -1},
{-1, -1, 3, 5, 3, -1, -1, -1},
{-1, -1, -1, 5, 3, -1, -1, -1},
{-1, -1, -1, 3, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{-1, -1, -1, 0, 0, -1, -1, -1},
{-1, -1, 5, 0, 1, -1, -1, -1},
{-1, -1, 3, 5, 1, 6, -1, -1},
{-1, 4, 3, -1, 6, 7, -1, -1},
{-1, 7, 4, -1, -1, 7, 4, -1},
{ 6, 7, -1, -1, -1, 4, 3, -1},
{ 1, 6, -1, -1, -1, -1, 3, 5},
{ 1, -1, -1, -1, -1, -1, 5, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{-1, -1, 0, 0, 0, 0, -1, -1},
{-1, 0, 1, 1, 1, 0, -1, -1},
{-1, 0, 1, 0, 0, 1, 0, -1},
{-1, 0, 1, 1, 1, 0, -1, -1},
{-1, -1, 0, 0, 0, 0, -1, -1},
{-1, -1, 7, -1, 7, -1, -1, -1},
{-1, -1, 7, 7, 7, 7, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{-1, 4, 4, 4, 6, 6, 6, -1},
{ 4, -1, -1, -1, -1, -1, 6, -1},
{-1, 4, -1, -1, -1, -1, 6, -1},
{ 4, 2, 3, 1, 2, 3, 6, -1},
{-1, 3, 1, 2, 3, 1, 2, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{-1, 4, 4, 4, 6, 6, 6, -1},
{ 4, -1, -1, -1, -1, -1, 6, -1},
{-1, 4, -1, -1, -1, -1, 6, -1},
{ 4, 2, 3, 1, 2, 3, 6, -1},
{-1, 3, 1, 2, 3, 1, 2, -1},
{-1, 2, 3, 1, 2, 3, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{-1, 0, 0, -1, -1, 2, 2, -1},
{-1, 5, -1, -1, -1, 3, -1, -1},
{-1, 0, -1, -1, -1, 6, -1, -1},
{-1, 3, -1, -1, -1, 0, -1, -1},
{-1, 4, -1, -1, -1, 5, -1, -1},
{-1, 2, -1, -1, -1, 3, -1, -1},
{-1, 2, -1, -1, -1, 1, -1, -1},
{-1, 3, -1, -1, -1, 4, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{ 3, -1, -1, -1, -1, -1, -1, 3},
{ 6, 3, 2, 4, 6, 3, 2, -1},
{ 4, -1, -1, -1, -1, -1, -1, 4},
{ 2, 4, 6, 3, 2, 4, 6, -1},
{-1, -1, -1, 6, -1, -1, -1, -1},
{-1, -1, -1, 3, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{-1, 2, -1, 1, -1, 1, -1, 2},
{ 1, 2, -1, 2, 1, -1, 1, -1},
{ 1, -1, 1, -1, 2, -1, 2, -1},
{ 2, 1, -1, 1, 2, -1, 2, -1},
{-1, 2, -1, 2, -1, 2, -1, 2},
{ 1, 2, -1, 2, 1, -1, 1, -1},
{ 1, -1, 1, -1, 2, -1, 1, -1},
{ 2, 2, -1, 1, 1, -1, 2, -1},
{-1, 2, -1, 1, -1, 1, -1, 1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{-1, 7, 7, -1, -1, 5, 5, -1},
{ 1, -1, -1, -1, -1, -1, 4, -1},
{ 2, 1, -1, -1, -1, -1, 4, 3},
{ 2, -1, -1, -1, -1, -1, 3, -1},
{ 1, 2, -1, -1, -1, -1, 3, 4},
{ 1, -1, -1, -1, -1, -1, 4, -1},
{ 7, 1, -1, -1, -1, -1, 4, 5},
{ 7, 7, -1, -1, -1, 5, 5, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{ 7, 7, -1, -1, -1, -1, 5, 5},
{ 1, 5, -1, -1, -1, 7, 4, -1},
{ 2, 1, -1, -1, -1, -1, 4, 3},
{ 2, -1, -1, -1, -1, -1, 3, -1},
{ 1, 5, -1, -1, -1, -1, 7, 4},
{ 1, -1, -1, -1, -1, -1, 4, -1},
{ 7, 1, -1, -1, -1, -1, 4, 5},
{ 7, 5, -1, -1, -1, 7, 5, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{-1, -1, -1, 0, 0, -1, -1, -1},
{-1, -1, 5, 0, 1, -1, -1, -1},
{-1, -1, 3, 5, 1, 6, -1, -1},
{-1, 4, 3, 2, 6, 2, -1, -1},
{-1, 7, 4, 7, 2, 2, 4, -1},
{ 6, 7, 7, 3, 3, 4, 3, -1},
{ 1, 6, 1, 1, 1, 3, 3, 5},
{ 1, 1, -1, -1, -1, -1, 5, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{-1, -1, 0, -1, -1, 0, -1, -1},
{-1, 3, 3, -1, 3, 3, -1, -1},
{-1, 0, 2, 0, 0, 2, 0, -1},
{-1, 3, 3, -1, 3, 3, -1, -1},
{-1, -1, 0, -1, -1, 0, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{-1, -1, -1, 1, 1, -1, -1, -1},
{-1, -1, 2, 2, 2, -1, -1, -1},
{-1, -1, 3, 3, 3, 3, -1, -1},
{-1, 4, 4, 4, 4, 4, -1, -1},
{-1, 5, 5, 5, 5, 5, 5, -1},
{-1, -1, -1, 6, -1, -1, -1, -1},
{-1, -1, -1, 7, 7, -1, -1, -1},
{-1, -1, -1, 0, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{-1, -1, -1, 2, 5, -1, -1, -1},
{-1, 4, 3, -1, -1, -1, -1, -1},
{ 6, 7, -1, 5, 2, -1, -1, -1},
{-1, -1, -1, -1, 3, 4, -1, -1},
{-1, -1, -1, 2, 5, -1, 7, 6},
{-1, 4, 3, -1, -1, -1, -1, -1},
{ 6, 7, -1, 5, 2, -1, -1, -1},
{-1, -1, -1, -1, 3, 4, -1, -1},
{-1, -1, -1, -1, -1, -1, 7, 6},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{-1, -1, -1, 5, 5, -1, -1, -1},
{-1, -1, -1, 3, -1, -1, -1, -1},
{-1, -1, -1, 1, -1, -1, -1, -1},
{-1, -1, -1, 7, -1, -1, -1, -1},
{-1, -1, -1, 2, -1, -1, -1, -1},
{-1, -1, -1, 4, -1, -1, -1, -1},
{-1, -1, -1, 5, -1, -1, -1, -1},
{-1, -1, -1, 3, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{-1, -1, -1, 0, 1, -1, -1, -1},
{-1, -1, 0, 2, 7, 7, -1, -1},
{-1, -1, -1, 0, 1, 7, -1, -1},
{-1, 0, 0, 0, 0, -1, -1, -1},
{-1, 0, 0, 0, 1, 1, -1, -1},
{ 0, 0, 0, 1, 1, 1, -1, -1},
{-1, 0, 0, 1, 1, 1, -1, -1},
{-1, 0, 0, 0, 7, 7, -1, -1},
{-1, -1, 7, 7, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{-1, 1, -1, -1, -1, -1, -1, -1},
{ 1, -1, -1, -1, -1, -1, -1, -1},
{-1, 2, 3, 4, 7, 6, 5, -1},
{-1, -1, -1, -1, -1, -1, 1, -1},
{-1, -1, -1, -1, -1, -1, 1, -1},
{-1, 2, 3, 4, 7, 6, -1, -1},
{-1, 1, -1, -1, -1, -1, -1, -1},
{ 1, -1, -1, -1, -1, -1, -1, -1},
{-1, 2, 3, 4, 7, 6, 5, -1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{-1, 6, -1, -1, -1, -1, -1, -1},
{ 5, -1, -1, -1, -1, -1, -1, -1},
{ 2, 3, 4, 7, 6, 5, 2, 3},
{-1, -1, -1, -1, -1, -1, 4, -1},
{-1, -1, -1, -1, -1, -1, 7, -1},
{-1, 4, 3, 2, 5, 6, -1, -1},
{-1, 7, -1, -1, -1, -1, -1, -1},
{ 6, -1, -1, -1, -1, -1, -1, -1},
{ 5, 2, 3, 4, 7, 6, 5, -1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{ 3, 2, 1, 0, 0, 1, 2, 3},
{ 3, 2, 1, 0, 1, 2, 3, -1},
{ 4, 3, 2, 1, 1, 2, 3, 4},
{ 4, 3, 2, 1, 2, 3, 4, -1},
{ 5, 4, 3, 2, 2, 3, 4, 5},
{ 5, 4, 3, 2, 3, 4, 5, -1},
{ 6, 5, 4, 3, 3, 4, 5, 6},
{ 6, 5, 4, 3, 4, 5, 6, -1},
{ 7, 6, 5, 4, 4, 5, 6, 7},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{-1, -1, -1, 5, 5, -1, -1, -1},
{-1, -1, -1, 3, -1, -1, -1, -1},
{-1, -1, -1, 2, 4, -1, -1, -1},
{-1, -1, -1, 6, -1, -1, -1, -1},
{-1, -1, -1, 2, 4, -1, -1, -1},
{-1, 2, -1, 5, -1, 4, -1, -1},
{ 1, 0, 1, 0, 1, 0, 1, 0},
{ 3, -1, 3, -1, 2, -1, 6, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{-1, -1, -1, -1, 1, -1, -1, -1},
{ 7, 4, 3, 5, -1, -1, -1, -1},
{ 6, -1, -1, 1, -1, -1, -1, -1},
{-1, -1, -1, 5, 3, 4, 7, -1},
{ 6, -1, -1, -1, 1, -1, -1, 6},
{ 7, 4, 3, 5, -1, -1, -1, -1},
{-1, -1, -1, 1, -1, -1, -1, 6},
{-1, -1, -1, 5, 3, 4, 7, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{-1, -1, -1, -1, 7, 3, 6, -1},
{-1, -1, 3, 7, 3, 6, 3, -1},
{-1, -1, 5, 7, 3, 6, 3, -1},
{-1, 6, 7, 3, 6, 7, -1, -1},
{-1, 7, 7, 3, 6, 1, -1, -1},
{ 3, 7, 3, 6, 3, -1, -1, -1},
{ 5, 6, 2, 7, 1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{ 5, -1, -1, -1, -1, -1, -1, 5},
{ 5, -1, 6, 6, 6, -1, 5, -1},
{-1, 5, 4, -1, -1, 4, 5, -1},
{-1, 3, -1, -1, -1, 3, -1, -1},
{-1, 6, 0, -1, -1, 0, 6, -1},
{-1, 3, -1, -1, -1, 3, -1, -1},
{-1, -1, 4, -1, -1, 4, -1, -1},
{-1, -1, 6, 6, 6, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{-1, 7, 0, -1, -1, 0, 7, -1},
{ 7, -1, 0, -1, 0, -1, 7, -1},
{ 7, 1, -1, 0, 0, -1, 1, 7},
{ 7, 1, 2, 0, 2, 1, 7, -1},
{ 7, 6, 3, 2, 2, 3, 6, 7},
{ 7, -1, 3, 2, 3, -1, 7, -1},
{-1, 7, 7, 3, 3, 7, 7, -1},
{-1, -1, -1, 3, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{-1, 3, -1, 1, -1, 7, -1, 6},
{ 5, -1, 7, -1, 7, -1, 6, -1},
{ 6, -1, 0, -1, 5, -1, 3, -1},
{-1, 2, -1, 1, -1, 5, -1, -1},
{-1, 4, -1, 3, -1, 4, -1, -1},
{ 2, -1, 3, -1, 2, -1, -1, -1},
{-1, -1, 4, -1, 6, -1, -1, -1},
{-1, -1, -1, 5, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{-1, -1, -1, -1, 1, -1, -1, -1},
{-1, -1, -1, -1, 3, -1, -1, -1},
{ 6, 1, 3, 1, 2, 1, 4, 1},
{-1, -1, -1, -1, 6, -1, -1, -1},
{-1, -1, -1, 4, 1, -1, -1, -1},
{-1, -1, 1, -1, 3, -1, -1, -1},
{-1, -1, -1, 2, 1, -1, -1, -1},
{-1, -1, -1, -1, 4, -1, -1, -1},
{-1, -1, -1, 6, 1, -1, -1, -1},
{-1, -1, -1, 6, -1, -1, -1, -1}},
{{-1, -1, -1, 5, 4, -1, -1, -1},
{-1, -1, 4, 1, 0, -1, -1, -1},
{-1, -1, -1, 2, 3, -1, -1, -1},
{-1, 1, 4, -1, 2, 2, -1, -1},
{-1, 3, 1, 2, 5, 1, 4, -1},
{-1, 4, 2, -1, 0, 4, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{-1, -1, -1, -1, 1, -1, -1, -1},
{-1, -1, -1, 1, -1, -1, -1, -1},
{-1, 2, -1, -1, 1, -1, 5, -1},
{ 5, -1, -1, 1, -1, -1, 0, -1},
{-1, 6, -1, -1, 1, -1, 4, -1},
{-1, 0, -1, 1, -1, 5, -1, -1},
{-1, -1, 5, 5, 0, 1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{-1, -1, -1, 6, 3, -1, -1, -1},
{-1, -1, 3, 2, 6, -1, -1, -1},
{-1, -1, 2, 6, 3, 2, -1, -1},
{-1, 6, 3, 2, 6, 3, -1, -1},
{-1, 3, 2, 6, 3, 2, 6, -1},
{ 2, 6, 3, 2, 6, 3, 2, -1},
{ 6, 3, 2, 6, 3, 2, 6, 3},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{ 6, 6, 6, 6, 6, 6, 6, 6},
{ 4, -1, -1, -1, -1, -1, -1, -1},
{-1, 3, 2, 5, 7, 6, 4, 3},
{-1, 5, -1, -1, -1, -1, -1, -1},
{-1, -1, 7, 6, 4, 3, 2, 5},
{-1, -1, 4, -1, -1, -1, -1, -1},
{-1, -1, -1, 3, 2, 5, 7, 6},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{ 1, -1, 7, -1, -1, 6, -1, 2},
{ 6, -1, 1, -1, 6, 1, 3, -1},
{-1, 4, -1, 7, 2, -1, 7, -1},
{ 2, 7, -1, -1, -1, 4, -1, -1},
{ 6, -1, 3, 5, 0, 2, -1, 7},
{ 1, -1, -1, -1, -1, -1, 1, -1},
{-1, 1, 4, 5, 7, 5, 1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{ 6, 6, 6, -1, -1, 6, 6, 6},
{-1, -1, 6, -1, 6, -1, -1, -1},
{-1, -1, 2, 3, 3, 2, -1, -1},
{-1, 3, -1, 5, -1, 3, -1, -1},
{-1, -1, 5, 3, 3, 5, -1, -1},
{-1, -1, 6, 1, 6, -1, -1, -1},
{-1, 4, 2, -1, -1, 2, 4, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{-1, -1, -1, 5, 5, -1, -1, -1},
{-1, -1, 5, -1, -1, -1, -1, -1},
{-1, 3, 4, 6, 6, -1, -1, 5},
{ 3, 3, 4, 6, 5, -1, 5, -1},
{ 3, 2, 3, 6, 6, 5, 5, -1},
{ 3, 3, 4, 6, 5, -1, 5, -1},
{-1, 3, 4, 6, 6, -1, -1, 5},
{-1, -1, 5, -1, -1, -1, -1, -1},
{-1, -1, -1, 5, 5, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{ 1, -1, -1, -1, -1, -1, -1, 1},
{ 1, -1, 2, 2, 2, -1, 1, -1},
{-1, 1, 2, 3, 3, 2, 1, -1},
{ 6, 2, 3, -1, 3, 2, 6, -1},
{ 6, 2, 3, -1, -1, 3, 2, 6},
{ 6, 2, 3, -1, 3, 2, 6, -1},
{ 3, 3, 3, 7, 7, 3, 3, 3},
{ 0, 5, 0, 2, 0, 5, 0, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{-1, -1, 7, 7, 7, -1, -1, -1},
{-1, 7, 2, 2, 7, -1, -1, -1},
{-1, 7, 5, 5, 5, 7, -1, -1},
{ 7, 7, 7, 7, 7, 7, -1, -1},
{-1, -1, 6, -1, 6, -1, -1, -1},
{-1, 6, -1, -1, 6, -1, -1, -1},
{-1, 6, 4, 4, -1, 6, 4, 4},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{-1, 3, 3, -1, 3, 3, 3, -1},
{ 3, 7, 5, 4, 6, 5, 3, -1},
{ 1, 3, 3, 3, -1, 3, 3, 1},
{ 2, 1, 2, 1, 2, 1, 2, -1},
{ 1, 3, 3, -1, 3, 3, 3, 1},
{ 3, 5, 6, 4, 5, 7, 3, -1},
{ 2, 3, 3, 3, -1, 3, 3, 2},
{ 1, 1, 2, 2, 2, 1, 1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{-1, 6, 5, -1, -1, -1, -1, -1},
{ 3, 1, 3, -1, -1, -1, -1, -1},
{-1, 5, 6, -1, -1, -1, -1, -1},
{-1, -1, 5, 3, -1, -1, -1, -1},
{-1, -1, 6, 1, 6, -1, -1, -1},
{-1, -1, 3, 5, -1, -1, -1, -1},
{-1, -1, -1, -1, 3, 6, -1, -1},
{-1, -1, -1, 5, 6, 5, -1, -1},
{-1, -1, -1, -1, 6, 3, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{ 6, 3, 7, 4, 5, 1, 6, 3},
{ 5, 1, 6, 3, 7, 4, 5, -1},
{ 6, 3, 7, 4, 5, 1, 6, 3},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{-1, -1, -1, -1, -1, -1, 4, 4},
{-1, -1, 7, 7, 7, 4, 4, -1},
{-1, -1, -1, -1, -1, -1, 4, 4},
{-1, 1, -1, -1, -1, 7, -1, -1},
{-1, 1, 1, -1, -1, 7, -1, -1},
{ 3, 3, 3, -1, 7, -1, -1, -1},
{ 3, -1, 2, 3, 3, 3, -1, 3},
{-1, 2, -1, 3, -1, 3, 3, -1},
{-1, 2, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{-1, -1, 4, -1, -1, -1, -1, -1},
{-1, 7, 4, -1, -1, -1, -1, -1},
{-1, -1, 7, 4, -1, -1, -1, -1},
{-1, 4, 7, 4, -1, -1, -1, -1},
{ 1, 1, 1, 1, 1, 1, 1, -1},
{ 1, 2, 1, 2, 1, 1, -1, -1},
{ 2, 2, 2, 2, 2, 2, 2, 2},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{ 0, -1, -1, -1, -1, -1, -1, 6},
{ 6, 1, 4, 3, 7, 5, 0, -1},
{ 0, -1, -1, -1, -1, -1, -1, 6},
{ 6, 1, 4, 3, 7, 5, 0, -1},
{ 0, -1, -1, -1, -1, -1, -1, 6},
{ 6, 1, 4, 3, 7, 5, 0, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{ 3, 3, 4, 6, 6, 4, 3, 3},
{ 0, 3, 4, 6, 4, 3, 1, -1},
{ 5, 1, 3, 4, 4, 3, 0, 1},
{ 0, 1, 3, 4, 3, 1, 0, -1},
{ 2, 1, 6, 3, 3, 0, 0, 1},
{ 0, 3, 4, 3, 6, 1, 5, -1},
{ 6, 1, 2, 6, 4, 0, 0, 2},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{ 6, 6, -1, -1, -1, -1, 4, 4},
{ 4, 0, -1, -1, -1, 3, 6, -1},
{ 0, 6, -1, -1, -1, -1, 4, 2},
{ 7, -1, -1, -1, -1, -1, 7, -1},
{ 4, 4, -1, -1, -1, -1, 5, 6},
{ 6, 4, 7, 7, 5, 6, 4, -1},
{-1, 7, 6, 4, 6, 4, 7, -1},
{-1, 0, -1, 7, -1, 7, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{-1, 5, -1, -1, -1, -1, 4, -1},
{-1, 5, -1, -1, -1, 4, -1, -1},
{-1, -1, 5, 6, 6, 4, -1, -1},
{-1, -1, 2, -1, 2, -1, -1, -1},
{ 0, 0, 6, -1, -1, 6, 1, 1},
{-1, -1, 2, -1, 2, -1, -1, -1},
{-1, -1, 7, 6, 6, 3, -1, -1},
{-1, 7, -1, -1, -1, 3, -1, -1},
{-1, 7, -1, -1, -1, -1, 3, -1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{-1, 6, -1, -1, -1, -1, 2, -1},
{ 1, 7, 1, 1, 1, 3, 1, -1},
{-1, -1, 4, 1, 1, 4, -1, -1},
{-1, 1, 3, 1, 7, 1, -1, -1},
{-1, -1, -1, 2, 6, -1, -1, -1},
{-1, -1, 1, 5, 1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{ 7, 7, 7, 7, 7, 7, 7, 7},
{ 7, -1, -1, -1, -1, -1, 7, -1},
{ 7, -1, -1, 2, 0, 5, 2, 2},
{ 7, -1, -1, -1, 0, 3, 6, -1},
{ 7, -1, -1, -1, -1, -1, 4, 0},
{ 5, 5, -1, -1, -1, -1, -1, -1},
{ 4, 3, 6, 2, -1, -1, -1, -1},
{ 0, 2, 0, 4, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{-1, -1, 1, -1, -1, 1, -1, -1},
{-1, 4, -1, -1, 5, -1, -1, -1},
{-1, 7, -1, -1, 1, 1, 1, -1},
{ 6, -1, -1, -1, -1, 7, -1, -1},
{ 1, 1, 1, 1, -1, 4, -1, -1},
{-1, -1, 5, -1, -1, -1, -1, -1},
{-1, -1, 0, -1, -1, -1, -1, -1},
{-1, 3, -1, -1, -1, -1, -1, -1},
{-1, 1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{-1, 7, 7, -1, -1, 7, 7, -1},
{ 6, -1, 4, -1, 4, -1, 6, -1},
{ 5, -1, -1, 3, 3, -1, -1, 5},
{ 6, -1, -1, -1, -1, -1, 6, -1},
{-1, 7, -1, -1, -1, -1, 7, -1},
{-1, 4, -1, -1, -1, 4, -1, -1},
{-1, -1, 3, -1, -1, 3, -1, -1},
{-1, -1, 2, -1, 2, -1, -1, -1},
{-1, -1, -1, 5, 5, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{-1, 0, 0, -1, -1, 0, 0, -1},
{ 7, 4, 6, 6, 6, 4, 3, -1},
{ 5, 6, 6, 6, 2, 6, 6, 3},
{ 7, 4, 6, 6, 6, 4, 3, -1},
{-1, 0, 0, -1, -1, 0, 0, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{-1, -1, -1, -1, -1, 7, 7, 7},
{-1, -1, -1, -1, 2, 7, 7, -1},
{-1, 0, 7, 7, 7, -1, 7, 7},
{ 6, 7, 7, 7, -1, -1, -1, -1},
{ 6, -1, -1, -1, 7, 7, 7, 7},
{ 6, -1, -1, -1, -1, -1, -1, -1},
{ 4, 2, 2, 2, 4, -1, 3, -1},
{ 4, 4, 4, 4, 3, 3, 3, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{ 4, -1, -1, 7, -1, 6, -1, 7},
{ 7, 6, 7, -1, -1, 7, 4, -1},
{-1, -1, 7, -1, -1, 7, -1, -1},
{-1, 0, 0, 0, 0, 0, 3, -1},
{-1, -1, 0, 2, 2, 0, 6, 4},
{-1, -1, 0, 0, 0, 1, 3, -1},
{-1, -1, -1, 0, 0, -1, 3, 4},
{-1, -1, -1, 6, -1, 5, 6, -1},
{-1, -1, -1, -1, -1, -1, 1, 0},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{-1, 5, -1, -1, -1, -1, 5, -1},
{ 0, -1, -1, 0, -1, -1, 0, -1},
{ 0, 0, 0, 2, 2, 0, 0, 0},
{ 0, -1, -1, 0, -1, -1, 0, -1},
{-1, 7, -1, 3, -1, -1, 7, -1},
{-1, -1, 3, 6, -1, -1, -1, -1},
{-1, -1, -1, 6, -1, -1, -1, -1},
{-1, 3, 6, -1, -1, -1, -1, -1},
{-1, 3, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{-1, -1, -1, 6, 5, -1, -1, -1},
{-1, -1, 2, 6, 3, -1, -1, -1},
{-1, -1, 5, 4, 7, 1, -1, -1},
{-1, 6, 2, 2, 3, 4, -1, -1},
{-1, -1, 3, 7, 3, 6, -1, -1},
{-1, -1, 1, 3, 2, -1, -1, -1},
{-1, -1, -1, 4, 5, -1, -1, -1},
{-1, -1, -1, 4, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{ 7, 7, -1, 2, 2, -1, 6, 6},
{ 6, -1, -1, 6, -1, -1, 3, -1},
{ 2, -1, -1, 1, -1, -1, 2, -1},
{ 5, -1, -1, 3, -1, -1, 2, -1},
{ 1, -1, -1, 2, -1, -1, 1, -1},
{ 5, -1, -1, 2, -1, -1, 2, -1},
{ 6, -1, -1, 1, -1, -1, 7, -1},
{ 5, -1, -1, 5, -1, -1, 4, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{-1, -1, -1, 6, 6, -1, -1, -1},
{-1, 0, 4, 4, 4, 0, -1, -1},
{-1, -1, -1, 6, 6, -1, -1, -1},
{-1, -1, 2, 7, 2, -1, -1, -1},
{-1, -1, -1, 6, 6, -1, -1, -1},
{-1, 0, 5, 5, 5, 0, -1, -1},
{-1, -1, -1, 3, 3, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{-1, -1, 4, 1, 3, -1, -1, -1},
{-1, 1, -1, -1, 1, -1, -1, -1},
{-1, -1, 4, 1, 3, 4, 1, -1},
{-1, 1, 3, 4, -1, -1, 4, -1},
{-1, 3, -1, -1, 3, 4, 1, -1},
{-1, 1, 3, 4, 1, 3, -1, -1},
{-1, -1, 4, 1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{-1, 6, 4, -1, 3, 2, 5, -1},
{ 0, -1, -1, -1, -1, -1, 1, -1},
{-1, 2, 3, 5, -1, 4, 6, -1},
{ 0, -1, -1, -1, -1, -1, 1, -1},
{-1, 4, 6, -1, 2, 5, 3, -1},
{ 0, -1, -1, -1, -1, -1, 1, -1},
{-1, 5, 2, 3, -1, 4, 6, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{-1, -1, -1, 6, 6, -1, -1, -1},
{-1, -1, 7, 6, 4, -1, -1, -1},
{-1, 2, 1, 7, 4, 1, 3, -1},
{ 2, 1, 1, 1, 1, 1, 3, -1},
{-1, 2, 2, 2, 3, 3, 3, -1},
{-1, -1, -1, 5, -1, -1, -1, -1},
{-1, -1, -1, 2, 3, -1, -1, -1},
{-1, -1, -1, 5, -1, -1, -1, -1},
{-1, -1, 2, 2, 3, 3, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{ 4, -1, 5, -1, -1, 3, -1, 6},
{ 2, -1, 3, -1, 2, -1, 4, -1},
{ 4, -1, -1, 1, 0, -1, -1, 6},
{ 6, -1, 2, 3, 5, -1, 4, -1},
{ 4, -1, -1, 0, 1, -1, -1, 6},
{ 2, -1, 5, -1, 3, -1, 4, -1},
{ 4, -1, 3, -1, -1, 2, -1, 6},
{ 6, -1, -1, -1, -1, -1, 4, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{ 2, 6, 0, 5, 5, 1, 3, 4},
{ 1, -1, -1, 2, -1, -1, 0, -1},
{ 4, -1, -1, 3, 6, -1, -1, 2},
{-1, -1, -1, 0, -1, -1, -1, -1},
{-1, -1, -1, 1, 4, -1, -1, -1},
{-1, -1, -1, 2, -1, -1, -1, -1},
{-1, -1, -1, 6, 3, -1, -1, -1},
{-1, -1, -1, 5, -1, -1, -1, -1},
{-1, -1, -1, 4, 1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{-1, -1, -1, -1, 5, 1, 1, 3},
{ 0, 5, 1, 0, 5, 3, 3, -1},
{ 5, 1, 0, 5, 1, 0, 5, 1},
{ 0, 5, 1, 0, 5, 1, 6, -1},
{-1, -1, -1, -1, 1, 6, 5, 1},
{-1, -1, -1, -1, 5, 1, 6, -1},
{-1, -1, -1, -1, 1, 0, 5, 1},
{-1, -1, -1, -1, 5, 1, 0, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{-1, 0, 7, 3, -1, -1, 2, 2},
{-1, 0, 7, 3, -1, -1, 2, -1},
{-1, 0, 7, 3, -1, -1, 2, 2},
{-1, 0, 7, 3, -1, 3, 1, -1},
{-1, 0, 7, 3, -1, 6, 4, 5},
{-1, 0, 7, 3, -1, 7, 0, -1},
{-1, 0, 7, 3, -1, 2, 3, 4},
{-1, 0, 7, 3, -1, 5, 6, -1},
{-1, -1, -1, -1, -1, 7, 0, 1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{-1, -1, -1, 7, 7, 7, 7, -1},
{ 3, 4, 5, -1, -1, -1, 7, -1},
{ 2, -1, -1, -1, -1, -1, -1, 3},
{ 7, -1, -1, -1, -1, -1, 4, -1},
{ 7, -1, -1, -1, 3, 4, 5, 6},
{ 7, -1, -1, 2, 0, 1, 2, -1},
{ 6, -1, -1, -1, 3, 4, 5, 6},
{ 0, 1, -1, -1, -1, -1, -1, -1},
{ 2, 3, 4, -1, -1, -1, -1, -1},
{ 5, 6, 0, -1, -1, -1, -1, -1}},
{{-1, 7, -1, -1, -1, -1, 2, -1},
{ 1, 1, -1, -1, -1, 3, 3, -1},
{-1, 2, -1, -1, -1, -1, 4, -1},
{ 3, 3, -1, -1, -1, 5, 5, -1},
{-1, 4, -1, -1, -1, -1, 6, -1},
{ 5, 5, -1, -1, -1, 1, 1, -1},
{-1, 6, -1, -1, -1, -1, 7, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{-1, 4, -1, -1, -1, -1, 4, -1},
{ 2, -1, -1, 1, -1, -1, 2, -1},
{ 5, -1, -1, 0, 0, -1, -1, 5},
{ 5, -1, -1, 1, -1, -1, 6, -1},
{-1, 4, 2, 7, 7, 5, 4, -1},
{-1, -1, -1, 6, -1, -1, -1, -1},
{-1, -1, -1, 3, 3, -1, -1, -1},
{-1, -1, -1, 7, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{-1, 1, -1, -1, 2, 3, 4, -1},
{ 2, -1, -1, 3, 0, 4, -1, -1},
{ 4, -1, -1, 2, 3, 1, -1, -1},
{ 3, -1, 4, 3, 0, -1, -1, -1},
{ 4, -1, -1, 2, 5, 1, -1, -1},
{ 3, -1, 4, 5, 0, 4, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{ 2, -1, -1, 1, 1, -1, -1, 2},
{ 2, -1, 3, 3, 3, -1, 2, -1},
{-1, 2, -1, 4, 4, -1, 2, -1},
{-1, 7, 7, 0, 7, 7, -1, -1},
{-1, -1, -1, 4, 4, -1, -1, -1},
{-1, -1, 5, 7, 5, -1, -1, -1},
{ 6, 3, 2, 6, 4, 2, 3, 6},
{ 5, -1, -1, -1, -1, -1, 1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{ 4, 2, 3, 5, 7, 1, 3, 6},
{ 1, -1, -1, 1, -1, -1, 1, -1},
{ 3, 0, 1, 3, 2, 4, 3, 5},
{ 4, -1, -1, 4, -1, -1, 4, -1},
{-1, 5, -1, -1, 5, -1, -1, 5},
{ 0, 3, 2, 0, 4, 5, 0, -1},
{-1, 6, -1, -1, 6, -1, -1, 6},
{ 7, -1, -1, 7, -1, -1, 7, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{-1, 5, 4, -1, 1, 1, -1, -1},
{ 5, -1, 4, 1, -1, 1, -1, -1},
{ 0, -1, -1, -1, -1, -1, 0, -1},
{ 0, 6, 4, -1, -1, 4, 2, -1},
{-1, 4, 3, 5, 2, 6, 3, 6},
{-1, 2, 6, -1, -1, 5, 4, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{-1, -1, -1, 6, 6, -1, -1, -1},
{-1, -1, 5, 5, 4, -1, -1, -1},
{-1, -1, 1, 6, 6, 4, -1, -1},
{-1, 1, 7, 2, 5, 3, -1, -1},
{-1, 2, 7, 2, 1, 5, 3, -1},
{ 2, 1, 3, 1, 4, 2, 7, -1},
{-1, 3, 1, 3, 4, 2, 7, -1},
{-1, 3, 5, 5, 6, 6, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{-1, -1, 7, 3, -1, -1, -1, -1},
{-1, 1, 7, 6, -1, -1, -1, -1},
{-1, 3, 7, 5, 1, 5, -1, -1},
{ 7, 7, 0, 2, 4, 0, 4, -1},
{ 7, 1, 4, 6, 5, 6, 5, 7},
{ 1, 7, 7, 1, 7, 7, 1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{-1, -1, 1, -1, -1, 1, -1, -1},
{-1, 5, 6, 1, 5, 6, -1, -1},
{-1, 1, 1, 2, 2, 1, 1, -1},
{ 4, 7, 1, 0, 1, 7, 4, -1},
{-1, 3, 7, 5, 7, 5, 3, -1},
{-1, 1, 1, 1, 1, 1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{ 4, -1, -1, -1, 5, -1, -1, 4},
{ 6, 6, 7, 6, -1, 4, 5, -1},
{ 4, 2, 7, 5, 2, 2, 6, 4},
{-1, -1, 4, 1, -1, 5, 2, -1},
{-1, 5, 2, 7, 7, -1, 7, 4},
{ 4, 6, 5, 4, -1, 4, 2, -1},
{-1, -1, -1, 4, -1, 4, 1, -1},
{ 0, 0, 0, 5, -1, -1, -1, -1},
{-1, -1, -1, -1, 0, 0, 0, 0},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{ 1, -1, -1, -1, 0, 0, -1, -1},
{ 2, -1, -1, 0, 1, 0, -1, -1},
{ 3, -1, -1, 0, 2, 2, 0, -1},
{ 4, -1, 0, 1, 1, 1, 0, -1},
{ 5, -1, -1, 0, 4, 4, 0, -1},
{ 6, -1, -1, 4, 4, 4, -1, -1},
{ 7, -1, -1, -1, 4, 4, -1, -1},
{-1, -1, -1, 0, 1, 0, -1, -1},
{-1, -1, -1, 0, 1, 1, 0, -1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{-1, -1, 3, -1, -1, 1, 7, -1},
{-1, 7, 4, -1, -1, 4, 3, -1},
{ 1, -1, -1, 0, 2, 0, -1, -1},
{ 5, 4, -1, 3, -1, -1, -1, -1},
{ 4, -1, 3, 6, 1, 1, 6, -1},
{-1, 1, -1, -1, 4, -1, 1, -1},
{-1, 7, 5, -1, -1, -1, 3, -1},
{-1, -1, 3, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{ 1, -1, -1, -1, 1, -1, -1, -1},
{ 2, -1, -1, -1, 2, -1, -1, -1},
{-1, 3, -1, -1, 3, 3, -1, -1},
{-1, 4, -1, 4, -1, 4, -1, -1},
{-1, 5, -1, -1, 5, 5, -1, -1},
{ 6, -1, -1, 7, 1, 7, -1, -1},
{ 7, -1, -1, -1, 6, 6, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{ 2, -1, -1, 6, -1, 2, 5, 1},
{ 5, -1, 4, -1, 4, -1, 4, -1},
{ 6, -1, -1, 3, -1, -1, -1, 3},
{ 4, 2, 0, -1, -1, -1, 5, -1},
{-1, -1, -1, 6, -1, 3, 6, -1},
{-1, -1, 5, -1, 5, -1, -1, -1},
{-1, -1, -1, 3, -1, 4, 2, 5},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{ 6, -1, -1, -1, 4, -1, -1, 3},
{ 0, 3, -1, -1, 6, -1, 0, -1},
{-1, -1, 7, -1, 1, -1, 3, -1},
{ 7, -1, 4, 7, -1, 2, -1, -1},
{ 5, 2, 3, 2, 1, 6, -1, 3},
{-1, -1, 0, 4, 3, 5, 4, -1},
{-1, 7, 6, -1, -1, 0, -1, -1},
{ 4, 3, -1, -1, -1, 4, 2, -1},
{ 0, -1, -1, -1, -1, -1, 6, -1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{ 6, 1, 2, 5, 1, 6, 3, 0},
{-1, -1, -1, -1, -1, -1, 4, -1},
{ 0, 5, 2, 7, 1, 6, 2, -1},
{ 3, -1, -1, -1, -1, -1, -1, -1},
{ 6, 7, 6, 4, 0, 5, 2, 6},
{-1, -1, -1, -1, -1, -1, 1, -1},
{ 6, 1, 4, 0, 6, 2, 3, -1},
{ 0, -1, -1, -1, -1, -1, -1, -1},
{-1, 0, 4, 5, 3, 7, 6, 0},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{-1, -1, -1, 0, 1, -1, -1, -1},
{-1, -1, 0, 7, 0, -1, -1, -1},
{-1, -1, 1, 2, 2, 0, -1, -1},
{-1, 0, 7, 0, 7, 0, -1, -1},
{-1, 6, -1, 7, 7, -1, 6, -1},
{ 4, 1, 6, 6, 6, 4, 1, -1},
{-1, 5, -1, 7, 7, -1, 5, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{-1, -1, -1, 5, 6, -1, -1, -1},
{-1, -1, 3, 3, 3, -1, -1, -1},
{-1, -1, 7, 5, 3, 7, -1, -1},
{-1, 3, -1, 6, -1, 3, -1, -1},
{ 2, -1, -1, 3, 7, -1, -1, 1},
{ 2, 2, -1, 3, -1, 1, 1, -1},
{-1, 0, 2, 5, 6, 1, 0, -1},
{-1, -1, -1, 3, -1, -1, -1, -1},
{-1, -1, -1, 3, 7, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{-1, 6, -1, -1, -1, -1, 2, -1},
{-1, 2, 6, 0, 6, 0, -1, -1},
{-1, 0, -1, -1, -1, -1, -1, -1},
{ 6, -1, -1, -1, -1, -1, -1, -1},
{-1, 3, 3, 2, 0, 6, 0, 0},
{-1, 6, -1, -1, -1, -1, 0, -1},
{-1, -1, -1, 6, 0, 2, 6, -1},
{-1, 2, 0, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{ 0, 7, -1, -1, -1, -1, -1, -1},
{ 1, 5, -1, -1, -1, -1, -1, -1},
{ 7, 2, 5, -1, -1, -1, -1, -1},
{ 6, 3, 4, -1, -1, -1, -1, -1},
{ 5, 5, 4, 4, -1, -1, -1, -1},
{ 3, 3, 5, 3, -1, -1, -1, -1},
{ 1, 2, 2, 5, 3, -1, -1, -1},
{ 1, 0, 0, 7, 6, -1, -1, -1},
{ 3, 3, 5, 5, 7, 6, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{-1, -1, 2, 6, 6, 2, -1, -1},
{-1, 2, 1, 1, 0, 2, -1, -1},
{-1, 2, 3, 2, 2, 0, 2, -1},
{ 2, 3, 2, 5, 2, 7, 2, -1},
{ 2, 4, 2, 5, 2, 7, 2, 0},
{ 2, 4, 2, 6, 6, 2, 0, -1},
{-1, 2, 5, 2, 2, 2, 7, 2},
{-1, 2, 5, 6, 6, 7, 2, -1},
{-1, -1, 2, 2, 2, 2, 2, -1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{-1, -1, 0, -1, -1, 0, -1, -1},
{ 1, 0, 0, 1, 0, 0, 1, -1},
{ 1, 7, 7, 5, 5, 7, 7, 1},
{ 3, 2, -1, 2, -1, 2, 3, -1},
{ 3, 7, -1, 6, 6, -1, 7, 3},
{ 7, -1, -1, 6, -1, -1, 7, -1},
{ 4, 4, 5, -1, -1, 5, 4, 4},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{-1, 6, 3, -1, -1, 3, 6, -1},
{ 6, -1, 2, -1, 2, -1, 6, -1},
{ 2, -1, 0, 1, 1, 0, -1, 2},
{ 5, 0, -1, 7, -1, 0, 5, -1},
{-1, 5, -1, 6, 6, -1, 5, -1},
{ 7, 1, 4, -1, 4, 1, 7, -1},
{ 7, -1, 4, -1, -1, 4, -1, 7},
{ 2, 0, -1, -1, -1, 0, 2, -1},
{-1, 2, -1, -1, -1, -1, 2, -1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{ 6, 1, -1, -1, -1, -1, 4, 0},
{ 2, 7, 5, 5, 5, 7, 3, -1},
{ 6, 1, -1, -1, -1, -1, 4, 0},
{ 2, 5, 7, 7, 7, 5, 3, -1},
{ 6, 1, -1, -1, -1, -1, 4, 0},
{ 2, 0, 6, 6, 6, 0, 3, -1},
{ 6, 1, -1, -1, -1, -1, 4, 0},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{ 5, -1, -1, 1, 1, -1, -1, 5},
{ 5, -1, 4, -1, 4, -1, 5, -1},
{-1, 2, 4, -1, -1, 4, 2, -1},
{ 7, 2, -1, -1, -1, 2, 7, -1},
{ 0, -1, 0, 4, 4, 0, -1, 0},
{ 7, 2, -1, -1, -1, 2, 7, -1},
{-1, 2, 3, -1, -1, 3, 2, -1},
{ 5, -1, 3, -1, 3, -1, 5, -1},
{ 5, -1, -1, 6, 6, -1, -1, 5},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{ 2, 2, -1, -1, -1, -1, 5, 5},
{ 5, -1, -1, -1, -1, -1, 2, -1},
{ 5, -1, -1, -1, -1, -1, -1, 2},
{ 1, -1, 1, 5, 1, -1, 3, -1},
{ 5, 2, 5, 3, 1, 2, 5, 2},
{ 2, 0, 5, -1, 2, 0, 5, -1},
{-1, 3, 7, -1, -1, 3, 7, -1},
{-1, -1, 2, 0, 5, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{ 0, 6, 5, 2, 3, 4, 1, 7},
{-1, -1, -1, -1, 1, -1, -1, -1},
{-1, -1, -1, 1, 1, -1, -1, -1},
{-1, -1, 1, -1, -1, -1, -1, -1},
{ 7, 1, 4, 3, 2, 5, 6, 0},
{-1, -1, -1, -1, 1, -1, -1, -1},
{-1, -1, -1, 1, 1, -1, -1, -1},
{-1, -1, 1, -1, -1, -1, -1, -1},
{ 0, 6, 5, 2, 3, 4, 1, 7},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{-1, -1, 1, -1, -1, 1, -1, -1},
{-1, 2, 4, -1, 2, 4, -1, -1},
{-1, 2, 3, 6, 5, 3, 2, -1},
{-1, 6, 5, -1, 6, 5, -1, -1},
{-1, -1, -1, 7, 7, -1, -1, -1},
{-1, -1, -1, 7, -1, -1, -1, -1},
{ 1, -1, -1, 7, 7, -1, -1, 3},
{ 2, -1, -1, 7, -1, -1, 2, -1},
{-1, 3, 4, 5, 6, 4, 1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{ 1, -1, -1, 2, 2, -1, -1, 2},
{ 1, 3, 7, 3, 7, 4, 2, -1},
{-1, 1, 6, -1, -1, 6, 2, -1},
{ 6, -1, 7, 3, 7, -1, 6, -1},
{-1, 4, 2, -1, -1, 1, 3, -1},
{-1, -1, 2, 6, 1, -1, -1, -1},
{-1, 4, 3, 3, 4, 4, 3, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{-1, -1, -1, 5, 6, -1, -1, -1},
{-1, -1, -1, 3, -1, -1, -1, -1},
{-1, -1, -1, 1, 2, -1, -1, -1},
{-1, -1, -1, 4, -1, -1, -1, -1},
{-1, -1, -1, 5, 7, -1, -1, -1},
{-1, -1, -1, 2, -1, -1, -1, -1},
{ 6, 5, 4, 3, 2, 1, 7, 5},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{-1, 0, -1, 1, -1, 2, -1, -1},
{-1, 4, -1, 5, -1, 6, -1, -1},
{-1, 7, -1, 0, -1, 2, -1, -1},
{-1, 6, -1, 3, -1, 6, -1, -1},
{-1, 1, -1, 1, -1, 2, -1, -1},
{-1, 3, -1, 5, -1, 0, -1, -1},
{-1, 2, -1, 4, -1, 6, -1, -1},
{-1, 3, -1, 6, -1, 7, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{ 1, 1, 2, 2, 3, 3, 4, 4},
{ 5, 5, 6, 7, 6, 5, 5, -1},
{ 6, 4, 3, 3, 2, 2, 1, 6},
{ 4, 6, 5, 7, 6, 3, 1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1},
{-1, -1, -1, -1, -1, -1, -1, -1}},
{{ 7, 4, -1, 1, 2, -1, 4, 7},
{ 5, 5, -1, 2, -1, 4, 4, -1},
{-1, 5, -1, 7, 7, -1, 4, -1},
{ 1, 0, 6, 7, 6, 0, 2, -1},
{-1, 2, -1, 5, 3, -1, 1, -1},
{ 1, 1, -1, -1, -1, 2, 2, -1},
{ 6, 1, 4, -1, -1, 4, 2, 6},
{