diff --git a/.gitignore b/.gitignore index 167cea8..ecc8043 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ jtag.cdf /*.qws greybox_tmp/cbx_args.txt */greybox_tmp/cbx_args.txt +changes.txt diff --git a/CoCo3.qsf b/CoCo3.qsf index 328846e..570505a 100644 --- a/CoCo3.qsf +++ b/CoCo3.qsf @@ -19,7 +19,7 @@ set_global_assignment -name GENERATE_RBF_FILE ON set_global_assignment -name PROJECT_OUTPUT_DIRECTORY output_files set_global_assignment -name NUM_PARALLEL_PROCESSORS ALL set_global_assignment -name SAVE_DISK_SPACE OFF -set_global_assignment -name SMART_RECOMPILE ON +set_global_assignment -name SMART_RECOMPILE OFF set_global_assignment -name MIN_CORE_JUNCTION_TEMP "-40" set_global_assignment -name MAX_CORE_JUNCTION_TEMP 100 set_global_assignment -name POWER_PRESET_COOLING_SOLUTION "23 MM HEAT SINK WITH 200 LFPM AIRFLOW" @@ -65,7 +65,7 @@ source sys/sys_analog.tcl source files.qip set_global_assignment -name ENABLE_SIGNALTAP ON -set_global_assignment -name USE_SIGNALTAP_FILE Vsync.stp +set_global_assignment -name USE_SIGNALTAP_FILE HD2.stp set_global_assignment -name SIGNALTAP_FILE Video_Explorer.stp set_global_assignment -name SIGNALTAP_FILE rom_Exploror.stp1 set_global_assignment -name SOURCE_FILE rom_Exploror.stp1 @@ -73,96 +73,7 @@ set_global_assignment -name SIGNALTAP_FILE Serial.stp set_global_assignment -name SIGNALTAP_FILE AMW.stp set_global_assignment -name SIGNALTAP_FILE HD.stp set_global_assignment -name SIGNALTAP_FILE reset.stp -set_global_assignment -name SLD_NODE_CREATOR_ID 110 -section_id auto_signaltap_0 -set_global_assignment -name SLD_NODE_ENTITY_NAME sld_signaltap -section_id auto_signaltap_0 -set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_clk -to "emu:emu|coco3fpga:coco3|CLK_57" -section_id auto_signaltap_0 -set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_RAM_BLOCK_TYPE=AUTO" -section_id auto_signaltap_0 -set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_NODE_INFO=805334528" -section_id auto_signaltap_0 -set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_POWER_UP_TRIGGER=0" -section_id auto_signaltap_0 -set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_STORAGE_QUALIFIER_INVERSION_MASK_LENGTH=0" -section_id auto_signaltap_0 -set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_SEGMENT_SIZE=16384" -section_id auto_signaltap_0 -set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_ATTRIBUTE_MEM_MODE=OFF" -section_id auto_signaltap_0 -set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_STATE_FLOW_USE_GENERATED=0" -section_id auto_signaltap_0 -set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_STATE_BITS=11" -section_id auto_signaltap_0 -set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_BUFFER_FULL_STOP=1" -section_id auto_signaltap_0 -set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_CURRENT_RESOURCE_WIDTH=1" -section_id auto_signaltap_0 -set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_INCREMENTAL_ROUTING=1" -section_id auto_signaltap_0 -set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[0] -to auto_signaltap_0|vcc -section_id auto_signaltap_0 -set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[1] -to auto_signaltap_0|gnd -section_id auto_signaltap_0 -set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[3] -to auto_signaltap_0|vcc -section_id auto_signaltap_0 -set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[4] -to auto_signaltap_0|vcc -section_id auto_signaltap_0 -set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[5] -to auto_signaltap_0|gnd -section_id auto_signaltap_0 -set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[8] -to auto_signaltap_0|vcc -section_id auto_signaltap_0 -set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[11] -to auto_signaltap_0|gnd -section_id auto_signaltap_0 -set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[12] -to auto_signaltap_0|gnd -section_id auto_signaltap_0 -set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[13] -to auto_signaltap_0|gnd -section_id auto_signaltap_0 -set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[15] -to auto_signaltap_0|vcc -section_id auto_signaltap_0 -set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[17] -to auto_signaltap_0|vcc -section_id auto_signaltap_0 -set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[20] -to auto_signaltap_0|vcc -section_id auto_signaltap_0 -set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[21] -to auto_signaltap_0|vcc -section_id auto_signaltap_0 -set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[29] -to auto_signaltap_0|vcc -section_id auto_signaltap_0 -set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[30] -to auto_signaltap_0|gnd -section_id auto_signaltap_0 -set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[31] -to auto_signaltap_0|vcc -section_id auto_signaltap_0 -set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_TRIGGER_LEVEL=1" -section_id auto_signaltap_0 -set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_SAMPLE_DEPTH=16384" -section_id auto_signaltap_0 -set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_TRIGGER_IN_ENABLED=0" -section_id auto_signaltap_0 -set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_TRIGGER_PIPELINE=0" -section_id auto_signaltap_0 -set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_RAM_PIPELINE=0" -section_id auto_signaltap_0 -set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_COUNTER_PIPELINE=0" -section_id auto_signaltap_0 -set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_ADVANCED_TRIGGER_ENTITY=basic,1," -section_id auto_signaltap_0 -set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_TRIGGER_LEVEL_PIPELINE=1" -section_id auto_signaltap_0 -set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_ENABLE_ADVANCED_TRIGGER=0" -section_id auto_signaltap_0 -set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[19] -to auto_signaltap_0|vcc -section_id auto_signaltap_0 -set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[22] -to auto_signaltap_0|gnd -section_id auto_signaltap_0 -set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[23] -to auto_signaltap_0|gnd -section_id auto_signaltap_0 -set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[2] -to auto_signaltap_0|vcc -section_id auto_signaltap_0 -set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[9] -to auto_signaltap_0|gnd -section_id auto_signaltap_0 -set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[10] -to auto_signaltap_0|gnd -section_id auto_signaltap_0 -set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[14] -to auto_signaltap_0|gnd -section_id auto_signaltap_0 -set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[18] -to auto_signaltap_0|gnd -section_id auto_signaltap_0 -set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[24] -to auto_signaltap_0|vcc -section_id auto_signaltap_0 -set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[26] -to auto_signaltap_0|gnd -section_id auto_signaltap_0 -set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[28] -to auto_signaltap_0|vcc -section_id auto_signaltap_0 set_global_assignment -name SIGNALTAP_FILE Vsync.stp -set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[0] -to "emu:emu|coco3fpga:coco3|COCO3VIDEO:MISTER_COCOVID|LINE[0]" -section_id auto_signaltap_0 -set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[1] -to "emu:emu|coco3fpga:coco3|COCO3VIDEO:MISTER_COCOVID|LINE[1]" -section_id auto_signaltap_0 -set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[2] -to "emu:emu|coco3fpga:coco3|COCO3VIDEO:MISTER_COCOVID|LINE[2]" -section_id auto_signaltap_0 -set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[3] -to "emu:emu|coco3fpga:coco3|COCO3VIDEO:MISTER_COCOVID|LINE[3]" -section_id auto_signaltap_0 -set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[4] -to "emu:emu|coco3fpga:coco3|COCO3VIDEO:MISTER_COCOVID|LINE[4]" -section_id auto_signaltap_0 -set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[5] -to "emu:emu|coco3fpga:coco3|COCO3VIDEO:MISTER_COCOVID|LINE[5]" -section_id auto_signaltap_0 -set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[6] -to "emu:emu|coco3fpga:coco3|COCO3VIDEO:MISTER_COCOVID|LINE[6]" -section_id auto_signaltap_0 -set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[7] -to "emu:emu|coco3fpga:coco3|COCO3VIDEO:MISTER_COCOVID|LINE[7]" -section_id auto_signaltap_0 -set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[8] -to "emu:emu|coco3fpga:coco3|COCO3VIDEO:MISTER_COCOVID|LINE[8]" -section_id auto_signaltap_0 -set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[9] -to "emu:emu|coco3fpga:coco3|COCO3VIDEO:MISTER_COCOVID|LINE[9]" -section_id auto_signaltap_0 -set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[10] -to "emu:emu|coco3fpga:coco3|COCO3VIDEO:MISTER_COCOVID|VSYNC_FLAG" -section_id auto_signaltap_0 -set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[11] -to "emu:emu|coco3fpga:coco3|COCO3VIDEO:MISTER_COCOVID|VSYNC_N" -section_id auto_signaltap_0 -set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[0] -to "emu:emu|coco3fpga:coco3|COCO3VIDEO:MISTER_COCOVID|LINE[0]" -section_id auto_signaltap_0 -set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[1] -to "emu:emu|coco3fpga:coco3|COCO3VIDEO:MISTER_COCOVID|LINE[1]" -section_id auto_signaltap_0 -set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[2] -to "emu:emu|coco3fpga:coco3|COCO3VIDEO:MISTER_COCOVID|LINE[2]" -section_id auto_signaltap_0 -set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[3] -to "emu:emu|coco3fpga:coco3|COCO3VIDEO:MISTER_COCOVID|LINE[3]" -section_id auto_signaltap_0 -set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[4] -to "emu:emu|coco3fpga:coco3|COCO3VIDEO:MISTER_COCOVID|LINE[4]" -section_id auto_signaltap_0 -set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[5] -to "emu:emu|coco3fpga:coco3|COCO3VIDEO:MISTER_COCOVID|LINE[5]" -section_id auto_signaltap_0 -set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[6] -to "emu:emu|coco3fpga:coco3|COCO3VIDEO:MISTER_COCOVID|LINE[6]" -section_id auto_signaltap_0 -set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[7] -to "emu:emu|coco3fpga:coco3|COCO3VIDEO:MISTER_COCOVID|LINE[7]" -section_id auto_signaltap_0 -set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[8] -to "emu:emu|coco3fpga:coco3|COCO3VIDEO:MISTER_COCOVID|LINE[8]" -section_id auto_signaltap_0 -set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[9] -to "emu:emu|coco3fpga:coco3|COCO3VIDEO:MISTER_COCOVID|LINE[9]" -section_id auto_signaltap_0 -set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[10] -to "emu:emu|coco3fpga:coco3|COCO3VIDEO:MISTER_COCOVID|VSYNC_FLAG" -section_id auto_signaltap_0 -set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[11] -to "emu:emu|coco3fpga:coco3|COCO3VIDEO:MISTER_COCOVID|VSYNC_N" -section_id auto_signaltap_0 -set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[6] -to auto_signaltap_0|vcc -section_id auto_signaltap_0 -set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[16] -to auto_signaltap_0|vcc -section_id auto_signaltap_0 -set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[25] -to auto_signaltap_0|gnd -section_id auto_signaltap_0 -set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[12] -to "emu:emu|coco3fpga:coco3|RST_FF02_N" -section_id auto_signaltap_0 -set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[13] -to "emu:emu|coco3fpga:coco3|VSYNC1_IRQ_N" -section_id auto_signaltap_0 -set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[14] -to "emu:emu|coco3fpga:coco3|VSYNC1_IRQ_STAT_N" -section_id auto_signaltap_0 -set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[12] -to "emu:emu|coco3fpga:coco3|RST_FF02_N" -section_id auto_signaltap_0 -set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[13] -to "emu:emu|coco3fpga:coco3|VSYNC1_IRQ_N" -section_id auto_signaltap_0 -set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[14] -to "emu:emu|coco3fpga:coco3|VSYNC1_IRQ_STAT_N" -section_id auto_signaltap_0 -set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_DATA_BITS=15" -section_id auto_signaltap_0 -set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_TRIGGER_BITS=15" -section_id auto_signaltap_0 -set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_STORAGE_QUALIFIER_BITS=15" -section_id auto_signaltap_0 -set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_INVERSION_MASK=0000000000000000000000000000000000000000000000000000000000000000000000000" -section_id auto_signaltap_0 -set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_INVERSION_MASK_LENGTH=73" -section_id auto_signaltap_0 -set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[7] -to auto_signaltap_0|gnd -section_id auto_signaltap_0 -set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[27] -to auto_signaltap_0|gnd -section_id auto_signaltap_0 -set_global_assignment -name SLD_FILE db/Vsync_auto_stripped.stp +set_global_assignment -name SIGNALTAP_FILE HD2.stp +set_global_assignment -name SLD_FILE db/HD2_auto_stripped.stp set_instance_assignment -name PARTITION_HIERARCHY root_partition -to | -section_id Top \ No newline at end of file diff --git a/CoCo3.sv b/CoCo3.sv index acf7ab5..0aa8243 100644 --- a/CoCo3.sv +++ b/CoCo3.sv @@ -201,6 +201,8 @@ localparam CONF_STR = { "H2-;", "H2F1,CCC,Load Cartridge;", "H1-;", +// "H1S4,DSKVHD,Load SDC Drive 0;", +// "H1S5,DSKVHD,Load SDC Drive 1;", "H1S4,DSKVHD,Load SDC Drive 0;", "H1S5,DSKVHD,Load SDC Drive 1;", "H1-;", @@ -219,7 +221,7 @@ localparam CONF_STR = { "P1-;", "P1-, -= Video Settings =-;", "P1-;", - "P1O89,Aspect ratio,Original,Full Screen,[ARC1],[ARC2];", + "P1O89,Aspect ratio,Original,Full Screen,Wide,[ARC1];", "P1O35,Scandoubler Fx,None,HQ2x,CRT 25%,CRT 50%,CRT 75%;", "P1OL,Artifact Color,Off - SG4,On - SG6;", "P1OI,Artifact Color Set,0,1;", @@ -246,6 +248,7 @@ localparam CONF_STR = { "R0,Reset;", "J,Button1,Button2;", "jn,A,B;", + "v,51;", "V,v",`BUILD_DATE }; @@ -287,7 +290,7 @@ pll pll /////////////////////////////////////////////////// wire [63:0] status; -wire [63:0] status_in; +wire [63:0] status_in = 63'd0; wire status_set; wire [1:0] buttons; @@ -375,7 +378,7 @@ wire img_readonly; wire [63:0] img_size; wire [31:0] sd_lba[6]; -wire [3:0] sd_blk_cnt[6]; +wire [5:0] sd_blk_cnt[6]; wire [5:0] sd_rd; wire [5:0] sd_wr; diff --git a/HD2.stp b/HD2.stp new file mode 100644 index 0000000..4839956 --- /dev/null +++ b/HD2.stp @@ -0,0 +1,448 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 'emu:emu|coco3fpga:coco3|sdc_top:coco_sdc_top|ext_response' == rising edge + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 11111111111111111111111111111111111111111111111111111111111111 + 11111111111111111111111111111111111111111111111111111111111111 + + + + + + + + + + + + + + + + + + + 00110101110101010100000100000000000001101011101010101000001000000000000011010111010101010000010000000000000110101110101010100000100000000000001101011101010101000001000000000000011010111010101010000010000000000000110101110101010100000100000000000001101011101010101000001000000000000011010111010101010000010000000000000110101110101010100000100000000000001101011101010101000001000000000000011010111010101010000010000000000000110101110101010100000100000000000001101011101010101000001000000000000011010111010101010000010000000000000110101110101010100000100000000000001101011101010101000001000000000000011010111010101010000010000000000000110101110101010100000100000000000001101011101010101000001000000000000011010111010101010000010000000000000110101110101010100000100000000000001101011101010101000001000000000000011010111010101010000010000000000000110101110101010100000100000000000001101011101010101000001000000000000011010111010101010000010000000000000110101110101010100000100000000000001101011101010101000001000000000000011010110110110010000010000000000001110101110101010100000100000000000011101011101010101000001000000000000111010111010101010000010000000000001110101110101010100000100000000000011101011101010101000001000000000000111010111010101010000010000000000001110101110101010100000100000000000011101011101010101000001000000000000111010111010101010000010000000000001110101110101010100000100000000000011101011101010101000001000000000000111010111010101010000010000000000001110101110101010100000100000000000011101011101010101000001000000000000111010111010101010000010000000000001110101110101010100000100000000000011101011101010101000001000000000000111010111010101010000010000000000001110101110101010100000100000000000011101011101010101000001000000000000111010111010101010000010000000000001110101110101010100000100000000000011101011101010101000001000000000000111010111010101010000010000000000001110101110101010100000100000000000011101011101010101000001000000000000111010111010110010000010000000000001111111110001000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001000000100000000010000000110000100110000001000000000100000001100001001100000010000000001000000011000010011000000100000000010000000110000100110000001000000000100000001100001001100000010000000001000000011000010011000000100000000010000000110000100110000001000000000100000001100001001100000010000000001000000011000010011000000100000000010000000110000100110000001000000000100000001100001001100000010000000001000000011000010011000000100000000010000000110000100110000001000000000100000001100001001100000010000000001000000011000010011000000100000000010000000110000100110000001000000000100000001100001001100000010000000001000000011000010011000000100000000010000000110000100110000001000000000100000001100001001100000010000000001000000011000010011000000100000000010000000110000100110000001000000000100000001100001001100000010000000001000000011000010011000000100000000010000000110000100110000001000000000100000001100001001100000010000000001000000011000010011000000100000000010000000110000100110000001000000000100000001100001001100000010000000001000000011000010011000000100000000010000000110000100110000001000000000100000001100001001111101011101010101000001000000000000111010111010101010000010000000000001110101110101010100000100000000000011101011101010101000001000000000000111010111010101010000010000000000001110101110101010100000100000000000011101011101010101000001000000000000111010111010101010000010000000000001110101110101010100000100000000000011101011101010101000001000000000000111010111010101010000010000000000001110101110101010100000100000000000011101011101010101000001000000000000111010111010101010000010000000000001110101110101010100000100000000000011101011101010101000001000000000000111010111010101010000010000000000001110101110101010100000100000000000011101011101010101000001000000000000111010111010101010000010000000000001110101110101010100000100000000000011101011101010101000001000000000000111010111010101010000010000000000001110101110101010100000100000000000011101011101010101000001000000000000111010111010101010000010000000000001110101110101010100000100000000000011101011101010101000001000000000000111010111010101010000010000000000001110101110101010100000100000000000011101011101010101000001000000000000111010111010110010000010000000000000001101110101010100000100000000000000011011101010101000001000000000000000110111010101010000010000000000000001101110101010100000100000000000000011011101010101000001000000000000000110111010101010000010000000000000001101110101010100000100000000000000011011101010101000001000000000000000110111010101010000010000000000000001101110101010100000100000000000000011011101010101000001000000000000000110111010101010000010000000000000001101110101010100000100000000000000011011101010101000001000000000000000110111010101010000010000000000000001101110101010100000100000000000000011011101010101000001000000000000000110111010101010000010000000000000001101110101010100000100000000000000011011101010101000001000000000000000110111010101010000010000000000000001101110101010100000100000000000000011011101010101000001000000000000000110111010101010000010000000000000001101110101010100000100000000000000011011101010101000001000000000000000110111010101010000010000000000000001101110101010100000100000000000000011011101010101000001000000000000000110111010101010000010000000000000001101110101010100000100000000000000011011101010101000001000000000000000110111010101010000010000000000000001101110101010100000100000000000000011011101010101000001000000000000000110111010101010000010000000000000001101101000000100000100000000000011111111011100011000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011001010110101010100000100000000000010010101101010101000001000000000000100101011010101010000010000000000001001010110101010100000100000000000010010101101010101000001000000000000100101011010101010000010000000000001001010110101010100000100000000000010010101101010101000001000000000000100101011010101010000010000000000001001010110101010100000100000000000010010101101010101000001000000000000100101011010101010000010000000000001001010110101010100000100000000000010010101101010101000001000000000000100101011010101010000010000000000001001010110101010100000100000000000010010101101010101000001000000000000100101011010101010000010000000000001001010110101010100000100000000000010010101101010101000001000000000000100101011010101010000010000000000001001010110101010100000100000000000010010101101010101000001000000000000100101011010101010000010000000000001001010110101010100000100000000000010010101101010101000001000000000000100101011010101010000010000000000001001010110101010100000100000000000010010101101010101000001000000000000100101011010101010000010000000000001001010110101010100000100000000000010010101101010101000001000000000000100101011010101010000010000000000001001010110101010100000100000000000010010101101010101000001000000000000100101011010101010000010000000000001001010100000011100000100000000000001010101101010101000001000000000000010101011010101010000010000000000000101010110101010100000100000000000001010101101010101000001000000000000010101011010101010000010000000000000101010110101010100000100000000000001010101101010101000001000000000000010101011010101010000010000000000000101010110101010100000100000000000001010101101010101000001000000000000010101011010101010000010000000000000101010110101010100000100000000000001010101101010101000001000000000000010101011010101010000010000000000000101010110101010100000100000000000001010101101010101000001000000000000010101011010101010000010000000000000101010110101010100000100000000000001010101101010101000001000000000000010101011010101010000010000000000000101010110101010100000100000000000001010101101010101000001000000000000010101011010101010000010000000000000101010110101010100000100000000000001010101101010101000001000000000000010101011010101010000010000000000000101010110101010100000100000000000001010101101010101000001000000000000010101011010101010000010000000000000101010110101010100000100000000000001010101101010101000001000000000000010101011111101110000010000000000001001101110101010100000100000000000010011011101010101000001000000000000100110111010101010000010000000000001001101110101010100000100000000000010011011101010101000001000000000000100110111010101010000010000000000001001101110101010100000100000000000010011011101010101000001000000000000100110111010101010000010000000000001001101110101010100000100000000000010011011101010101000001000000000000100110111010101010000010000000000001001101110101010100000100000000000010011011101010101000001000000000000100110111010101010000010000000000001001101110101010100000100000000000010011011101010101000001000000000000100110111010101010000010000000000001001101110101010100000100000000000010011011101010101000001000000000000100110111010101010000010000000000001001101110101010100000100000000000010011011101010101000001000000000000100110111010101010000010000000000001001101110101010100000100000000000010011011101010101000001000000000000100110111010101010000010000000000001001101110101010100000100000000000010011011101010101000001000000000000100110111010101010000010000000000001001101110101010100000100000000000010011011111001111000001000000000000010110111010101010000010000000000000101101110101010100000100000000000001011011101010101000001000000000000010110111010101010000010000000000000101101110101010100000100000000000001011011101010101000001000000000000010110111010101010000010000000000000101101110101010100000100000000000001011011101010101000001000000000000010110111010101010000010000000000000101101110101010100000100000000000001011011101010101000001000000000000010110111010101010000010000000000000101101110101010100000100000000000001011011101010101000001000000000000010110111010101010000010000000000000101101110101010100000100000000000001011011101010101000001000000000000010110111010101010000010000000000000101101110101010100000100000000000001011011101010101000001000000000000010110111010101010000010000000000000101101110101010100000100000000000001011011101010101000001000000000000010110111010101010000010000000000000101101110101010100000100000000000001011011101010101000001000000000000010110111010101010000010000000000000101101110101010100000100000000000001011011101010101000001000000000000010110111010101010000010000000000000101101111111100100000100000000000011011011101010101000001000000000000110110111010101010000010000000000001101101110101010100000100000000000011011011101010101000001000000000000110110111010101010000010000000000001101101110101010100000100000000000011011011101010101000001000000000000110110111010101010000010000000000001101101110101010100000100000000000011011011101010101000001000000000000110110111010101010000010000000000001101101110101010100000100000000000011011011101010101000001000000000000110110111010101010000010000000000001101101110101010100000100000000000011011011101010101000001000000000000110110111010101010000010000000000001101101110101010100000100000000000011011011101010101000001000000000000110110111010101010000010000000000001101101110101010100000100000000000011011011101010101000001000000000000110110111010101010000010000000000001101101110101010100000100000000000011011011101010101000001000000000000110110111010101010000010000000000001101101111110101100000100000000000011111111101111011000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011001001011100000100000001000101001110010010111000001000000010001010011100100101110000010000000100010100111001001011100000100000001000101001110010010111000001000000010001010011100100101110000010000000100010100111001001011100000100000001000101001110010010111000001000000010001010011100100101110000010000000100010100111001001011100000100000001000101001110010010111000001000000010001010011100100101110000010000000100010100111001001011100000100000001000101001110010010111000001000000010001010011100100101110000010000000100010100111001001011100000100000001000101001110010010111000001000000010001010011100100101110000010000000100010100111001001011100000100000001000101001110010010111000001000000010001010011100100101110000010000000100010100111001001011100000100000001000101001110010010111000001000000010001010011100100101110000010000000100010100111001001011100000100000001000101001110010010111000001000000010001010011100100101110000010000000100010100111001001011100000100000001000101001110010010111000001000000010001010011100100101110000010000000100010100111001001011100000100000001000101001110010010111000001000000010001010011110110111010101010000010000000000001101101110101010100000100000000000011011011101010101000001000000000000110110111010101010000010000000000001101101110101010100000100000000000011011011101010101000001000000000000110110111010101010000010000000000001101101110101010100000100000000000011011011101010101000001000000000000110110111010101010000010000000000001101101110101010100000100000000000011011011101010101000001000000000000110110111010101010000010000000000001101101110101010100000100000000000011011011101010101000001000000000000110110111010101010000010000000000001101101110101010100000100000000000011011011101010101000001000000000000110110111010101010000010000000000001101101110101010100000100000000000011011011101010101000001000000000000110110111010101010000010000000000001101101110101010100000100000000000011011011101010101000001000000000000110110111010101010000010000000000001101101110101010100000100000000000011011011101010101000001000000000000110110111010101010000010000000000001101101110101010100000100000000000011011011101010101000001000000000000110110111010101010000010000000000001101101111110101100000100000000000000111011101010101000001000000000000001110111010101010000010000000000000011101110101010100000100000000000000111011101010101000001000000000000001110111010101010000010000000000000011101110101010100000100000000000000111011101010101000001000000000000001110111010101010000010000000000000011101110101010100000100000000000000111011101010101000001000000000000001110111010101010000010000000000000011101110101010100000100000000000000111011101010101000001000000000000001110111010101010000010000000000000011101110101010100000100000000000000111011101010101000001000000000000001110111010101010000010000000000000011101110101010100000100000000000000111011101010101000001000000000000001110111010101010000010000000000000011101110101010100000100000000000000111011101010101000001000000000000001110111010101010000010000000000000011101110101010100000100000000000000111011101010101000001000000000000001110111010101010000010000000000000011101110101010100000100000000000000111011101010101000001000000000000001110111010101010000010000000000000011101110101010100000100000000000000111011101010101000001000000000000001110111010101010000010000000000000011101110101010100000100000000000000111011101010101000001000000000000001110111010101010000010000000000000011101110101010100000100000000000000111011001001011000001000000000000101110111010101010000010000000000001011101110101010100000100000000000010111011101010101000001000000000000101110111010101010000010000000000001011101110101010100000100000000000010111011101010101000001000000000000101110111010101010000010000000000001011101110101010100000100000000000010111011101010101000001000000000000101110111010101010000010000000000001011101110101010100000100000000000010111011101010101000001000000000000101110111010101010000010000000000001011101110101010100000100000000000010111011101010101000001000000000000101110111010101010000010000000000001011101110101010100000100000000000010111011101010101000001000000000000101110111010101010000010000000000001011101110101010100000100000000000010111011101010101000001000000000000101110111010101010000010000000000001011101110101010100000100000000000010111011101010101000001000000000000101110111010101010000010000000000001011101110101010100000100000000000010111011111010001000001000000000000010100101000100010000000000010100110101001010001000100000000000101001101010010100010001000000000001010011010100101000100010000000000010100110101001010001000100000000000101001101010010100010001000000000001010011010100101000100010000000000010100110101001010001000100000000000101001101010010100010001000000000001010011010100101000100010000000000010100110101001010001000100000000000101001101010010100010001000000000001010011010100101000100010000000000010100110101001010001000100000000000101001101010010100010001000000000001010011010100101000100010000000000010100110101001010001000100000000000101001101010010100010001000000000001010011010100101000100010000000000010100110101001010001000100000000000101001101010010100010001000000000001010011010100101000100010000000000010100110101001010001000100000000000101001101010010100010001000000000001010011010100101000100010000000000010100110101001010001000100000000000101001101010010100010001000000000001010011010100101000100010000000000010100110101001010001000100000000000101001101010010100010001000000000001010011010100101000100010000000000010100110101001010001000100000000000101001111010010000010101000000000011101011110100100000101010000000000111010111101001000001010100000000001110101111010010000010101000000000011101011110100100000101010000000000111010111101001000001010100000000001110101111010010000010101000000000011101011110100100000101010000000000111010111101001000001010100000000001110101111010010000010101000000000011101011110100100000101010000000000111010111101001000001010100000000001110101111010010000010101000000000011101011110100100000101010000000000111010111101001000001010100000000001110101111010010000010101000000000011101011110100100000101010000000000111010111101001000001010100000000001110101111010010000010101000000000011101011110100100000101010000000000111010111101001000001010100000000001110101111010010000010101000000000011101011110100100000101010000000000111010111101001000001010100000000001110101111010010000010101000000000011101011110100100000101010000000000111010111101001000001010100000000001110101111010010000010101000000000011101011110100100000101010000000000111010111101001000001010100000000001110101111010010000010101000000000011101011110100100000101010000000000111010111011101110101010100000100000000000010111011101010101000001000000000000101110111010101010000010000000000001011101110101010100000100000000000010111011101010101000001000000000000101110111010101010000010000000000001011101110101010100000100000000000010111011101010101000001000000000000101110111010101010000010000000000001011101110101010100000100000000000010111011101010101000001000000000000101110111010101010000010000000000001011101110101010100000100000000000010111011101010101000001000000000000101110111010101010000010000000000001011101110101010100000100000000000010111011101010101000001000000000000101110111010101010000010000000000001011101110101010100000100000000000010111011101010101000001000000000000101110111010101010000010000000000001011101110101010100000100000000000010111011101010101000001000000000000101110111010101010000010000000000001011101110101010100000100000000000010111011101010101000001000000000000101110111010101010000010000000000001011101110101010100000100000000000010111011101010101000001000000000000101110111010101010000010000000000001011101110101010100000100000000000010111011111010001000001000000000000011110111010101010000010000000000000111101110101010100000100000000000001111011101010101000001000000000000011110111010101010000010000000000000111101110101010100000100000000000001111011101010101000001000000000000011110111010101010000010000000000000111101110101010100000100000000000001111011101010101000001000000000000011110111010101010000010000000000000111101110101010100000100000000000001111011101010101000001000000000000011110111010101010000010000000000000111101110101010100000100000000000001111011101010101000001000000000000011110111010101010000010000000000000111101110101010100000100000000000001111011101010101000001000000000000011110111010101010000010000000000000111101110101010100000100000000000001111011101010101000001000000000000011110111010101010000010000000000000111101110101010100000100000000000001111011101010101000001000000000000011110111010101010000010000000000000111101110101010100000100000000000001111011101010101000001000000000000011110111010101010000010000000000000111101110101010100000100000000000001111011101010101000001000000000000011110111010101010000010000000000000111101110101010100000100000000000001111011101010101000001000000000000011110111010101010000010000000000000111101110101010100000100000000000001111011101010101000001000000000000011110110000000010000010000000000001111101110101010100000100000000000011111011101010101000001000000000000111110111010101010000010000000000001111101110101010100000100000000000011111011101010101000001000000000000111110111010101010000010000000000001111101110101010100000100000000000011111011101010101000001000000000000111110111010101010000010000000000001111101110101010100000100000000000011111011101010101000001000000000000111110111010101010000010000000000001111101110101010100000100000000000011111011101010101000001000000000000111110111010101010000010000000000001111101110101010100000100000000000011111011101010101000001000000000000111110111010101010000010000000000001111101110101010100000100000000000011111011101010101000001000000000000111110111010101010000010000000000001111101110101010100000100000000000011111011101010101000001000000000000111110111010101010000010000000000001111101110101010100000100000000000011111011101010101000001000000000000111110111111000110000010000000000001111111111100010100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111110110101010101000001000000000000111101101010101010000010000000000001111011010101010100000100000000000011110110101010101000001000000000000111101101010101010000010000000000001111011010101010100000100000000000011110110101010101000001000000000000111101101010101010000010000000000001111011010101010100000100000000000011110110101010101000001000000000000111101101010101010000010000000000001111011010101010100000100000000000011110110101010101000001000000000000111101101010101010000010000000000001111011010101010100000100000000000011110110101010101000001000000000000111101101010101010000010000000000001111011010101010100000100000000000011110110101010101000001000000000000111101101010101010000010000000000001111011010101010100000100000000000011110110101010101000001000000000000111101101010101010000010000000000001111011010101010100000100000000000011110110101010101000001000000000000111101101010101010000010000000000001111011010101010100000100000000000011110110101010101000001000000000000111101101010101010000010000000000001111011010101010100000100000000000011110110101010101000001000000000000111101101010101010000010000000000001111011010101010100000100000000000011110110101010101000001000000000000111101101010101010000010000000000001111011010101010100000100000000000011110110101010101000001000000000000111101101010101010000010000000000001111011001110001100000100000000000011111111101000001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001100101011010101010000000000001110001001010110101010100000000000011100010010101101010101000000000000111000100101011010101010000000000001110001001010110101010100000000000011100010010101101010101000000000000111000100101011010101010000000000001110001001010110101010100000000000011100010010101101010101000000000000111000100101011010101010000000000001110001001010110101010100000000000011100010010101101010101000000000000111000100101011010101010000000000001110001001010110101010100000000000011100010010101101010101000000000000111000100101011010101010000000000001110001001010110101010100000000000011100010010101101010101000000000000111000100101011010101010000000000001110001001010110101010100000000000011100010010101101010101000000000000111000100101011010101010000000000001110001001010110101010100000000000011100010010101101010101000000000000111000100101011010101010000000000001110001001010110101010100000000000011100010010101101010101000000000000111000100101011010101010000000000001110001001010110101010100000000000011100010010101101010101000000000000111000100101011010101010000000000001110001001010110101010100000000000011100010010101101010101000000000000111000100101011010101010000000000001110001001010110000000100000000000011100000010101101010101000000010001001000000101011010101010000000100010010000001010110101010100000001000100100000010101101010101000000010001001000000101011010101010000000100010010000001010110101010100000001000100100000010101101010101000000010001001000000101011010101010000000100010010000001010110101010100000001000100100000010101101010101000000010001001000000101011010101010000000100010010000001010110101010100000001000100100000010101101010101000000010001001000000101011010101010000000100010010000001010110101010100000001000100100000010101101010101000000010001001000000101011010101010000000100010010000001010110101010100000001000100100000010101101010101000000010001001000000101011010101010000000100010010000001010110101010100000001000100100000010101101010101000000010001001000000101011010101010000000100010010000001010110101010100000001000100100000010101101010101000000010001001000000101011010101010000000100010010000001010110101010100000001000100100000010101101010101000000010001001000000101011010101010000000100010010000001010110101010100000001000100100000010101101010101000000010001001000000101011010101010000000100010010000001010110101010100000001000100100000010101101010101000000010001001000000101010000010010000000100010010001111011010101010100000100000000000011110110101010101000001000000000000111101101010101010000010000000000001111011010101010100000100000000000011110110101010101000001000000000000111101101010101010000010000000000001111011010101010100000100000000000011110110101010101000001000000000000111101101010101010000010000000000001111011010101010100000100000000000011110110101010101000001000000000000111101101010101010000010000000000001111011010101010100000100000000000011110110101010101000001000000000000111101101010101010000010000000000001111011010101010100000100000000000011110110101010101000001000000000000111101101010101010000010000000000001111011010101010100000100000000000011110110101010101000001000000000000111101101010101010000010000000000001111011010101010100000100000000000011110110101010101000001000000000000111101101010101010000010000000000001111011010101010100000100000000000011110110101010101000001000000000000111101101010101010000010000000000001111011010101010100000100000000000011110110101010101000001000000000000111101101010101010000010000000000001111011010101010100000100000000000011110110011100011000001000000000000000011101010101010000010000000000000000111010101010100000100000000000000001110101010101000001000000000000000011101010101010000010000000000000000111010101010100000100000000000000001110101010101000001000000000000000011101010101010000010000000000000000111010101010100000100000000000000001110101010101000001000000000000000011101010101010000010000000000000000111010101010100000100000000000000001110101010101000001000000000000000011101010101010000010000000000000000111010101010100000100000000000000001110101010101000001000000000000000011101010101010000010000000000000000111010101010100000100000000000000001110101010101000001000000000000000011101010101010000010000000000000000111010101010100000100000000000000001110101010101000001000000000000000011101010101010000010000000000000000111010101010100000100000000000000001110101010101000001000000000000000011101010101010000010000000000000000111010101010100000100000000000000001110101010101000001000000000000000011101010101010000010000000000000000111010101010100000100000000000000001110101010101000001000000000000000011100000000010000010000000000001000111010101010100000100000000000010001110101010101000001000000000000100011101010101010000010000000000001000111010101010100000100000000000010001110101010101000001000000000000100011101010101010000010000000000001000111010101010100000100000000000010001110101010101000001000000000000100011101010101010000010000000000001000111010101010100000100000000000010001110101010101000001000000000000100011101010101010000010000000000001000111010101010100000100000000000010001110101010101000001000000000000100011101010101010000010000000000001000111010101010100000100000000000010001110101010101000001000000000000100011101010101010000010000000000001000111010101010100000100000000000010001110101010101000001000000000000100011101010101010000010000000000001000111010101010100000100000000000010001110101010101000001000000000000100011101010101010000010000000000001000111010101010100000100000000000010001110101010101000001000000000000100011100000000010000010000000000000100111010101010100000100000000000001001110101010101000001000000000000010011101010101010000010000000000000100111010101010100000100000000000001001110101010101000001000000000000010011101010101010000010000000000000100111010101010100000100000000000001001110101010101000001000000000000010011101010101010000010000000000000100111010101010100000100000000000001001110101010101000001000000000000010011101010101010000010000000000000100111010101010100000100000000000001001110101010101000001000000000000010011101010101010000010000000000000100111010101010100000100000000000001001110101010101000001000000000000010011101010101010000010000000000000100111010101010100000100000000000001001110101010101000001000000000000010011101010101010000010000000000000100111010101010100000100000000000001001110101010101000001000000000000010011101010101010000010000000000000100111010101010100000100000000000001001110101010101000001000000000000010011101010101010000010000000000000100111010101010100000100000000000001001110101010101000001000000000000010011101010101010000010000000000000100111010101010100000100000000000001001110101010101000001000000000000010011101010101010000010000000000000100111010101010100000100000000000001001110101010101000001000000000000010011101010101010000010000000000000100111010101010100000100000000000001001110101010101000001000000000000010011101100101010000010000000000001100111010101010100000100000000000011001110101010101000001000000000000110011101010101010000010000000000001100111010101010100000100000000000011001110101010101000001000000000000110011101010101010000010000000000001100111010101010100000100000000000011001110101010101000001000000000000110011101010101010000010000000000001100111010101010100000100000000000011001110101010101000001000000000000110011101010101010000010000000000001100111010101010100000100000000000011001110101010101000001000000000000110011101010101010000010000000000001100111010101010100000100000000000011001110101010101000001000000000000110011101010101010000010000000000001100111010101010100000100000000000011001110101010101000001000000000000110011101010101010000010000000000001100111010101010100000100000000000011001110101010101000001000000000000110011101010101010000010000000000001100111001100111100000100000000000011001110101010101000001000000000000110011101010101010000010000000000001100111010101010100000100000000000011001110101010101000001000000000000110011101010101010000010000000000001100111010101010100000100000000000011001110101010101000001000000000000110011101010101010000010000000000001100111010101010100000100000000000011001110101010101000001000000000000110011101010101010000010000000000001100111010101010100000100000000000011001110101010101000001000000000000110011101010101010000010000000000001100111010101010100000100000000000011001110101010101000001000000000000110011101010101010000010000000000001100111010101010100000100000000000011001110101010101000001000000000000110011101010101010000010000000000001100111010101010100000100000000000011001110101010101000001000000000000110011101010101010000010000000000001100111010101010100000100000000000011001110101010101000001000000000000110011101010101010000010000000000001100111010101010100000100000000000011001110101010101000001000000000000110011101010101010000010000000000001100111010101010100000100000000000011001110101010101000001000000000000110011100110011110000010000000000000010111010101010100000100000000000000101110101010101000001000000000000001011101010101010000010000000000000010111010101010100000100000000000000101110101010101000001000000000000001011101010101010000010000000000000010111010101010100000100000000000000101110101010101000001000000000000001011101010101010000010000000000000010111010101010100000100000000000000101110101010101000001000000000000001011101010101010000010000000000000010111010101010100000100000000000000101110101010101000001000000000000001011101010101010000010000000000000010111010101010100000100000000000000101110101010101000001000000000000001011101010101010000010000000000000010111010101010100000100000000000000101110101010101000001000000000000001011101010101010000010000000000000010111010101010100000100000000000000101110101010101000001000000000000001011101010101010000010000000000000010111010101010100000100000000000000101110101010101000001000000000000001011101010101010000010000000000000010111010101010100000100000000000000101110101010101000001000000000000001011101010101010000010000000000000010111010101010100000100000000000000101110101010101000001000000000000001011101010101010000010000000000000010111010101010100000100000000000000101110101010101000001000000000000001011101010101010000010000000000000010111001111100100000100000000000010101110101010101000001000000000000101011101010101010000010000000000001010111010101010100000100000000000010101110101010101000001000000000000101011101010101010000010000000000001010111010101010100000100000000000010101110101010101000001000000000000101011101010101010000010000000000001010111010101010100000100000000000010101110101010101000001000000000000101011101010101010000010000000000001010111010101010100000100000000000010101110101010101000001000000000000101011101010101010000010000000000001010111010101010100000100000000000010101110101010101000001000000000000101011101010101010000010000000000001010111010101010100000100000000000010101110101010101000001000000000000101011101010101010000010000000000001010111010101010100000100000000000010101110101010101000001000000000000101011101010101010000010000000000001010111010101010100000100000000000010101110101010101000001000000000000101011101010101010000010000000000001010111011010100100000100000000000011111111000000101000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000010001001000000000100000100000000010100010010000000001000001000000000101000100100000000010000010000000001010001001000000000100000100000000010100010010000000001000001000000000101000100100000000010000010000000001010001001000000000100000100000000010100010010000000001000001000000000101000100100000000010000010000000001010001001000000000100000100000000010100010010000000001000001000000000101000100100000000010000010000000001010001001000000000100000100000000010100010010000000001000001000000000101000100100000000010000010000000001010001001000000000100000100000000010100010010000000001000001000000000101000100100000000010000010000000001010001001000000000100000100000000010100010010000000001000001000000000101000100100000000010000010000000001010001001000000000100000100000000010100010010000000001000001000000000101000100100000000010000010000000001010001001000000000100000100000000010100010010000000001000001000000000101000100100000000010000010000000001010001001000000000100000100000000010100010010000000001000001000000000101000100100000000010000010000000001010001001000000000100000100000000010100010010000000001000001000000000101101011101010101010000010000000000001010111010101010100000100000000000010101110101010101000001000000000000101011101010101010000010000000000001010111010101010100000100000000000010101110101010101000001000000000000101011101010101010000010000000000001010111010101010100000100000000000010101110101010101000001000000000000101011101010101010000010000000000001010111010101010100000100000000000010101110101010101000001000000000000101011101010101010000010000000000001010111010101010100000100000000000010101110101010101000001000000000000101011101010101010000010000000000001010111010101010100000100000000000010101110101010101000001000000000000101011101010101010000010000000000001010111010101010100000100000000000010101110101010101000001000000000000101011101010101010000010000000000001010111010101010100000100000000000010101110101010101000001000000000000101011101010101010000010000000000001010111010101010100000100000000000010101110101010101000001000000000000101011101010101010000010000000000001010111010101010100000100000000000010101110101010101000001000000000000101011101010101010000010000000000001010111011010100100000100000000000001101110101010101000001000000000000011011101010101010000010000000000000110111010101010100000100000000000001101110101010101000001000000000000011011101010101010000010000000000000110111010101010100000100000000000001101110101010101000001000000000000011011101010101010000010000000000000110111010101010100000100000000000001101110101010101000001000000000000011011101010101010000010000000000000110111010101010100000100000000000001101110101010101000001000000000000011011101010101010000010000000000000110111010101010100000100000000000001101110101010101000001000000000000011011101010101010000010000000000000110111010101010100000100000000000001101110101010101000001000000000000011011101010101010000010000000000000110111010101010100000100000000000001101110101010101000001000000000000011011101010101010000010000000000000110111010101010100000100000000000001101110101010101000001000000000000011011101010101010000010000000000000110111010101010100000100000000000001101110101010101000001000000000000011011101010101010000010000000000000110111010101010100000100000000000001101110101010101000001000000000000011011101010101010000010000000000000110111010101010100000100000000000001101110101010101000001000000000000011011101010101010000010000000000000110111010101010100000100000000000001101110110010001000001000000000000111111110110010010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111011101010101010000010000000000001110111010101010100000100000000000011101110101010101000001000000000000111011101010101010000010000000000001110111010101010100000100000000000011101110101010101000001000000000000111011101010101010000010000000000001110111010101010100000100000000000011101110101010101000001000000000000111011101010101010000010000000000001110111010101010100000100000000000011101110101010101000001000000000000111011101010101010000010000000000001110111010101010100000100000000000011101110101010101000001000000000000111011101010101010000010000000000001110111010101010100000100000000000011101110101010101000001000000000000111011101010101010000010000000000001110111010101010100000100000000000011101110101010101000001000000000000111011101010101010000010000000000001110111010101010100000100000000000011101110101010101000001000000000000111011101010101010000010000000000001110111010101010100000100000000000011101110101010101000001000000000000111011101010101010000010000000000001110111010101010100000100000000000011101110101010101000001000000000000111011101010101010000010000000000001110111000101010100000100000000000000011110101010101000001000000000000000111101010101010000010000000000000001111010101010100000100000000000000011110101010101000001000000000000000111101010101010000010000000000000001111010101010100000100000000000000011110101010101000001000000000000000111101010101010000010000000000000001111010101010100000100000000000000011110101010101000001000000000000000111101010101010000010000000000000001111010101010100000100000000000000011110101010101000001000000000000000111101010101010000010000000000000001111010101010100000100000000000000011110101010101000001000000000000000111101010101010000010000000000000001111010101010100000100000000000000011110101010101000001000000000000000111101010101010000010000000000000001111010101010100000100000000000000011110101010101000001000000000000000111101010101010000010000000000000001111010101010100000100000000000000011110101010101000001000000000000000111101010101010000010000000000000001111010101010100000100000000000000011110101010101000001000000000000000111101010101010000010000000000000001111010101010100000100000000000000011110101010101000001000000000000000111101010101010000010000000000000001111010101010100000100000000000000011110101010101000001000000000000000111101010101010000010000000000000001111010101010100000100000000000000011110001001001000001000000000000000111101010101010000010000000000000001111010101010100000100000000000000011110101010101000001000000000000000111101010101010000010000000000000001111010101010100000100000000000000011110101010101000001000000000000000111101010101010000010000000000000001111010101010100000100000000000000011110101010101000001000000000000000111101010101010000010000000000000001111010101010100000100000000000000011110101010101000001000000000000000111101010101010000010000000000000001111010101010100000100000000000000011110101010101000001000000000000000111101010101010000010000000000000001111010101010100000100000000000000011110101010101000001000000000000000111101010101010000010000000000000001111010101010100000100000000000000011110101010101000001000000000000000111101010101010000010000000000000001111010101010100000100000000000000011110101010101000001000000000000000111101010101010000010000000000000001111010101010100000100000000000000011110001001001000001000000000000100111101010101010000010000000000001001111010101010100000100000000000010011110101010101000001000000000000100111101010101010000010000000000001001111010101010100000100000000000010011110101010101000001000000000000100111101010101010000010000000000001001111010101010100000100000000000010011110101010101000001000000000000100111101010101010000010000000000001001111010101010100000100000000000010011110101010101000001000000000000100111101010101010000010000000000001001111010101010100000100000000000010011110101010101000001000000000000100111101010101010000010000000000001001111010101010100000100000000000010011110101010101000001000000000000100111101010101010000010000000000001001111010101010100000100000000000010011110101010101000001000000000000100111101010101010000010000000000001001111010101010100000100000000000010011110101010101000001000000000000100111101010101010000010000000000001001111010101010100000100000000000010011110101010101000001000000000000100111101010101010000010000000000001001111010101010100000100000000000010011110101010101000001000000000000100111101010101010000010000000000001001111001110000100000100000000000011111111111010111000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000010001000110101010100000100000000000000010001101010101000001000000000000000100011010101010000010000000000000001000110101010100000100000000000000010001101010101000001000000000000000100011010101010000010000000000000001000110101010100000100000000000000010001101010101000001000000000000000100011010101010000010000000000000001000110101010100000100000000000000010001101010101000001000000000000000100011010101010000010000000000000001000110101010100000100000000000000010001101010101000001000000000000000100011010101010000010000000000000001000110101010100000100000000000000010001101010101000001000000000000000100011010101010000010000000000000001000110101010100000100000000000000010001101010101000001000000000000000100011010101010000010000000000000001000110101010100000100000000000000010001101010101000001000000000000000100011010101010000010000000000000001000110101010100000100000000000000010001101010101000001000000000000000100011010101010000010000000000000001000110101010100000100000000000000010001101010101000001000000000000000100011010101010000010000000000000001000110101010100000100000000000000010001101010101000001000000000000000100011010101010000010000000000000001000110101010100000100000000000000010001101010101000001000000000000000100011010101010000010000000000000001000111111010100000100000000000010010001101010101000001000000000000100100011010101010000010000000000001001000110101010100000100000000000010010001101010101000001000000000000100100011010101010000010000000000001001000110101010100000100000000000010010001101010101000001000000000000100100011010101010000010000000000001001000110101010100000100000000000010010001101010101000001000000000000100100011010101010000010000000000001001000110101010100000100000000000010010001101010101000001000000000000100100011010101010000010000000000001001000110101010100000100000000000010010001101010101000001000000000000100100011010101010000010000000000001001000110101010100000100000000000010010001101010101000001000000000000100100011010101010000010000000000001001000110101010100000100000000000010010001101010101000001000000000000100100011010101010000010000000000001001000110101010100000100000000000010010001101010101000001000000000000100100011010101010000010000000000001001000110011010100000100000000000010010001101010101000001000000000000100100011010101010000010000000000001001000110101010100000100000000000010010001101010101000001000000000000100100011010101010000010000000000001001000110101010100000100000000000010010001101010101000001000000000000100100011010101010000010000000000001001000110101010100000100000000000010010001101010101000001000000000000100100011010101010000010000000000001001000110101010100000100000000000010010001101010101000001000000000000100100011010101010000010000000000001001000110101010100000100000000000010010001101010101000001000000000000100100011010101010000010000000000001001000110101010100000100000000000010010001101010101000001000000000000100100011010101010000010000000000001001000110101010100000100000000000010010001101010101000001000000000000100100011010101010000010000000000001001000110101010100000100000000000010010001101010101000001000000000000100100011010101010000010000000000001001000110101010100000100000000000010010001101010101000001000000000000100100011010101010000010000000000001001000110101010100000100000000000010010001101010101000001000000000000100100011001101010000010000000000000101000110101010100000100000000000001010001101010101000001000000000000010100011010101010000010000000000000101000110101010100000100000000000001010001101010101000001000000000000010100011010101010000010000000000000101000110101010100000100000000000001010001101010101000001000000000000010100011010101010000010000000000000101000110101010100000100000000000001010001101010101000001000000000000010100011010101010000010000000000000101000110101010100000100000000000001010001101010101000001000000000000010100011010101010000010000000000000101000110101010100000100000000000001010001101010101000001000000000000010100011010101010000010000000000000101000110101010100000100000000000001010001101010101000001000000000000010100011010101010000010000000000000101000110101010100000100000000000001010001101010101000001000000000000010100011010101010000010000000000000101000110101010100000100000000000001010001101010101000001000000000000010100011010101010000010000000000000101000110101010100000100000000000001010001101010101000001000000000000010100011010101010000010000000000000101000110101010100000100000000000001010001101010101000001000000000000010100011010101010000010000000000000101000110101010100000100000000000001010001101010101000001000000000000010100011010101010000010000000000000101000110011100100000100000000000001010001101010101000001000000000000010100011010101010000010000000000000101000110101010100000100000000000001010001101010101000001000000000000010100011010101010000010000000000000101000110101010100000100000000000001010001101010101000001000000000000010100011010101010000010000000000000101000110101010100000100000000000001010001101010101000001000000000000010100011010101010000010000000000000101000110101010100000100000000000001010001101010101000001000000000000010100011010101010000010000000000000101000110101010100000100000000000001010001101010101000001000000000000010100011010101010000010000000000000101000110101010100000100000000000001010001101010101000001000000000000010100011010101010000010000000000000101000110101010100000100000000000001010001101010101000001000000000000010100011010101010000010000000000000101000110101010100000100000000000001010001101010101000001000000000000010100011010101010000010000000000000101000110011100100000100000000000011010001101010101000001000000000000110100011010101010000010000000000001101000110101010100000100000000000011010001101010101000001000000000000110100011010101010000010000000000001101000110101010100000100000000000011010001101010101000001000000000000110100011010101010000010000000000001101000110101010100000100000000000011010001101010101000001000000000000110100011010101010000010000000000001101000110101010100000100000000000011010001101010101000001000000000000110100011010101010000010000000000001101000110101010100000100000000000011010001101010101000001000000000000110100011010101010000010000000000001101000110101010100000100000000000011010001101010101000001000000000000110100011010101010000010000000000001101000110101010100000100000000000011010001101010101000001000000000000110100011010101010000010000000000001101000110101010100000100000000000011010001101010101000001000000000000110100011010101010000010000000000001101000110101010100000100000000000011010001101010101000001000000000000110100011010101010000010000000000001101000110101010100000100000000000011010001101010101000001000000000000110100011011000110000010000000000000001010110101010100000100000000000000010101101010101000001000000000000000101011010101010000010000000000000001010110101010100000100000000000000010101101010101000001000000000000000101011010101010000010000000000000001010110101010100000100000000000000010101101010101000001000000000000000101011010101010000010000000000000001010110101010100000100000000000000010101101010101000001000000000000000101011010101010000010000000000000001010110101010100000100000000000000010101101010101000001000000000000000101011010101010000010000000000000001010110101010100000100000000000000010101101010101000001000000000000000101011010101010000010000000000000001010110101010100000100000000000000010101101010101000001000000000000000101011010101010000010000000000000001010110101010100000100000000000000010101101010101000001000000000000000101011010101010000010000000000000001010110101010100000100000000000000010101101010101000001000000000000000101011010101010000010000000000000001010110101010100000100000000000000010101101010101000001000000000000000101011010101010000010000000000000001010110101010100000100000000000000010101101010101000001000000000000000101011010101010000010000000000000001010110101010100000100000000000000010101101010101000001000000000000000101011010101010000010000000000000001010110001001100000100000000000010010101101010101000001000000000000100101011010101010000010000000000001001010110101010100000100000000000010010101101010101000001000000000000100101011010101010000010000000000001001010110101010100000100000000000010010101101010101000001000000000000100101011010101010000010000000000001001010110101010100000100000000000010010101101010101000001000000000000100101011010101010000010000000000001001010110101010100000100000000000010010101101010101000001000000000000100101011010101010000010000000000001001010110101010100000100000000000010010101101010101000001000000000000100101011010101010000010000000000001001010110101010100000100000000000010010101101010101000001000000000000100101011010101010000010000000000001001010110101010100000100000000000010010101101010101000001000000000000100101011010101010000010000000000001001010110101010100000100000000000010010101101010101000001000000000000100101011010101010000010000000000001001010100000111100000100000000000011111111000000001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000010000011110101010100000100000000000000000111101010101000001000000000000000001111010101010000010000000000000000011110101010100000100000000000000000111101010101000001000000000000000001111010101010000010000000000000000011110101010100000100000000000000000111101010101000001000000000000000001111010101010000010000000000000000011110101010100000100000000000000000111101010101000001000000000000000001111010101010000010000000000000000011110101010100000100000000000000000111101010101000001000000000000000001111010101010000010000000000000000011110101010100000100000000000000000111101010101000001000000000000000001111010101010000010000000000000000011110101010100000100000000000000000111101010101000001000000000000000001111010101010000010000000000000000011110101010100000100000000000000000111101010101000001000000000000000001111010101010000010000000000000000011110101010100000100000000000000000111101010101000001000000000000000001111010101010000010000000000000000011110101010100000100000000000000000111101010101000001000000000000000001111010101010000010000000000000000011110101010100000100000000000000000111101010101000001000000000000000001111010101010000010000000000000000011110101010100000100000000000000000111101010101000001000000000000000001111010101010000010000000000000000011110100100100000100000000000010000111101010101000001000000000000100001111010101010000010000000000001000011110101010100000100000000000010000111101010101000001000000000000100001111010101010000010000000000001000011110101010100000100000000000010000111101010101000001000000000000100001111010101010000010000000000001000011110101010100000100000000000010000111101010101000001000000000000100001111010101010000010000000000001000011110101010100000100000000000010000111101010101000001000000000000100001111010101010000010000000000001000011110101010100000100000000000010000111101010101000001000000000000100001111010101010000010000000000001000011110101010100000100000000000010000111101010101000001000000000000100001111010101010000010000000000001000011110101010100000100000000000010000111101010101000001000000000000100001111010101010000010000000000001000011110101010100000100000000000010000111101010101000001000000000000100001111010101010000010000000000001000011101101110100000100000000000011111111100100001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000010100011110101010100000100000000000001000111101010101000001000000000000010001111010101010000010000000000000100011110101010100000100000000000001000111101010101000001000000000000010001111010101010000010000000000000100011110101010100000100000000000001000111101010101000001000000000000010001111010101010000010000000000000100011110101010100000100000000000001000111101010101000001000000000000010001111010101010000010000000000000100011110101010100000100000000000001000111101010101000001000000000000010001111010101010000010000000000000100011110101010100000100000000000001000111101010101000001000000000000010001111010101010000010000000000000100011110101010100000100000000000001000111101010101000001000000000000010001111010101010000010000000000000100011110101010100000100000000000001000111101010101000001000000000000010001111010101010000010000000000000100011110101010100000100000000000001000111101010101000001000000000000010001111010101010000010000000000000100011110101010100000100000000000001000111101010101000001000000000000010001111010101010000010000000000000100011110101010100000100000000000001000111101010101000001000000000000010001111010101010000010000000000000100011110101010100000100000000000001000111101010101000001000000000000010001111010101010000010000000000000100011111100101100000100000000000011000111101010101000001000000000000110001111010101010000010000000000001100011110101010100000100000000000011000111101010101000001000000000000110001111010101010000010000000000001100011110101010100000100000000000011000111101010101000001000000000000110001111010101010000010000000000001100011110101010100000100000000000011000111101010101000001000000000000110001111010101010000010000000000001100011110101010100000100000000000011000111101010101000001000000000000110001111010101010000010000000000001100011110101010100000100000000000011000111101010101000001000000000000110001111010101010000010000000000001100011110101010100000100000000000011000111101010101000001000000000000110001111010101010000010000000000001100011110101010100000100000000000011000111101010101000001000000000000110001111010101010000010000000000001100011110101010100000100000000000011000111101010101000001000000000000110001111010101010000010000000000001100011101111100100000100000000000000100111101010101000001000000000000001001111010101010000010000000000000010011110101010100000100000000000000100111101010101000001000000000000001001111010101010000010000000000000010011110101010100000100000000000000100111101010101000001000000000000001001111010101010000010000000000000010011110101010100000100000000000000100111101010101000001000000000000001001111010101010000010000000000000010011110101010100000100000000000000100111101010101000001000000000000001001111010101010000010000000000000010011110101010100000100000000000000100111101010101000001000000000000001001111010101010000010000000000000010011110101010100000100000000000000100111101010101000001000000000000001001111010101010000010000000000000010011110101010100000100000000000000100111101010101000001000000000000001001111010101010000010000000000000010011110101010100000100000000000000100111101010101000001000000000000001001111010101010000010000000000000010011110101010100000100000000000000100111101010101000001000000000000001001111010101010000010000000000000010011110101010100000100000000000000100111101010101000001000000000000001001111010101010000010000000000000010011110101010100000100000000000000100111101010101000001000000000000001001111010101010000010000000000000010011110101010100000100000000000000100111101000011000001000000000000111111111011110110000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001111111111101100010000010000000000011111111111011000100000100000000000111111111110110001000001000000000001000100100000000010000000000000110110001001000000000100000000000001101100010010000000001000000000000011011000100100000000010000000000000110110001001000000000100000000000001101100010010000000001000000000000011011000100100000000010000000000000110110001001000000000100000000000001101100010010000000001000000000000011011000100100000000010000000000000110110001001000000000100000000000001101100010010000000001000000000000011011000100100000000010000000000000110110001001000000000100000000000001101100010010000000001000000000000011011000100100000000010000000000000110110001001000000000100000000000001101100010010000000001000000000000011011000100100000000010000000000000110110001001000000000100000000000001101100010010000000001000000000000011011000100100000000010000000000000110110001001000000000100000000000001101100010010000000001000000000000011011000100100000000010000000000000110110001001000000000100000000000001101100010010000000001000000000000011011000100100000000010000000000000110110001001000000000100000000000001101100010010000000001000000000000011011000100100000000010000000000000110110001001000000000100000000000001101100100111101010101000001000000000000001001111010101010000010000000000000010011110101010100000100000000000000100111101010101000001100000000000001001111010101010000011000000000000010011110101010100000110000000000000100111101010101000001100000000000001001111010101010000011000000000000010011110101010100000110000000000000100111101010101000001100000000000001001111010101010000011000000000000010011110101010100000110000000000000100111101010101000001100000000000001001111010101010000011000000000000010011110101010100000110000000000000100111101010101000001100000000000001001111010101010000011000000000000010011110101010100000110000000000000100111101010101000001100000000000001001111010101010000011000000000000010011110101010100000110000000000000100111101010101000001100000000000001001111010101010000011000000000000010011110101010100000110000000000000100111101010101000001100000000000001001111010101010000011000000000000010011110101010100000110000000000000100111101010101000001100000000000001001111010101010000011000000000000010011110101010100000110000000000000100111101010101000001100000000000001001111010000110000011000000000001010011110101010100000110000000000010100111101010101000001100000000000101001111010101010000011000000000001010011110101010100000110000000000010100111101010101000001100000000000101001111010101010000011000000000001010011110101010100000110000000000010100111101010101000001100000000000101001111010101010000011000000000001010011110101010100000110000000000010100111101010101000001100000000000101001111010101010000011000000000001010011110101010100000110000000000010100111101010101000001100000000000101001111010101010000011000000000001010011110101010100000110000000000010100111101010101000001100000000000101001111010101010000011000000000001010011110101010100000110000000000010100111101010101000001100000000000101001111010101010000011000000000001010011110101010100000110000000000010100111101010101000001100000000000101001111010101010000011000000000001010011110101010100000110000000000010100111101010101000001100000000000101001111010101010000011000000000001010011110101010100000110000000000010100111101010101000001100000000000101001111010101010000011000000000001010011110101010100000110000000000010100111000001001000001100000000000011001111010101010000011000000000000110011110101010100000110000000000001100111101010101000001100000000000011001111010101010000011000000000000110011110101010100000110000000000001100111101010101000001100000000000011001111010101010000011000000000000110011110101010100000110000000000001100111101010101000001100000000000011001111010101010000011000000000000110011110101010100000110000000000001100111101010101000001100000000000011001111010101010000011000000000000110011110101010100000110000000000001100111101010101000001100000000000011001111010101010000011000000000000110011110101010100000110000000000001100111101010101000001100000000000011001111010101010000011000000000000110011110101010100000110000000000001100111101010101000001100000000000011001111010101010000011000000000000110011110101010100000110000000000001100111101010101000001100000000000011001111010101010000011000000000000110011110101010100000110000000000001100111101010101000001100000000000011001111010101010000011000000000000110011110101010100000110000000000001100111101010101000001100000000000011001111010101010000011000000000000110011110101010100000110000000000001100111101010101000001100000000000011001111010101010000011000000000000110011110101010100000110000000000001100111101010101000001100000000000011001111110010010000011000000000001110011110101010100000110000000000011100111101010101000001100000000000111001111010101010000011000000000001110011110101010100000110000000000011100111101010101000001100000000000111001111010101010000011000000000001110011110101010100000110000000000011100111101010101000001100000000000111001111010101010000011000000000001110011110101010100000110000000000011100111101010101000001100000000000111001111010101010000011000000000001110011110101010100000110000000000011100111101010101000001100000000000111001111010101010000011000000000001110011110101010100000110000000000011100111101010101000001100000000000111001111010101010000011000000000001110011110101010100000110000000000011100111101010101000001100000000000111001111010101010000011000000000001110011110101010100000110000000000011100111101010101000001100000000000111001111010101010000011000000000001110011110101010100000110000000000011100111101010101000001100000000000111001111001110010000011000000000001111111100110000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001100001001010101010000011000000000001000010010101010100000110000000000010000100101010101000001100000000000100001001010101010000011000000000001000010010101010100000110000000000010000100101010101000001100000000000100001001010101010000011000000000001000010010101010100000110000000000010000100101010101000001100000000000100001001010101010000011000000000001000010010101010100000110000000000010000100101010101000001100000000000100001001010101010000011000000000001000010010101010100000110000000000010000100101010101000001100000000000100001001010101010000011000000000001000010010101010100000110000000000010000100101010101000001100000000000100001001010101010000011000000000001000010010101010100000110000000000010000100101010101000001100000000000100001001010101010000011000000000001000010010101010100000110000000000010000100101010101000001100000000000100001001010101010000011000000000001000010010101010100000110000000000010000100101010101000001100000000000100001001010101010000011000000000001000010010101010100000110000000000010000100101010101000001100000000000100001001010101010000011000000000001000010010101010100000110000000000010000100101010101000001100000000000100001001010101010000011000000000001000010010101010100000110000000000010000100101010101000001100000000000100001001011000110000011000000000000100010010101010100000110000000000001000100101010101000001100000000000010001001010101010000011000000000000100010010101010100000110000000000001000100101010101000001100000000000010001001010101010000011000000000000100010010101010100000110000000000001000100101010101000001100000000000010001001010101010000011000000000000100010010101010100000110000000000001000100101010101000001100000000000010001001010101010000011000000000000100010010101010100000110000000000001000100101010101000001100000000000010001001010101010000011000000000000100010010101010100000110000000000001000100101010101000001100000000000010001001010101010000011000000000000100010010101010100000110000000000001000100101010101000001100000000000010001001010101010000011000000000000100010010101010100000110000000000001000100101010101000001100000000000010001001010101010000011000000000000100010010101010100000110000000000001000100101010101000001100000000000010001001010101010000011000000000000100010010101010100000110000000000001000100101010101000001100000000000010001001010101010000011000000000000100010010101010100000110000000000001000100000100101000001100000000000111111111000000010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001110101101010101010000011000000000001101011010101010100000110000000000011010110101010101000001100000000000110101101010101010000011000000000001101011010101010100000110000000000011010110101010101000001100000000000110101101010101010000011000000000001101011010101010100000110000000000011010110101010101000001100000000000110101101010101010000011000000000001101011010101010100000110000000000011010110101010101000001100000000000110101101010101010000011000000000001101011010101010100000110000000000011010110101010101000001100000000000110101101010101010000011000000000001101011010101010100000110000000000011010110101010101000001100000000000110101101010101010000011000000000001101011010101010100000110000000000011010110101010101000001100000000000110101101010101010000011000000000001101011010101010100000110000000000011010110101010101000001100000000000110101101010101010000011000000000001101011010101010100000110000000000011010110101010101000001100000000000110101101010101010000011000000000001101011010101010100000110000000000011010110101010101000001100000000000110101101010101010000011000000000001101011010101010100000110000000000011010110101010101000001100000000000110101101010101010000011000000000001101011010101010100000110000000000011010110101010101000001100000000000110101101011000110000011000000000001111111111000000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011001010110101010100000011100010000010010101101010101000000111000100000100101011010101010000001110001000001001010110101010100000011100010000010010101101010101000000111000100000100101011010101010000001110001000001001010110101010100000011100010000010010101101010101000000111000100000100101011010101010000001110001000001001010110101010100000011100010000010010101101010101000000111000100000100101011010101010000001110001000001001010110101010100000011100010000010010101101010101000000111000100000100101011010101010000001110001000001001010110101010100000011100010000010010101101010101000000111000100000100101011010101010000001110001000001001010110101010100000011100010000010010101101010101000000111000100000100101011010101010000001110001000001001010110101010100000011100010000010010101101010101000000111000100000100101011010101010000001110001000001001010110101010100000011100010000010010101101010101000000111000100000100101011010101010000001110001000001001010110101010100000011100010000010010101101010101000000111000100000100101011010101010000001110001000001001010110101010100000011100010000010010101101010101000000111000100000100101011010101010000001110001000001001010110101010100000011100010000010010101101011001000000111000100000000101011010101010000001010010010000001010110101010100000010100100100000010101101010101000000101001001000000101011010101010000001010010010000001010110101010100000010100100100000010101101010101000000101001001000000101011010101010000001010010010000001010110101010100000010100100100000010101101010101000000101001001000000101011010101010000001010010010000001010110101010100000010100100100000010101101010101000000101001001000000101011010101010000001010010010000001010110101010100000010100100100000010101101010101000000101001001000000101011010101010000001010010010000001010110101010100000010100100100000010101101010101000000101001001000000101011010101010000001010010010000001010110101010100000010100100100000010101101010101000000101001001000000101011010101010000001010010010000001010110101010100000010100100100000010101101010101000000101001001000000101011010101010000001010010010000001010110101010100000010100100100000010101101010101000000101001001000000101011010101010000001010010010000001010110101010100000010100100100000010101101010101000000101001001000000101011010101010000001010010010000001010111000100100000010100100100011010110101010101000001100000000000110101101010101010000011000000000001101011010101010100000110000000000011010110101010101000001100000000000110101101010101010000011000000000001101011010101010100000110000000000011010110101010101000001100000000000110101101010101010000011000000000001101011010101010100000110000000000011010110101010101000001100000000000110101101010101010000011000000000001101011010101010100000110000000000011010110101010101000001100000000000110101101010101010000011000000000001101011010101010100000110000000000011010110101010101000001100000000000110101101010101010000011000000000001101011010101010100000110000000000011010110101010101000001100000000000110101101010101010000011000000000001101011010101010100000110000000000011010110101010101000001100000000000110101101010101010000011000000000001101011010101010100000110000000000011010110101010101000001100000000000110101101010101010000011000000000001101011010101010100000110000000000011010110101010101000001100000000000110101101010101010000011000000000001101011010101010100000110000000000011010110101010101000001100000000000110101101010101010000011000000000001101011010101010100000110000000000011010110101100011000001100000000000001101101010101010000011000000000000011011010101010100000110000000000000110110101010101000001100000000000001101101010101010000011000000000000011011010101010100000110000000000000110110101010101000001100000000000001101101010101010000011000000000000011011010101010100000110000000000000110110101010101000001100000000000001101101010101010000011000000000000011011010101010100000110000000000000110110101010101000001100000000000001101101010101010000011000000000000011011010101010100000110000000000000110110101010101000001100000000000001101101010101010000011000000000000011011010101010100000110000000000000110110101010101000001100000000000001101101010101010000011000000000000011011010101010100000110000000000000110110101010101000001100000000000001101101010101010000011000000000000011011010101010100000110000000000000110110101010101000001100000000000001101101010101010000011000000000000011011010101010100000110000000000000110110101010101000001100000000000001101101010101010000011000000000000011011010101010100000110000000000000110110101010101000001100000000000001101101010101010000011000000000000011011001000000100000110000000000011111111001001001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111110110101010101000001100000000000111101101010101010000011000000000001111011010101010100000110000000000011110110101010101000001100000000000111101101010101010000011000000000001111011010101010100000110000000000011110110101010101000001100000000000111101101010101010000011000000000001111011010101010100000110000000000011110110101010101000001100000000000111101101010101010000011000000000001111011010101010100000110000000000011110110101010101000001100000000000111101101010101010000011000000000001111011010101010100000110000000000011110110101010101000001100000000000111101101010101010000011000000000001111011010101010100000110000000000011110110101010101000001100000000000111101101010101010000011000000000001111011010101010100000110000000000011110110101010101000001100000000000111101101010101010000011000000000001111011010101010100000110000000000011110110101010101000001100000000000111101101010101010000011000000000001111011010101010100000110000000000011110110101010101000001100000000000111101101010101010000011000000000001111011010101010100000110000000000011110110101010101000001100000000000111101101010101010000011000000000001111011010101010100000110000000000011110110101010101000001100000000000111101101010101010000011000000000001111011010101010100000110000000000011110110011100011000001100000000000111111111010000010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111001011010101010000001101101100001110010110101010100000011011011000011100101101010101000000110110110000111001011010101010000001101101100001110010110101010100000011011011000011100101101010101000000110110110000111001011010101010000001101101100001110010110101010100000011011011000011100101101010101000000110110110000111001011010101010000001101101100001110010110101010100000011011011000011100101101010101000000110110110000111001011010101010000001101101100001110010110101010100000011011011000011100101101010101000000110110110000111001011010101010000001101101100001110010110101010100000011011011000011100101101010101000000110110110000111001011010101010000001101101100001110010110101010100000011011011000011100101101010101000000110110110000111001011010101010000001101101100001110010110101010100000011011011000011100101101010101000000110110110000111001011010101010000001101101100001110010110101010100000011011011000011100101101010101000000110110110000111001011010101010000001101101100001110010110101010100000011011011000011100101101010101000000110110110000111001011010101010000001101101100001110010110101010100000011011011000011100101101010101000000110110110000111001011010101010000001101101100001110010100100100100000011011011000001100101101010101000000101001001000011001011010101010000001010010010000110010110101010100000010100100100001100101101010101000000101001001000011001011010101010000001010010010000110010110101010100000010100100100001100101101010101000000101001001000011001011010101010000001010010010000110010110101010100000010100100100001100101101010101000000101001001000011001011010101010000001010010010000110010110101010100000010100100100001100101101010101000000101001001000011001011010101010000001010010010000110010110101010100000010100100100001100101101010101000000101001001000011001011010101010000001010010010000110010110101010100000010100100100001100101101010101000000101001001000011001011010101010000001010010010000110010110101010100000010100100100001100101101010101000000101001001000011001011010101010000001010010010000110010110101010100000010100100100001100101101010101000000101001001000011001011010101010000001010010010000110010110101010100000010100100100001100101101010101000000101001001000011001011010101010000001010010010000110010110101010100000010100100100001100101101010101000000101001001000011001011011011010000001010010010001111011010101010100000110000000000011110110101010101000001100000000000111101101010101010000011000000000001111011010101010100000110000000000011110110101010101000001100000000000111101101010101010000011000000000001111011010101010100000110000000000011110110101010101000001100000000000111101101010101010000011000000000001111011010101010100000110000000000011110110101010101000001100000000000111101101010101010000011000000000001111011010101010100000110000000000011110110101010101000001100000000000111101101010101010000011000000000001111011010101010100000110000000000011110110101010101000001100000000000111101101010101010000011000000000001111011010101010100000110000000000011110110101010101000001100000000000111101101010101010000011000000000001111011010101010100000110000000000011110110101010101000001100000000000111101101010101010000011000000000001111011010101010100000110000000000011110110101010101000001100000000000111101101010101010000011000000000001111011010101010100000110000000000011110110101010101000001100000000000111101101010101010000011000000000001111011010101010100000110000000000011110110101010101000001100000000000111101101010101010000011000000000001111011001110001100000110000000000000001110101010101000001100000000000000011101010101010000011000000000000000111010101010100000110000000000000001110101010101000001100000000000000011101010101010000011000000000000000111010101010100000110000000000000001110101010101000001100000000000000011101010101010000011000000000000000111010101010100000110000000000000001110101010101000001100000000000000011101010101010000011000000000000000111010101010100000110000000000000001110101010101000001100000000000000011101010101010000011000000000000000111010101010100000110000000000000001110101010101000001100000000000000011101010101010000011000000000000000111010101010100000110000000000000001110101010101000001100000000000000011101010101010000011000000000000000111010101010100000110000000000000001110101010101000001100000000000000011101010101010000011000000000000000111010101010100000110000000000000001110101010101000001100000000000000011101010101010000011000000000000000111010101010100000110000000000000001110101010101000001100000000000000011101010101010000011000000000000000111010101010100000110000000000000001110101010101000001100000000000000011100000000010000011000000000001000111010101010100000110000000000010001110101010101000001100000000000100011101010101010000011000000000001000111010101010100000110000000000010001110101010101000001100000000000100011101010101010000011000000000001000111010101010100000110000000000010001110101010101000001100000000000100011101010101010000011000000000001000111010101010100000110000000000010001110101010101000001100000000000100011101010101010000011000000000001000111010101010100000110000000000010001110101010101000001100000000000100011101010101010000011000000000001000111010101010100000110000000000010001110101010101000001100000000000100011101010101010000011000000000001000111010101010100000110000000000010001110101010101000001100000000000100011101010101010000011000000000001000111010101010100000110000000000010001110101010101000001100000000000100011101010101010000011000000000001000111010101010100000110000000000010001110101010101000001100000000000100011100000000010000011000000000000100111010101010100000110000000000001001110101010101000001100000000000010011101010101010000011000000000000100111010101010100000110000000000001001110101010101000001100000000000010011101010101010000011000000000000100111010101010100000110000000000001001110101010101000001100000000000010011101010101010000011000000000000100111010101010100000110000000000001001110101010101000001100000000000010011101010101010000011000000000000100111010101010100000110000000000001001110101010101000001100000000000010011101010101010000011000000000000100111010101010100000110000000000001001110101010101000001100000000000010011101010101010000011000000000000100111010101010100000110000000000001001110101010101000001100000000000010011101010101010000011000000000000100111010101010100000110000000000001001110101010101000001100000000000010011101010101010000011000000000000100111010101010100000110000000000001001110101010101000001100000000000010011101010101010000011000000000000100111010101010100000110000000000001001110101010101000001100000000000010011101010101010000011000000000000100111010101010100000110000000000001001110101010101000001100000000000010011101010101010000011000000000000100111010101010100000110000000000001001110101010101000001100000000000010011101010101010000011000000000000100111011001010100000110000000000011001110101010101000001100000000000110011101010101010000011000000000001100111010101010100000110000000000011001110101010101000001100000000000110011101010101010000011000000000001100111010101010100000110000000000011001110101010101000001100000000000110011101010101010000011000000000001100111010101010100000110000000000011001110101010101000001100000000000110011101010101010000011000000000001100111010101010100000110000000000011001110101010101000001100000000000110011101010101010000011000000000001100111010101010100000110000000000011001110101010101000001100000000000110011101010101010000011000000000001100111010101010100000110000000000011001110101010101000001100000000000110011101010101010000011000000000001100111010101010100000110000000000011001110101010101000001100000000000110011101010101010000011000000000001100111010101010100000110000000000011001110101010101000001100000000000110011101010101010000011000000000001100111001100111100000110000000000011001110101010101000001100000000000110011101010101010000011000000000001100111010101010100000110000000000011001110101010101000001100000000000110011101010101010000011000000000001100111010101010100000110000000000011001110101010101000001100000000000110011101010101010000011000000000001100111010101010100000110000000000011001110101010101000001100000000000110011101010101010000011000000000001100111010101010100000110000000000011001110101010101000001100000000000110011101010101010000011000000000001100111010101010100000110000000000011001110101010101000001100000000000110011101010101010000011000000000001100111010101010100000110000000000011001110101010101000001100000000000110011101010101010000011000000000001100111010101010100000110000000000011001110101010101000001100000000000110011101010101010000011000000000001100111010101010100000110000000000011001110101010101000001100000000000110011101010101010000011000000000001100111010101010100000110000000000011001110101010101000001100000000000110011101010101010000011000000000001100111010101010100000110000000000011001110101010101000001100000000000110011100110011110000011000000000000010111010101010100000110000000000000101110101010101000001100000000000001011101010101010000011000000000000010111010101010100000110000000000000101110101010101000001100000000000001011101010101010000011000000000000010111010101010100000110000000000000101110101010101000001100000000000001011101010101010000011000000000000010111010101010100000110000000000000101110101010101000001100000000000001011101010101010000011000000000000010111010101010100000110000000000000101110101010101000001100000000000001011101010101010000011000000000000010111010101010100000110000000000000101110101010101000001100000000000001011101010101010000011000000000000010111010101010100000110000000000000101110101010101000001100000000000001011101010101010000011000000000000010111010101010100000110000000000000101110101010101000001100000000000001011101010101010000011000000000000010111010101010100000110000000000000101110101010101000001100000000000001011101010101010000011000000000000010111010101010100000110000000000000101110101010101000001100000000000001011101010101010000011000000000000010111010101010100000110000000000000101110101010101000001100000000000001011101010101010000011000000000000010111010101010100000110000000000000101110101010101000001100000000000001011101010101010000011000000000000010111001111100100000110000000000010101110101010101000001100000000000101011101010101010000011000000000001010111010101010100000110000000000010101110101010101000001100000000000101011101010101010000011000000000001010111010101010100000110000000000010101110101010101000001100000000000101011101010101010000011000000000001010111010101010100000110000000000010101110101010101000001100000000000101011101010101010000011000000000001010111010101010100000110000000000010101110101010101000001100000000000101011101010101010000011000000000001010111010101010100000110000000000010101110101010101000001100000000000101011101010101010000011000000000001010111010101010100000110000000000010101110101010101000001100000000000101011101010101010000011000000000001010111010101010100000110000000000010101110101010101000001100000000000101011101010101010000011000000000001010111010101010100000110000000000010101110101010101000001100000000000101011101010101010000011000000000001010111011010100100000110000000000011111111000000101000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000010001001000000000100000110000000010100010010000000001000001100000000101000100100000000010000011000000001010001001000000000100000110000000010100010010000000001000001100000000101000100100000000010000011000000001010001001000000000100000110000000010100010010000000001000001100000000101000100100000000010000011000000001010001001000000000100000110000000010100010010000000001000001100000000101000100100000000010000011000000001010001001000000000100000110000000010100010010000000001000001100000000101000100100000000010000011000000001010001001000000000100000110000000010100010010000000001000001100000000101000100100000000010000011000000001010001001000000000100000110000000010100010010000000001000001100000000101000100100000000010000011000000001010001001000000000100000110000000010100010010000000001000001100000000101000100100000000010000011000000001010001001000000000100000110000000010100010010000000001000001100000000101000100100000000010000011000000001010001001000000000100000110000000010100010010000000001000001100000000101000100100000000010000011000000001010001001000000000100000110000000010100010010000000001000001100000000101101011101010101010000011000000000001010111010101010100000110000000000010101110101010101000001100000000000101011101010101010000011000000000001010111010101010100000110000000000010101110101010101000001100000000000101011101010101010000011000000000001010111010101010100000110000000000010101110101010101000001100000000000101011101010101010000011000000000001010111010101010100000110000000000010101110101010101000001100000000000101011101010101010000011000000000001010111010101010100000110000000000010101110101010101000001100000000000101011101010101010000011000000000001010111010101010100000110000000000010101110101010101000001100000000000101011101010101010000011000000000001010111010101010100000110000000000010101110101010101000001100000000000101011101010101010000011000000000001010111010101010100000110000000000010101110101010101000001100000000000101011101010101010000011000000000001010111010101010100000110000000000010101110101010101000001100000000000101011101010101010000011000000000001010111010101010100000110000000000010101110101010101000001100000000000101011101010101010000011000000000001010111011010100100000110000000000001101110101010101000001100000000000011011101010101010000011000000000000110111010101010100000110000000000001101110101010101000001100000000000011011101010101010000011000000000000110111010101010100000110000000000001101110101010101000001100000000000011011101010101010000011000000000000110111010101010100000110000000000001101110101010101000001100000000000011011101010101010000011000000000000110111010101010100000110000000000001101110101010101000001100000000000011011101010101010000011000000000000110111010101010100000110000000000001101110101010101000001100000000000011011101010101010000011000000000000110111010101010100000110000000000001101110101010101000001100000000000011011101010101010000011000000000000110111010101010100000110000000000001101110101010101000001100000000000011011101010101010000011000000000000110111010101010100000110000000000001101110101010101000001100000000000011011101010101010000011000000000000110111010101010100000110000000000001101110101010101000001100000000000011011101010101010000011000000000000110111010101010100000110000000000001101110101010101000001100000000000011011101010101010000011000000000000110111010101010100000110000000000001101110101010101000001100000000000011011101010101010000011000000000000110111010101010100000110000000000001101110110010001000001100000000000111111110110010010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111011101010101010000011000000000001110111010101010100000110000000000011101110101010101000001100000000000111011101010101010000011000000000001110111010101010100000110000000000011101110101010101000001100000000000111011101010101010000011000000000001110111010101010100000110000000000011101110101010101000001100000000000111011101010101010000011000000000001110111010101010100000110000000000011101110101010101000001100000000000111011101010101010000011000000000001110111010101010100000110000000000011101110101010101000001100000000000111011101010101010000011000000000001110111010101010100000110000000000011101110101010101000001100000000000111011101010101010000011000000000001110111010101010100000110000000000011101110101010101000001100000000000111011101010101010000011000000000001110111010101010100000110000000000011101110101010101000001100000000000111011101010101010000011000000000001110111010101010100000110000000000011101110101010101000001100000000000111011101010101010000011000000000001110111010101010100000110000000000011101110101010101000001100000000000111011101010101010000011000000000001110111000101010100000110000000000000011110101010101000001100000000000000111101010101010000011000000000000001111010101010100000110000000000000011110101010101000001100000000000000111101010101010000011000000000000001111010101010100000110000000000000011110101010101000001100000000000000111101010101010000011000000000000001111010101010100000110000000000000011110101010101000001100000000000000111101010101010000011000000000000001111010101010100000110000000000000011110101010101000001100000000000000111101010101010000011000000000000001111010101010100000110000000000000011110101010101000001100000000000000111101010101010000011000000000000001111010101010100000110000000000000011110101010101000001100000000000000111101010101010000011000000000000001111010101010100000110000000000000011110101010101000001100000000000000111101010101010000011000000000000001111010101010100000110000000000000011110101010101000001100000000000000111101010101010000011000000000000001111010101010100000110000000000000011110101010101000001100000000000000111101010101010000011000000000000001111010101010100000110000000000000011110101010101000001100000000000000111101010101010000011000000000000001111010101010100000110000000000000011110101010101000001100000000000000111101010101010000011000000000000001111010101010100000110000000000000011110001001001000001100000000000000111101010101010000011000000000000001111010101010100000110000000000000011110101010101000001100000000000000111101010101010000011000000000000001111010101010100000110000000000000011110101010101000001100000000000000111101010101010000011000000000000001111010101010100000110000000000000011110101010101000001100000000000000111101010101010000011000000000000001111010101010100000110000000000000011110101010101000001100000000000000111101010101010000011000000000000001111010101010100000110000000000000011110101010101000001100000000000000111101010101010000011000000000000001111010101010100000110000000000000011110101010101000001100000000000000111101010101010000011000000000000001111010101010100000110000000000000011110101010101000001100000000000000111101010101010000011000000000000001111010101010100000110000000000000011110101010101000001100000000000000111101010101010000011000000000000001111010101010100000110000000000000011110001001001000001100000000000100111101010101010000011000000000001001111010101010100000110000000000010011110101010101000001100000000000100111101010101010000011000000000001001111010101010100000110000000000010011110101010101000001100000000000100111101010101010000011000000000001001111010101010100000110000000000010011110101010101000001100000000000100111101010101010000011000000000001001111010101010100000110000000000010011110101010101000001100000000000100111101010101010000011000000000001001111010101010100000110000000000010011110101010101000001100000000000100111101010101010000011000000000001001111010101010100000110000000000010011110101010101000001100000000000100111101010101010000011000000000001001111010101010100000110000000000010011110101010101000001100000000000100111101010101010000011000000000001001111010101010100000110000000000010011110101010101000001100000000000100111101010101010000011000000000001001111010101010100000110000000000010011110101010101000001100000000000100111101010101010000011000000000001001111010101010100000110000000000010011110101010101000001100000000000100111101010101010000011000000000001001111001110000100000110000000000011111111111010111000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000010001000110101010100000110000000000000010001101010101000001100000000000000100011010101010000011000000000000001000110101010100000110000000000000010001101010101000001100000000000000100011010101010000011000000000000001000110101010100000110000000000000010001101010101000001100000000000000100011010101010000011000000000000001000110101010100000110000000000000010001101010101000001100000000000000100011010101010000011000000000000001000110101010100000110000000000000010001101010101000001100000000000000100011010101010000011000000000000001000110101010100000110000000000000010001101010101000001100000000000000100011010101010000011000000000000001000110101010100000110000000000000010001101010101000001100000000000000100011010101010000011000000000000001000110101010100000110000000000000010001101010101000001100000000000000100011010101010000011000000000000001000110101010100000110000000000000010001101010101000001100000000000000100011010101010000011000000000000001000110101010100000110000000000000010001101010101000001100000000000000100011010101010000011000000000000001000110101010100000110000000000000010001101010101000001100000000000000100011010101010000011000000000000001000110101010100000110000000000000010001101010101000001100000000000000100011010101010000011000000000000001000111111010100000110000000000010010001101010101000001100000000000100100011010101010000011000000000001001000110101010100000110000000000010010001101010101000001100000000000100100011010101010000011000000000001001000110101010100000110000000000010010001101010101000001100000000000100100011010101010000011000000000001001000110101010100000110000000000010010001101010101000001100000000000100100011010101010000011000000000001001000110101010100000110000000000010010001101010101000001100000000000100100011010101010000011000000000001001000110101010100000110000000000010010001101010101000001100000000000100100011010101010000011000000000001001000110101010100000110000000000010010001101010101000001100000000000100100011010101010000011000000000001001000110101010100000110000000000010010001101010101000001100000000000100100011010101010000011000000000001001000110101010100000110000000000010010001101010101000001100000000000100100011010101010000011000000000001001000110011010100000110000000000010010001101010101000001100000000000100100011010101010000011000000000001001000110101010100000110000000000010010001101010101000001100000000000100100011010101010000011000000000001001000110101010100000110000000000010010001101010101000001100000000000100100011010101010000011000000000001001000110101010100000110000000000010010001101010101000001100000000000100100011010101010000011000000000001001000110101010100000110000000000010010001101010101000001100000000000100100011010101010000011000000000001001000110101010100000110000000000010010001101010101000001100000000000100100011010101010000011000000000001001000110101010100000110000000000010010001101010101000001100000000000100100011010101010000011000000000001001000110101010100000110000000000010010001101010101000001100000000000100100011010101010000011000000000001001000110101010100000110000000000010010001101010101000001100000000000100100011010101010000011000000000001001000110101010100000110000000000010010001101010101000001100000000000100100011010101010000011000000000001001000110101010100000110000000000010010001101010101000001100000000000100100011001101010000011000000000000101000110101010100000110000000000001010001101010101000001100000000000010100011010101010000011000000000000101000110101010100000110000000000001010001101010101000001100000000000010100011010101010000011000000000000101000110101010100000110000000000001010001101010101000001100000000000010100011010101010000011000000000000101000110101010100000110000000000001010001101010101000001100000000000010100011010101010000011000000000000101000110101010100000110000000000001010001101010101000001100000000000010100011010101010000011000000000000101000110101010100000110000000000001010001101010101000001100000000000010100011010101010000011000000000000101000110101010100000110000000000001010001101010101000001100000000000010100011010101010000011000000000000101000110101010100000110000000000001010001101010101000001100000000000010100011010101010000011000000000000101000110101010100000110000000000001010001101010101000001100000000000010100011010101010000011000000000000101000110101010100000110000000000001010001101010101000001100000000000010100011010101010000011000000000000101000110101010100000110000000000001010001101010101000001100000000000010100011010101010000011000000000000101000110101010100000110000000000001010001101010101000001100000000000010100011010101010000011000000000000101000110011100100000110000000000001010001101010101000001100000000000010100011010101010000011000000000000101000110101010100000110000000000001010001101010101000001100000000000010100011010101010000011000000000000101000110101010100000110000000000001010001101010101000001100000000000010100011010101010000011000000000000101000110101010100000110000000000001010001101010101000001100000000000010100011010101010000011000000000000101000110101010100000110000000000001010001101010101000001100000000000010100011010101010000011000000000000101000110101010100000110000000000001010001101010101000001100000000000010100011010101010000011000000000000101000110101010100000110000000000001010001101010101000001100000000000010100011010101010000011000000000000101000110101010100000110000000000001010001101010101000001100000000000010100011010101010000011000000000000101000110101010100000110000000000001010001101010101000001100000000000010100011010101010000011000000000000101000110011100100000110000000000011010001101010101000001100000000000110100011010101010000011000000000001101000110101010100000110000000000011010001101010101000001100000000000110100011010101010000011000000000001101000110101010100000110000000000011010001101010101000001100000000000110100011010101010000011000000000001101000110101010100000110000000000011010001101010101000001100000000000110100011010101010000011000000000001101000110101010100000110000000000011010001101010101000001100000000000110100011010101010000011000000000001101000110101010100000110000000000011010001101010101000001100000000000110100011010101010000011000000000001101000110101010100000110000000000011010001101010101000001100000000000110100011010101010000011000000000001101000110101010100000110000000000011010001101010101000001100000000000110100011010101010000011000000000001101000110101010100000110000000000011010001101010101000001100000000000110100011010101010000011000000000001101000110101010100000110000000000011010001101010101000001100000000000110100011010101010000011000000000001101000110101010100000110000000000011010001101010101000001100000000000110100011011000110000011000000000000110010110101010100000110000000000001100101101010101000001100000000000011001011010101010000011000000000000110010110101010100000110000000000001100101101010101000001100000000000011001011010101010000011000000000000110010110101010100000110000000000001100101101010101000001100000000000011001011010101010000011000000000000110010110101010100000110000000000001100101101010101000001100000000000011001011010101010000011000000000000110010110101010100000110000000000001100101101010101000001100000000000011001011010101010000011000000000000110010110101010100000110000000000001100101101010101000001100000000000011001011010101010000011000000000000110010110101010100000110000000000001100101101010101000001100000000000011001011010101010000011000000000000110010110101010100000110000000000001100101101010101000001100000000000011001011010101010000011000000000000110010110101010100000110000000000001100101101010101000001100000000000011001011010101010000011000000000000110010110101010100000110000000000001100101101010101000001100000000000011001011010101010000011000000000000110010110101010100000110000000000001100101101010101000001100000000000011001011010101010000011000000000000110010110101010100000110000000000001100101101010101000001100000000000011001011010101010000011000000000000110010101001001100000110000000000011100101101010101000001100000000000111001011010101010000011000000000001110010110101010100000110000000000011100101101010101000001100000000000111001011010101010000011000000000001110010110101010100000110000000000011100101101010101000001100000000000111001011010101010000011000000000001110010110101010100000110000000000011100101101010101000001100000000000111001011010101010000011000000000001110010110101010100000110000000000011100101101010101000001100000000000111001011010101010000011000000000001110010110101010100000110000000000011100101101010101000001100000000000111001011010101010000011000000000001110010110101010100000110000000000011100101101010101000001100000000000111001011010101010000011000000000001110010110101010100000110000000000011100101101010101000001100000000000111001011010101010000011000000000001110010110101010100000110000000000011100101101010101000001100000000000111001011010101010000011000000000001110010110110110100000110000000000011111111010111011000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011011011010101010100000110000000000010110110101010101000001100000000000101101101010101010000011000000000001011011010101010100000110000000000010110110101010101000001100000000000101101101010101010000011000000000001011011010101010100000110000000000010110110101010101000001100000000000101101101010101010000011000000000001011011010101010100000110000000000010110110101010101000001100000000000101101101010101010000011000000000001011011010101010100000110000000000010110110101010101000001100000000000101101101010101010000011000000000001011011010101010100000110000000000010110110101010101000001100000000000101101101010101010000011000000000001011011010101010100000110000000000010110110101010101000001100000000000101101101010101010000011000000000001011011010101010100000110000000000010110110101010101000001100000000000101101101010101010000011000000000001011011010101010100000110000000000010110110101010101000001100000000000101101101010101010000011000000000001011011010101010100000110000000000010110110101010101000001100000000000101101101010101010000011000000000001011011010101010100000110000000000010110110101010101000001100000000000101101101010101010000011000000000001011011010101010100000110000000000010110110101010101000001100000000000101101101010101010000011000000000001011011000100100100000110000000000001110110101010101000001100000000000011101101010101010000011000000000000111011010101010100000110000000000001110110101010101000001100000000000011101101010101010000011000000000000111011010101010100000110000000000001110110101010101000001100000000000011101101010101010000011000000000000111011010101010100000110000000000001110110101010101000001100000000000011101101010101010000011000000000000111011010101010100000110000000000001110110101010101000001100000000000011101101010101010000011000000000000111011010101010100000110000000000001110110101010101000001100000000000011101101010101010000011000000000000111011010101010100000110000000000001110110101010101000001100000000000011101101010101010000011000000000000111011010101010100000110000000000001110110101010101000001100000000000011101101010101010000011000000000000111011010101010100000110000000000001110110101010101000001100000000000011101101010101010000011000000000000111011010101010100000110000000000001110110101010101000001100000000000011101101010101010000011000000000000111011010101010100000110000000000001110110101010101000001100000000000011101101101100010000011000000000001111111111010001100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000010101000110101010100000110000000000001010001101010101000001100000000000010100011010101010000011000000000000101000110101010100000110000000000001010001101010101000001100000000000010100011010101010000011000000000000101000110101010100000110000000000001010001101010101000001100000000000010100011010101010000011000000000000101000110101010100000110000000000001010001101010101000001100000000000010100011010101010000011000000000000101000110101010100000110000000000001010001101010101000001100000000000010100011010101010000011000000000000101000110101010100000110000000000001010001101010101000001100000000000010100011010101010000011000000000000101000110101010100000110000000000001010001101010101000001100000000000010100011010101010000011000000000000101000110101010100000110000000000001010001101010101000001100000000000010100011010101010000011000000000000101000110101010100000110000000000001010001101010101000001100000000000010100011010101010000011000000000000101000110101010100000110000000000001010001101010101000001100000000000010100011010101010000011000000000000101000110101010100000110000000000001010001101010101000001100000000000010100011010101010000011000000000000101000110101010100000110000000000001010001101010101000001100000000000010100011010101010000011000000000000101000110011100100000110000000000011010001101010101000001100000000000110100011010101010000011000000000001101000110101010100000110000000000011010001101010101000001100000000000110100011010101010000011000000000001101000110101010100000110000000000011010001101010101000001100000000000110100011010101010000011000000000001101000110101010100000110000000000011010001101010101000001100000000000110100011010101010000011000000000001101000110101010100000110000000000011010001101010101000001100000000000110100011010101010000011000000000001101000110101010100000110000000000011010001101010101000001100000000000110100011010101010000011000000000001101000110101010100000110000000000011010001101010101000001100000000000110100011010101010000011000000000001101000110101010100000110000000000011010001101010101000001100000000000110100011010101010000011000000000001101000110101010100000110000000000011010001101010101000001100000000000110100011010101010000011000000000001101000110110001100000110000000000000010101101010101000001100000000000000101011010101010000011000000000000001010110101010100000110000000000000010101101010101000001100000000000000101011010101010000011000000000000001010110101010100000110000000000000010101101010101000001100000000000000101011010101010000011000000000000001010110101010100000110000000000000010101101010101000001100000000000000101011010101010000011000000000000001010110101010100000110000000000000010101101010101000001100000000000000101011010101010000011000000000000001010110101010100000110000000000000010101101010101000001100000000000000101011010101010000011000000000000001010110101010100000110000000000000010101101010101000001100000000000000101011010101010000011000000000000001010110101010100000110000000000000010101101010101000001100000000000000101011010101010000011000000000000001010110101010100000110000000000000010101101010101000001100000000000000101011010101010000011000000000000001010110101010100000110000000000000010101101010101000001100000000000000101011010101010000011000000000000001010110101010100000110000000000000010101101010101000001100000000000000101011010101010000011000000000000001010110101010100000110000000000000010101101010101000001100000000000000101011010101010000011000000000000001010110101010100000110000000000000010101010010011000001100000000000100101011010101010000011000000000001001010110101010100000110000000000010010101101010101000001100000000000100101011010101010000011000000000001001010110101010100000110000000000010010101101010101000001100000000000100101011010101010000011000000000001001010110101010100000110000000000010010101101010101000001100000000000100101011010101010000011000000000001001010110101010100000110000000000010010101101010101000001100000000000100101011010101010000011000000000001001010110101010100000110000000000010010101101010101000001100000000000100101011010101010000011000000000001001010110101010100000110000000000010010101101010101000001100000000000100101011010101010000011000000000001001010110101010100000110000000000010010101101010101000001100000000000100101011010101010000011000000000001001010110101010100000110000000000010010101101010101000001100000000000100101011010101010000011000000000001001010110101010100000110000000000010010101110001001000001100000000000111111110000000010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111000100101010101000001100000000000110001001010101010000011000000000001100010010101010100000110000000000011000100101010101000001100000000000110001001010101010000011000000000001100010010101010100000110000000000011000100101010101000001100000000000110001001010101010000011000000000001100010010101010100000110000000000011000100101010101000001100000000000110001001010101010000011000000000001100010010101010100000110000000000011000100101010101000001100000000000110001001010101010000011000000000001100010010101010100000110000000000011000100101010101000001100000000000110001001010101010000011000000000001100010010101010100000110000000000011000100101010101000001100000000000110001001010101010000011000000000001100010010101010100000110000000000011000100101010101000001100000000000110001001010101010000011000000000001100010010101010100000110000000000011000100101010101000001100000000000110001001010101010000011000000000001100010010101010100000110000000000011000100101010101000001100000000000110001001010101010000011000000000001100010010101010100000110000000000011000100101010101000001100000000000110001001010101010000011000000000001100010010101010100000110000000000011000100101010101000001100000000000110001001010101010000011000000000001100010010101010100000110000000000011000100110001001000001100000000000001001001010101010000011000000000000010010010101010100000110000000000000100100101010101000001100000000000001001001010101010000011000000000000010010010101010100000110000000000000100100101010101000001100000000000001001001010101010000011000000000000010010010101010100000110000000000000100100101010101000001100000000000001001001010101010000011000000000000010010010101010100000110000000000000100100101010101000001100000000000001001001010101010000011000000000000010010010101010100000110000000000000100100101010101000001100000000000001001001010101010000011000000000000010010010101010100000110000000000000100100101010101000001100000000000001001001010101010000011000000000000010010010101010100000110000000000000100100101010101000001100000000000001001001010101010000011000000000000010010010101010100000110000000000000100100101010101000001100000000000001001001010101010000011000000000000010010010101010100000110000000000000100100101010101000001100000000000001001001010101010000011000000000000010010010101010100000110000000000000100100101010101000001100000000000001001001010101010000011000000000000010010011001100100000110000000000011111111100010101000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000100011010101010101000001100000000000000110101010101010000011000000000000001101010101010100000110000000000000011010101010101000001100000000000000110101010101010000011000000000000001101010101010100000110000000000000011010101010101000001100000000000000110101010101010000011000000000000001101010101010100000110000000000000011010101010101000001100000000000000110101010101010000011000000000000001101010101010100000110000000000000011010101010101000001100000000000000110101010101010000011000000000000001101010101010100000110000000000000011010101010101000001100000000000000110101010101010000011000000000000001101010101010100000110000000000000011010101010101000001100000000000000110101010101010000011000000000000001101010101010100000110000000000000011010101010101000001100000000000000110101010101010000011000000000000001101010101010100000110000000000000011010101010101000001100000000000000110101010101010000011000000000000001101010101010100000110000000000000011010101010101000001100000000000000110101010101010000011000000000000001101010101010100000110000000000000011010101010101000001100000000000000110101010101010000011000000000000001101010101010100000110000000000000011010101010101000001100000000000000110101010101010000011000000000000001101010101010100000110000000000000011010101011001000001100000000000100110101010101010000011000000000001001101010101010100000110000000000010011010101010101000001100000000000100110101010101010000011000000000001001101010101010100000110000000000010011010101010101000001100000000000100110101010101010000011000000000001001101010101010100000110000000000010011010101010101000001100000000000100110101010101010000011000000000001001101010101010100000110000000000010011010101010101000001100000000000100110101010101010000011000000000001001101010101010100000110000000000010011010101010101000001100000000000100110101010101010000011000000000001001101010101010100000110000000000010011010101010101000001100000000000100110101010101010000011000000000001001101010101010100000110000000000010011010101010101000001100000000000100110101010101010000011000000000001001101010101010100000110000000000010011010101010101000001100000000000100110101010101010000011000000000001001101010101010100000110000000000010011010010000001000001100000000000111111110001000010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000010101010110101010100000110000000000001010101101010101000001100000000000010101011010101010000011000000000000101010110101010100000110000000000001010101101010101000001100000000000010101011010101010000011000000000000101010110101010100000110000000000001010101101010101000001100000000000010101011010101010000011000000000000101010110101010100000110000000000001010101101010101000001100000000000010101011010101010000011000000000000101010110101010100000110000000000001010101101010101000001100000000000010101011010101010000011000000000000101010110101010100000110000000000001010101101010101000001100000000000010101011010101010000011000000000000101010110101010100000110000000000001010101101010101000001100000000000010101011010101010000011000000000000101010110101010100000110000000000001010101101010101000001100000000000010101011010101010000011000000000000101010110101010100000110000000000001010101101010101000001100000000000010101011010101010000011000000000000101010110101010100000110000000000001010101101010101000001100000000000010101011010101010000011000000000000101010110101010100000110000000000001010101101010101000001100000000000010101011010101010000011000000000000101010110101010100000110000000000001010101101010101000001100000000000010101011010101010000011000000000000101010111111011100000110000000000011010101101010101000001100000000000110101011010101010000011000000000001101010110101010100000110000000000011010101101010101000001100000000000110101011010101010000011000000000001101010110101010100000110000000000011010101101010101000001100000000000110101011010101010000011000000000001101010110101010100000110000000000011010101101010101000001100000000000110101011010101010000011000000000001101010110101010100000110000000000011010101101010101000001100000000000110101011010101010000011000000000001101010110101010100000110000000000011010101101010101000001100000000000110101011010101010000011000000000001101010110101010100000110000000000011010101101010101000001100000000000110101011010101010000011000000000001101010110101010100000110000000000011010101101010101000001100000000000110101011010101010000011000000000001101010110101010100000110000000000011010101101010101000001100000000000110101011010101010000011000000000001101010100100010100000110000000000001011010101010101000001100000000000010110101010101010000011000000000000101101010101010100000110000000000001011010101010101000001100000000000010110101010101010000011000000000000101101010101010100000110000000000001011010101010101000001100000000000010110101010101010000011000000000000101101010101010100000110000000000001011010101010101000001100000000000010110101010101010000011000000000000101101010101010100000110000000000001011010101010101000001100000000000010110101010101010000011000000000000101101010101010100000110000000000001011010101010101000001100000000000010110101010101010000011000000000000101101010101010100000110000000000001011010101010101000001100000000000010110101010101010000011000000000000101101010101010100000110000000000001011010101010101000001100000000000010110101010101010000011000000000000101101010101010100000110000000000001011010101010101000001100000000000010110101010101010000011000000000000101101010101010100000110000000000001011010101010101000001100000000000010110101010101010000011000000000000101101010101010100000110000000000001011010101010101000001100000000000010110101010101010000011000000000000101101010101010100000110000000000001011010101010101000001100000000000010110101010101010000011000000000000101101010101010100000110000000000001011010100101101000001100000000000110110101010101010000011000000000001101101010101010100000110000000000011011010101010101000001100000000000110110101010101010000011000000000001101101010101010100000110000000000011011010101010101000001100000000000110110101010101010000011000000000001101101010101010100000110000000000011011010101010101000001100000000000110110101010101010000011000000000001101101010101010100000110000000000011011010101010101000001100000000000110110101010101010000011000000000001101101010101010100000110000000000011011010101010101000001100000000000110110101010101010000011000000000001101101010101010100000110000000000011011010101010101000001100000000000110110101010101010000011000000000001101101010101010100000110000000000011011010101010101000001100000000000110110101010101010000011000000000001101101010101010100000110000000000011011010101010101000001100000000000110110101010101010000011000000000001101101010101010100000110000000000011011010001001111000001100000000000001110101010101010000011000000000000011101010101010100000110000000000000111010101010101000001100000000000001110101010101010000011000000000000011101010101010100000110000000000000111010101010101000001100000000000001110101010101010000011000000000000011101010101010100000110000000000000111010101010101000001100000000000001110101010101010000011000000000000011101010101010100000110000000000000111010101010101000001100000000000001110101010101010000011000000000000011101010101010100000110000000000000111010101010101000001100000000000001110101010101010000011000000000000011101010101010100000110000000000000111010101010101000001100000000000001110101010101010000011000000000000011101010101010100000110000000000000111010101010101000001100000000000001110101010101010000011000000000000011101010101010100000110000000000000111010101010101000001100000000000001110101010101010000011000000000000011101010101010100000110000000000000111010101010101000001100000000000001110101010101010000011000000000000011101010101010100000110000000000000111010101010101000001100000000000001110101010101010000011000000000000011101010101010100000110000000000000111010101010101000001100000000000001110101010101010000011000000000000011101010101010100000110000000000000111010101010101000001100000000000001110101111011010000011000000000001101010110101010100000110000000000011010101101010101000001100000000000110101011010101010000011000000000001101010110101010100000110000000000011010101101010101000001100000000000110101011010101010000011000000000001101010110101010100000110000000000011010101101010101000001100000000000110101011010101010000011000000000001101010110101010100000110000000000011010101101010101000001100000000000110101011010101010000011000000000001101010110101010100000110000000000011010101101010101000001100000000000110101011010101010000011000000000001101010110101010100000110000000000011010101101010101000001100000000000110101011010101010000011000000000001101010110101010100000110000000000011010101101010101000001100000000000110101011010101010000011000000000001101010110101010100000110000000000011010101101010101000001100000000000110101011010101010000011000000000001101010110101010100000110000000000011010101101010101000001100000000000110101011010101010000011000000000001101010110101010100000110000000000011010101101010101000001100000000000110101011010101010000011000000000001101010110101010100000110000000000011010101001000101000001100000000000111111110000000010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001110101011010101010000001000100010001101010110101010100000010001000100011010101101010101000000100010001000110101011010101010000001000100010001101010110101010100000010001000100011010101101010101000000100010001000110101011010101010000001000100010001101010110101010100000010001000100011010101101010101000000100010001000110101011010101010000001000100010001101010110101010100000010001000100011010101101010101000000100010001000110101011010101010000001000100010001101010110101010100000010001000100011010101101010101000000100010001000110101011010101010000001000100010001101010110101010100000010001000100011010101101010101000000100010001000110101011010101010000001000100010001101010110101010100000010001000100011010101101010101000000100010001000110101011010101010000001000100010001101010110101010100000010001000100011010101101010101000000100010001000110101011010101010000001000100010001101010110101010100000010001000100011010101101010101000000100010001000110101011010101010000001000100010001101010110101010100000010001000100011010101101010101000000100010001000110101011010101010000001000100010001101010110101010100000010001000100011010101101010101000000100010001000110101011010101010000001000100010001101010111000100100000010001000100000111010101010101000001100000000000001110101010101010000011000000000000011101010101010100000110000000000000111010101010101000001100000000000001110101010101010000011000000000000011101010101010100000110000000000000111010101010101000001100000000000001110101010101010000011000000000000011101010101010100000110000000000000111010101010101000001100000000000001110101010101010000011000000000000011101010101010100000110000000000000111010101010101000001100000000000001110101010101010000011000000000000011101010101010100000110000000000000111010101010101000001100000000000001110101010101010000011000000000000011101010101010100000110000000000000111010101010101000001100000000000001110101010101010000011000000000000011101010101010100000110000000000000111010101010101000001100000000000001110101010101010000011000000000000011101010101010100000110000000000000111010101010101000001100000000000001110101010101010000011000000000000011101010101010100000110000000000000111010101010101000001100000000000001110101010101010000011000000000000011101010101010100000110000000000000111010101010101000001100000000000001110101010101010000011000000000000011101010101010100000110000000000000111010111101101000001100000000000101110101010101010000011000000000001011101010101010100000110000000000010111010101010101000001100000000000101110101010101010000011000000000001011101010101010100000110000000000010111010101010101000001100000000000101110101010101010000011000000000001011101010101010100000110000000000010111010101010101000001100000000000101110101010101010000011000000000001011101010101010100000110000000000010111010101010101000001100000000000101110101010101010000011000000000001011101010101010100000110000000000010111010101010101000001100000000000101110101010101010000011000000000001011101010101010100000110000000000010111010101010101000001100000000000101110101010101010000011000000000001011101010101010100000110000000000010111010101010101000001100000000000101110101010101010000011000000000001011101010101010100000110000000000010111010101010101000001100000000000101110101010101010000011000000000001011101010101010100000110000000000010111010011011001000001100000000000011110101010101010000011000000000000111101010101010100000110000000000001111010101010101000001100000000000011110101010101010000011000000000000111101010101010100000110000000000001111010101010101000001100000000000011110101010101010000011000000000000111101010101010100000110000000000001111010101010101000001100000000000011110101010101010000011000000000000111101010101010100000110000000000001111010101010101000001100000000000011110101010101010000011000000000000111101010101010100000110000000000001111010101010101000001100000000000011110101010101010000011000000000000111101010101010100000110000000000001111010101010101000001100000000000011110101010101010000011000000000000111101010101010100000110000000000001111010101010101000001100000000000011110101010101010000011000000000000111101010101010100000110000000000001111010101010101000001100000000000011110101010101010000011000000000000111101010101010100000110000000000001111010101010101000001100000000000011110101010101010000011000000000000111101010101010100000110000000000001111010101010101000001100000000000011110101010101010000011000000000000111101010101010100000110000000000001111010101010101000001100000000000011110101010101010000011000000000000111101010101010100000110000000000001111010101010101000001100000000000011110101110110110000011000000000001111111101100001100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000010000001011000010100000110000000010100000010110000101000001100000000101000000101100001010000011000000001010000001011000010100000110000000010100000010110000101000001100000000101000000101100001010000011000000001010000001011000010100000110000000010100000010110000101000001100000000101000000101100001010000011000000001010000001011000010100000110000000010100000010110000101000001100000000101000000101100001010000011000000001010000001011000010100000110000000010100000010110000101000001100000000101000000101100001010000011000000001010000001011000010100000110000000010100000010110000101000001100000000101000000101100001010000011000000001010000001011000010100000110000000010100000010110000101000001100000000101000000101100001010000011000000001010000001011000010100000110000000010100000010110000101000001100000000101000000101100001010000011000000001010000001011000010100000110000000010100000010110000101000001100000000101000000101100001010000011000000001010000001011000010100000110000000010100000010110000101000001100000000101000000101100001010000011000000001010000001011000010100000110000000010100000010110000101000001100000000101111111110000000010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000100000010110000101000000100000000011000000101100001010000001000000000110000001011000010100000010000000001100000010110000101000000100000000011000000101100001010000001000000000110000001011000010100000010000000001100000010110000101000000100000000011000000101100001010000001000000000110000001011000010100000010000000001100000010110000101000000100000000011000000101100001010000001000000000110000001011000010100000010000000001100000010110000101000000100000000011000000101100001010000001000000000110000001011000010100000010000000001100000010110000101000000100000000011000000101100001010000001000000000110000001011000010100000010000000001100000010110000101000000100000000011000000101100001010000001000000000110000001011000010100000010000000001100000010110000101000000100000000011000000101100001010000001000000000110000001011000010100000010000000001100000010110000101000000100000000011000000101100001010000001000000000110000001011000010100000010000000001100000010110000101000000100000000011000000101100001010000001000000000110000001011000010100000010000000001100000010110000101000000100000000011000000101100001010000001000000000110111101010101010100000110000000000001111010101010101000001100000000000011110101010101010000011000000000000111101010101010100000110000000000001111010101010101000001100000000000011110101010101010000011000000000000111101010101010100000110000000000001111010101010101000001100000000000011110101010101010000011000000000000111101010101010100000110000000000001111010101010101000001100000000000011110101010101010000011000000000000111101010101010100000110000000000001111010101010101000001100000000000011110101010101010000011000000000000111101010101010100000110000000000001111010101010101000001100000000000011110101010101010000011000000000000111101010101010100000110000000000001111010101010101000001100000000000011110101010101010000011000000000000111101010101010100000110000000000001111010101010101000001100000000000011110101010101010000011000000000000111101010101010100000110000000000001111010101010101000001100000000000011110101010101010000011000000000000111101010101010100000110000000000001111010101010101000001100000000000011110101010101010000011000000000000111101010101010100000110000000000001111010111011011000001100000000000111110101010101010000011000000000001111101010101010100000110000000000011111010101010101000001100000000000111110101010101010000011000000000001111101010101010100000110000000000011111010101010101000001100000000000111110101010101010000011000000000001111101010101010100000110000000000011111010101010101000001100000000000111110101010101010000011000000000001111101010101010100000110000000000011111010101010101000001100000000000111110101010101010000011000000000001111101010101010100000110000000000011111010101010101000001100000000000111110101010101010000011000000000001111101010101010100000110000000000011111010101010101000001100000000000111110101010101010000011000000000001111101010101010100000110000000000011111010101010101000001100000000000111110101010101010000011000000000001111101010101010100000110000000000011111010101010101000001100000000000111110101010101010000011000000000001111101010101010100000110000000000011111010101010101000001100000000000111110101010101010000011000000000001111101010101010100000110000000000011111010101010101000001100000000000111110101010101010000011000000000001111101011111111100000110000000000000000110101010101000001100000000000000001101010101010000011000000000000000011010101010100000110000000000000000110101010101000001100000000000000001101010101010000011000000000000000011010101010100000110000000000000000110101010101000001100000000000000001101010101010000011000000000000000011010101010100000110000000000000000110101010101000001100000000000000001101010101010000011000000000000000011010101010100000110000000000000000110101010101000001100000000000000001101010101010000011000000000000000011010101010100000110000000000000000110101010101000001100000000000000001101010101010000011000000000000000011010101010100000110000000000000000110101010101000001100000000000000001101010101010000011000000000000000011010101010100000110000000000000000110101010101000001100000000000000001101010101010000011000000000000000011010101010100000110000000000000000110101010101000001100000000000000001101010101010000011000000000000000011010101010100000110000000000000000110101010101000001100000000000000001101010101010000011000000000000000011010101010100000110000000000000000110101010101000001100000000000000001101010101010000011000000000000000011010101010100000110000000000000000110101010101000001100000000000000001101010101010000011000000000000000011010101010100000110000000000000000110111111101000001100000000000111111111110010110000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111111101100010000011000000000011111111111011000100000110000000000111111111110110001000001100000000001111111101011101110000001111110110011111111010111011100000011111101100111111110101110111000000111111011001111111101011101110000001111110110011111111010111011100000011111101100111111110101110111000000111111011001111111101011101110000001111110110011111111010111011100000011111101100111111110101110111000000111111011001111111101011101110000001111110110011111111010111011100000011111101100111111110101110111000000111111011001111111101011101110000001111110110011111111010111011100000011111101100111111110101110111000000111111011001111111101011101110000001111110110011111111010111011100000011111101100111111110101110111000000111111011001111111101011101110000001111110110011111111010111011100000011111101100111111110101110111000000111111011001111111101011101110000001111110110011111111010111011100000011111101100111111110101110111000000111111011001111111101011101110000001111110110011111111010111011100000011111101100111111110101110111000000111111011001111111101011101110000001111110110011111111010111011100000011111101100111111110101110111000000111111011001111111101011101110000001111110110011111111010111011100000011111101100110000110101010101100001100000000000100001101010101011000011000000000001000011010101010110000110000000000010000110101010101100001100000000000100001101010101011000011000000000001000011010101010110000110000000000010000110101010101100001100000000000100001101010101011000011000000000001000011010101010110000110000000000010000110101010101100001100000000000100001101010101011000011000000000001000011010101010110000110000000000010000110101010101100001100000000000100001101010101011000011000000000001000011010101010110000110000000000010000110101010101100001100000000000100001101010101011000011000000000001000011010101010110000110000000000010000110101010101100001100000000000100001101010101011000011000000000001000011010101010110000110000000000010000110101010101100001100000000000100001101010101011000011000000000001000011010101010110000110000000000010000110101010101100001100000000000100001101010101011000011000000000001000011010101010110000110000000000010000110101010101100001100000000000100001101010101011000011000000000001000011010101010110000110000000000010000110101010101100001100000000000100001101111111011000011000000000000100011010101010110000110000000000001000110101010101100001100000000000010001101010101011000011000000000000100011010101010110000110000000000001000110101010101100001100000000000010001101010101011000011000000000000100011010101010110000110000000000001000110101010101100001100000000000010001101010101011000011000000000000100011010101010110000110000000000001000110101010101100001100000000000010001101010101011000011000000000000100011010101010110000110000000000001000110101010101100001100000000000010001101010101011000011000000000000100011010101010110000110000000000001000110101010101100001100000000000010001101010101011000011000000000000100011010101010110000110000000000001000110101010101100001100000000000010001101010101011000011000000000000100011010101010110000110000000000001000110101010101100001100000000000010001101010101011000011000000000000100011010101010110000110000000000001000110101010101100001100000000000010001101010101011000011000000000000100011010101010110000110000000000001000110101010101100001100000000000010001101010101011000011000000000000100011010101010110000110000000000001000110101010101100001100000000000010001101010101011000011000000000000100011010101010110000110000000000001000110101010101100001100000000000010001101010101011000011000000000000100011010101010110000110000000000001000110111111111100001100000000000110001101010101011000011000000000001100011010101010110000110000000000011000110101010101100001100000000000110001101010101011000011000000000001100011010101010110000110000000000011000110101010101100001100000000000110001101010101011000011000000000001100011010101010110000110000000000011000110101010101100001100000000000110001101010101011000011000000000001100011010101010110000110000000000011000110101010101100001100000000000110001101010101011000011000000000001100011010101010110000110000000000011000110101010101100001100000000000110001101010101011000011000000000001100011010101010110000110000000000011000110101010101100001100000000000110001101010101011000011000000000001100011010101010110000110000000000011000110101010101100001100000000000110001101010101011000011000000000001100011010101010110000110000000000011000110101010101100001100000000000110001101010101011000011000000000001100011010011011110000110000000000011111111011010011100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011001101110101010110000110000000000110011011101010101100001100000000001100110111010101011000011000000000011001101110101010110000110000000000110011011101010101100001100000000001100110111010101011000011000000000011001101110101010110000110000000000110011011101010101100001100000000001100110111010101011000011000000000011001101110101010110000110000000000110011011101010101100001100000000001100110111010101011000011000000000011001101110101010110000110000000000110011011101010101100001100000000001100110111010101011000011000000000011001101110101010110000110000000000110011011101010101100001100000000001100110111010101011000011000000000011001101110101010110000110000000000110011011101010101100001100000000001100110111010101011000011000000000011001101110101010110000110000000000110011011101010101100001100000000001100110111010101011000011000000000011001101110101010110000110000000000110011011101010101100001100000000001100110111010101011000011000000000011001101110101010110000110000000000110011011101010101100001100000000001100110111010101011000011000000000011001101110101010110000110000000000110011011101010101100001100000000001111111111111111111000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000110011011101010101100000100000000001100110111010101011000001000000000011001101110101010110000010000000000110011011101010101100000100000000001100110111010101011000001000000000011001101110101010110000010000000000110011011101010101100000100000000001100110111010101011000001000000000011001101110101010110000010000000000110011011101010101100000100000000001100110111010101011000001000000000011001101110101010110000010000000000110011011101010101100000100000000001100110111010101011000001000000000011001101110101010110000010000000000110011011101010101100000100000000001100110111010101011000001000000000011001101110101010110000010000000000110011011101010101100000100000000001100110111010101011000001000000000011001101110101010110000010000000000110011011101010101100000100000000001100110111010101011000001000000000011001101110101010110000010000000000110011011101010101100000100000000001100110111010101011000001000000000011001101110101010110000010000000000110011011101010101100000100000000001100110111010101011000001000000000011001101110101010110000010000000000110011011101010101100000100000000001100110111010101011000001000000000010010011010101010110000110000000000000100110101010101100001100000000000001001101010101011000011000000000000010011010101010110000110000000000000100110101010101100001100000000000001001101010101011000011000000000000010011010101010110000110000000000000100110101010101100001100000000000001001101010101011000011000000000000010011010101010110000110000000000000100110101010101100001100000000000001001101010101011000011000000000000010011010101010110000110000000000000100110101010101100001100000000000001001101010101011000011000000000000010011010101010110000110000000000000100110101010101100001100000000000001001101010101011000011000000000000010011010101010110000110000000000000100110101010101100001100000000000001001101010101011000011000000000000010011010101010110000110000000000000100110101010101100001100000000000001001101010101011000011000000000000010011010101010110000110000000000000100110101010101100001100000000000001001101010101011000011000000000000010011010101010110000110000000000000100110101010101100001100000000000001001101010101011000011000000000000010011010101010110000110000000000000100110101010101100001100000000000001001101010101011000011000000000000010011010101010110000110000000000000100110101010101100001100000000000001001101010101011000011000000000000010011001100001110000110000000000010100110101010101100001100000000000101001101010101011000011000000000001010011010101010110000110000000000010100110101010101100001100000000000101001101010101011000011000000000001010011010101010110000110000000000010100110101010101100001100000000000101001101010101011000011000000000001010011010101010110000110000000000010100110101010101100001100000000000101001101010101011000011000000000001010011010101010110000110000000000010100110101010101100001100000000000101001101010101011000011000000000001010011010101010110000110000000000010100110101010101100001100000000000101001101010101011000011000000000001010011010101010110000110000000000010100110101010101100001100000000000101001101010101011000011000000000001010011010101010110000110000000000010100110101010101100001100000000000101001101010101011000011000000000001010011010101010110000110000000000010100110101010101100001100000000000101001101010101011000011000000000001010011001011010110000110000000000001100110101010101100001100000000000011001101010101011000011000000000000110011010101010110000110000000000001100110101010101100001100000000000011001101010101011000011000000000000110011010101010110000110000000000001100110101010101100001100000000000011001101010101011000011000000000000110011010101010110000110000000000001100110101010101100001100000000000011001101010101011000011000000000000110011010101010110000110000000000001100110101010101100001100000000000011001101010101011000011000000000000110011010101010110000110000000000001100110101010101100001100000000000011001101010101011000011000000000000110011010101010110000110000000000001100110101010101100001100000000000011001101010101011000011000000000000110011010101010110000110000000000001100110101010101100001100000000000011001101010101011000011000000000000110011010101010110000110000000000001100110101010101100001100000000000011001101010101011000011000000000000110011010101010110000110000000000001100110101010101100001100000000000011001101010101011000011000000000000110011010101010110000110000000000001100110101010101100001100000000000011001101010101011000011000000000000110011010101010110000110000000000001100110101010101100001100000000000011001101010101011000011000000000000110011010101010110000110000000000001100110111011011100001100000000000111001101010101011000011000000000001110011010101010110000110000000000011100110101010101100001100000000000111001101010101011000011000000000001110011010101010110000110000000000011100110101010101100001100000000000111001101010101011000011000000000001110011010101010110000110000000000011100110101010101100001100000000000111001101010101011000011000000000001110011010101010110000110000000000011100110101010101100001100000000000111001101010101011000011000000000001110011010101010110000110000000000011100110101010101100001100000000000111001101010101011000011000000000001110011010101010110000110000000000011100110101010101100001100000000000111001101010101011000011000000000001110011010101010110000110000000000011100110101010101100001100000000000111001101010101011000011000000000001110011010101010110000110000000000011100110101010101100001100000000000111001101010101011000011000000000001110011010101010110000110000000000011100110111111111100001100000000000000101101010101011000011000000000000001011010101010110000110000000000000010110101010101100001100000000000000101101010101011000011000000000000001011010101010110000110000000000000010110101010101100001100000000000000101101010101011000011000000000000001011010101010110000110000000000000010110101010101100001100000000000000101101010101011000011000000000000001011010101010110000110000000000000010110101010101100001100000000000000101101010101011000011000000000000001011010101010110000110000000000000010110101010101100001100000000000000101101010101011000011000000000000001011010101010110000110000000000000010110101010101100001100000000000000101101010101011000011000000000000001011010101010110000110000000000000010110101010101100001100000000000000101101010101011000011000000000000001011010101010110000110000000000000010110101010101100001100000000000000101101010101011000011000000000000001011010101010110000110000000000000010110101010101100001100000000000000101101010101011000011000000000000001011010101010110000110000000000000010110101010101100001100000000000000101101010101011000011000000000000001011010101010110000110000000000000010110101010101100001100000000000000101101010101011000011000000000000001011010101010110000110000000000000010110101010101100001100000000000000101101001101111000011000000000001111111110100010110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011001101110101010110000010101101000110011011101010101100000101011010001100110111010101011000001010110100011001101110101010110000010101101000110011011101010101100000101011010001100110111010101011000001010110100011001101110101010110000010101101000110011011101010101100000101011010001100110111010101011000001010110100011001101110101010110000010101101000110011011101010101100000101011010001100110111010101011000001010110100011001101110101010110000010101101000110011011101010101100000101011010001100110111010101011000001010110100011001101110101010110000010101101000110011011101010101100000101011010001100110111010101011000001010110100011001101110101010110000010101101000110011011101010101100000101011010001100110111010101011000001010110100011001101110101010110000010101101000110011011101010101100000101011010001100110111010101011000001010110100011001101110101010110000010101101000110011011101010101100000101011010001100110111010101011000001010110100011001101110101010110000010101101000110011011101010101100000101011010001100110111010101011000001010110100011001101110101010110000010101101000110011011101010101100000101011010001100101101010101011000011000000000001001011010101010110000110000000000010010110101010101100001100000000000100101101010101011000011000000000001001011010101010110000110000000000010010110101010101100001100000000000100101101010101011000011000000000001001011010101010110000110000000000010010110101010101100001100000000000100101101010101011000011000000000001001011010101010110000110000000000010010110101010101100001100000000000100101101010101011000011000000000001001011010101010110000110000000000010010110101010101100001100000000000100101101010101011000011000000000001001011010101010110000110000000000010010110101010101100001100000000000100101101010101011000011000000000001001011010101010110000110000000000010010110101010101100001100000000000100101101010101011000011000000000001001011010101010110000110000000000010010110101010101100001100000000000100101101010101011000011000000000001001011010101010110000110000000000010010110101010101100001100000000000100101101010101011000011000000000001001011010101010110000110000000000010010110101010101100001100000000000100101101010101011000011000000000001001011010101100110000110000000000001010110101010101100001100000000000010101101010101011000011000000000000101011010101010110000110000000000001010110101010101100001100000000000010101101010101011000011000000000000101011010101010110000110000000000001010110101010101100001100000000000010101101010101011000011000000000000101011010101010110000110000000000001010110101010101100001100000000000010101101010101011000011000000000000101011010101010110000110000000000001010110101010101100001100000000000010101101010101011000011000000000000101011010101010110000110000000000001010110101010101100001100000000000010101101010101011000011000000000000101011010101010110000110000000000001010110101010101100001100000000000010101101010101011000011000000000000101011010101010110000110000000000001010110101010101100001100000000000010101101010101011000011000000000000101011010101010110000110000000000001010110101010101100001100000000000010101101010101011000011000000000000101011010101010110000110000000000001010110101010101100001100000000000010101101010101011000011000000000000101011010101010110000110000000000001010110101010101100001100000000000010101101010101011000011000000000000101011010101010110000110000000000001010110101010101100001100000000000010101101010101011000011000000000000101011010101010110000110000000000001010110100000011100001100000000000111111110000000111000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111010101101010101100001100000000000110101011010101011000011000000000001101010110101010110000110000000000011010101101010101100001100000000000110101011010101011000011000000000001101010110101010110000110000000000011010101101010101100001100000000000110101011010101011000011000000000001101010110101010110000110000000000011010101101010101100001100000000000110101011010101011000011000000000001101010110101010110000110000000000011010101101010101100001100000000000110101011010101011000011000000000001101010110101010110000110000000000011010101101010101100001100000000000110101011010101011000011000000000001101010110101010110000110000000000011010101101010101100001100000000000110101011010101011000011000000000001101010110101010110000110000000000011010101101010101100001100000000000110101011010101011000011000000000001101010110101010110000110000000000011010101101010101100001100000000000110101011010101011000011000000000001101010110101010110000110000000000011010101101010101100001100000000000110101011010101011000011000000000001101010110101010110000110000000000011010101101010101100001100000000000110101011010101011000011000000000001101010110101010110000110000000000011010101101010101100001100000000000110101011010101011000011000000000001101010110101010110000110000000000011010101000100011100001100000000000001101011010101011000011000000000000011010110101010110000110000000000000110101101010101100001100000000000001101011010101011000011000000000000011010110101010110000110000000000000110101101010101100001100000000000001101011010101011000011000000000000011010110101010110000110000000000000110101101010101100001100000000000001101011010101011000011000000000000011010110101010110000110000000000000110101101010101100001100000000000001101011010101011000011000000000000011010110101010110000110000000000000110101101010101100001100000000000001101011010101011000011000000000000011010110101010110000110000000000000110101101010101100001100000000000001101011010101011000011000000000000011010110101010110000110000000000000110101101010101100001100000000000001101011010101011000011000000000000011010110101010110000110000000000000110101101010101100001100000000000001101011010101011000011000000000000011010110101010110000110000000000000110101101010101100001100000000000001101011010101011000011000000000000011010110101010110000110000000000000110101101010101100001100000000000001101011010101011000011000000000000011010110001001110000110000000000010110101101010101100001100000000000101101011010101011000011000000000001011010110101010110000110000000000010110101101010101100001100000000000101101011010101011000011000000000001011010110101010110000110000000000010110101101010101100001100000000000101101011010101011000011000000000001011010110101010110000110000000000010110101101010101100001100000000000101101011010101011000011000000000001011010110101010110000110000000000010110101101010101100001100000000000101101011010101011000011000000000001011010110101010110000110000000000010110101101010101100001100000000000101101011010101011000011000000000001011010110101010110000110000000000010110101101010101100001100000000000101101011010101011000011000000000001011010110101010110000110000000000010110101101010101100001100000000000101101011010101011000011000000000001011010110101010110000110000000000010110101101010101100001100000000000101101011010101011000011000000000001011010111110010110000110000000000001110101101010101100001100000000000011101011010101011000011000000000000111010110101010110000110000000000001110101101010101100001100000000000011101011010101011000011000000000000111010110101010110000110000000000001110101101010101100001100000000000011101011010101011000011000000000000111010110101010110000110000000000001110101101010101100001100000000000011101011010101011000011000000000000111010110101010110000110000000000001110101101010101100001100000000000011101011010101011000011000000000000111010110101010110000110000000000001110101101010101100001100000000000011101011010101011000011000000000000111010110101010110000110000000000001110101101010101100001100000000000011101011010101011000011000000000000111010110101010110000110000000000001110101101010101100001100000000000011101011010101011000011000000000000111010110101010110000110000000000001110101101010101100001100000000000011101011010101011000011000000000000111010110101010110000110000000000001110101101010101100001100000000000011101011010101011000011000000000000111010110101010110000110000000000001110101101010101100001100000000000011101011010101011000011000000000000111010110101010110000110000000000001110101101010101100001100000000000011101011010101011000011000000000000111010110101010110000110000000000001110101000010101100001100000000000111100101010101011000011000000000001111001010101010110000110000000000011110010101010101100001100000000000111100101010101011000011000000000001111001010101010110000110000000000011110010101010101100001100000000000111100101010101011000011000000000001111001010101010110000110000000000011110010101010101100001100000000000111100101010101011000011000000000001111001010101010110000110000000000011110010101010101100001100000000000111100101010101011000011000000000001111001010101010110000110000000000011110010101010101100001100000000000111100101010101011000011000000000001111001010101010110000110000000000011110010101010101100001100000000000111100101010101011000011000000000001111001010101010110000110000000000011110010101010101100001100000000000111100101010101011000011000000000001111001010101010110000110000000000011110010101010101100001100000000000111100101010101011000011000000000001111001010101010110000110000000000011110010101010101100001100000000000111100101010101011000011000000000001111001010101010110000110000000000011110010101010101100001100000000000111100101010101011000011000000000001111001010101100110000110000000000000001010101010101100001100000000000000010101010101011000011000000000000000101010101010110000110000000000000001010101010101100001100000000000000010101010101011000011000000000000000101010101010110000110000000000000001010101010101100001100000000000000010101010101011000011000000000000000101010101010110000110000000000000001010101010101100001100000000000000010101010101011000011000000000000000101010101010110000110000000000000001010101010101100001100000000000000010101010101011000011000000000000000101010101010110000110000000000000001010101010101100001100000000000000010101010101011000011000000000000000101010101010110000110000000000000001010101010101100001100000000000000010101010101011000011000000000000000101010101010110000110000000000000001010101010101100001100000000000000010101010101011000011000000000000000101010101010110000110000000000000001010101010101100001100000000000000010101010101011000011000000000000000101010101010110000110000000000000001010101010101100001100000000000000010101010101011000011000000000000000101010101010110000110000000000000001010101010101100001100000000000000010100000100011000011000000000001111111101000000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001011101011010101011000011000000000000111010110101010110000110000000000001110101101010101100001100000000000011101011010101011000011000000000000111010110101010110000110000000000001110101101010101100001100000000000011101011010101011000011000000000000111010110101010110000110000000000001110101101010101100001100000000000011101011010101011000011000000000000111010110101010110000110000000000001110101101010101100001100000000000011101011010101011000011000000000000111010110101010110000110000000000001110101101010101100001100000000000011101011010101011000011000000000000111010110101010110000110000000000001110101101010101100001100000000000011101011010101011000011000000000000111010110101010110000110000000000001110101101010101100001100000000000011101011010101011000011000000000000111010110101010110000110000000000001110101101010101100001100000000000011101011010101011000011000000000000111010110101010110000110000000000001110101101010101100001100000000000011101011010101011000011000000000000111010110101010110000110000000000001110101101010101100001100000000000011101011010101011000011000000000000111010110101010110000110000000000001110101101010101100001100000000000011101011010101011000011000000000000111010110101010110000110000000000001110101101010101100001100000000000011101010000101011000011000000000001111010110101010110000110000000000011110101101010101100001100000000000111101011010101011000011000000000001111010110101010110000110000000000011110101101010101100001100000000000111101011010101011000011000000000001111010110101010110000110000000000011110101101010101100001100000000000111101011010101011000011000000000001111010110101010110000110000000000011110101101010101100001100000000000111101011010101011000011000000000001111010110101010110000110000000000011110101101010101100001100000000000111101011010101011000011000000000001111010110101010110000110000000000011110101101010101100001100000000000111101011010101011000011000000000001111010110101010110000110000000000011110101101010101100001100000000000111101011010101011000011000000000001111010110101010110000110000000000011110101101010101100001100000000000111101011010101011000011000000000001111010110101010110000110000000000011110101101010101100001100000000000111101010001110111000011000000000000000110110101010110000110000000000000001101101010101100001100000000000000011011010101011000011000000000000000110110101010110000110000000000000001101101010101100001100000000000000011011010101011000011000000000000000110110101010110000110000000000000001101101010101100001100000000000000011011010101011000011000000000000000110110101010110000110000000000000001101101010101100001100000000000000011011010101011000011000000000000000110110101010110000110000000000000001101101010101100001100000000000000011011010101011000011000000000000000110110101010110000110000000000000001101101010101100001100000000000000011011010101011000011000000000000000110110101010110000110000000000000001101101010101100001100000000000000011011010101011000011000000000000000110110101010110000110000000000000001101101010101100001100000000000000011011010101011000011000000000000000110110101010110000110000000000000001101101010101100001100000000000000011011010101011000011000000000000000110110101010110000110000000000000001101101010101100001100000000000000011011010101011000011000000000000000110110101010110000110000000000000001101101010101100001100000000000000011011010101011000011000000000000000110110101010110000110000000000000001101101010101100001100000000000000011011010101011000011000000000000000110111110001110000110000000000010001010101010101100001100000000000100010101010101011000011000000000001000101010101010110000110000000000010001010101010101100001100000000000100010101010101011000011000000000001000101010101010110000110000000000010001010101010101100001100000000000100010101010101011000011000000000001000101010101010110000110000000000010001010101010101100001100000000000100010101010101011000011000000000001000101010101010110000110000000000010001010101010101100001100000000000100010101010101011000011000000000001000101010101010110000110000000000010001010101010101100001100000000000100010101010101011000011000000000001000101010101010110000110000000000010001010101010101100001100000000000100010101010101011000011000000000001000101010101010110000110000000000010001010101010101100001100000000000100010101010101011000011000000000001000101010101010110000110000000000010001010101010101100001100000000000100010101010101011000011000000000001000101010101010110000110000000000010001010101010101100001100000000000100010101010101011000011000000000001000101010101010110000110000000000010001010101010101100001100000000000100010100110001111000011000000000000100101010101010110000110000000000001001010101010101100001100000000000010010101010101011000011000000000000100101010101010110000110000000000001001010101010101100001100000000000010010101010101011000011000000000000100101010101010110000110000000000001001010101010101100001100000000000010010101010101011000011000000000000100101010101010110000110000000000001001010101010101100001100000000000010010101010101011000011000000000000100101010101010110000110000000000001001010101010101100001100000000000010010101010101011000011000000000000100101010101010110000110000000000001001010101010101100001100000000000010010101010101011000011000000000000100101010101010110000110000000000001001010101010101100001100000000000010010101010101011000011000000000000100101010101010110000110000000000001001010101010101100001100000000000010010101010101011000011000000000000100101010101010110000110000000000001001010101010101100001100000000000010010101010101011000011000000000000100101010101010110000110000000000001001010101010101100001100000000000010010101010101011000011000000000000100101010101010110000110000000000001001010011011111100001100000000000110010101010101011000011000000000001100101010101010110000110000000000011001010101010101100001100000000000110010101010101011000011000000000001100101010101010110000110000000000011001010101010101100001100000000000110010101010101011000011000000000001100101010101010110000110000000000011001010101010101100001100000000000110010101010101011000011000000000001100101010101010110000110000000000011001010101010101100001100000000000110010101010101011000011000000000001100101010101010110000110000000000011001010101010101100001100000000000110010101010101011000011000000000001100101010101010110000110000000000011001010101010101100001100000000000110010101010101011000011000000000001100101010101010110000110000000000011001010101010101100001100000000000110010101010101011000011000000000001100101010101010110000110000000000011001010101010101100001100000000000110010101010101011000011000000000001100101010101010110000110000000000011001010101001001100001100000000000001010101010101011000011000000000000010101010101010110000110000000000000101010101010101100001100000000000001010101010101011000011000000000000010101010101010110000110000000000000101010101010101100001100000000000001010101010101011000011000000000000010101010101010110000110000000000000101010101010101100001100000000000001010101010101011000011000000000000010101010101010110000110000000000000101010101010101100001100000000000001010101010101011000011000000000000010101010101010110000110000000000000101010101010101100001100000000000001010101010101011000011000000000000010101010101010110000110000000000000101010101010101100001100000000000001010101010101011000011000000000000010101010101010110000110000000000000101010101010101100001100000000000001010101010101011000011000000000000010101010101010110000110000000000000101010101010101100001100000000000001010101010101011000011000000000000010101010101010110000110000000000000101010101010101100001100000000000001010101010101011000011000000000000010101010101010110000110000000000000101010101010101100001100000000000001010101010101011000011000000000000010101010101010110000110000000000000101010101010101100001100000000000001010101010101011000011000000000000010101010101010110000110000000000000101010101010101100001100000000000001010101011000011000011000000000001111111101101001110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011010101010101010110000110000000000010101010101010101100001100000000000101010101010101011000011000000000001010101010101010110000110000000000010101010101010101100001100000000000101010101010101011000011000000000001010101010101010110000110000000000010101010101010101100001100000000000101010101010101011000011000000000001010101010101010110000110000000000010101010101010101100001100000000000101010101010101011000011000000000001010101010101010110000110000000000010101010101010101100001100000000000101010101010101011000011000000000001010101010101010110000110000000000010101010101010101100001100000000000101010101010101011000011000000000001010101010101010110000110000000000010101010101010101100001100000000000101010101010101011000011000000000001010101010101010110000110000000000010101010101010101100001100000000000101010101010101011000011000000000001010101010101010110000110000000000010101010101010101100001100000000000101010101010101011000011000000000001010101010101010110000110000000000010101010101010101100001100000000000101010101010101011000011000000000001010101010101010110000110000000000010101010001101111100001100000000000011010101010101011000011000000000000110101010101010110000110000000000001101010101010101100001100000000000011010101010101011000011000000000000110101010101010110000110000000000001101010101010101100001100000000000011010101010101011000011000000000000110101010101010110000110000000000001101010101010101100001100000000000011010101010101011000011000000000000110101010101010110000110000000000001101010101010101100001100000000000011010101010101011000011000000000000110101010101010110000110000000000001101010101010101100001100000000000011010101010101011000011000000000000110101010101010110000110000000000001101010101010101100001100000000000011010101010101011000011000000000000110101010101010110000110000000000001101010101010101100001100000000000011010101010101011000011000000000000110101010101010110000110000000000001101010101010101100001100000000000011010101010101011000011000000000000110101010101010110000110000000000001101010101010101100001100000000000011010101010101011000011000000000000110101010101010110000110000000000001101010101010101100001100000000000011010101010101011000011000000000000110101010101010110000110000000000001101010101010101100001100000000000011010101010101011000011000000000000110101010101010110000110000000000001101010101010101100001100000000000011010100010010111000011000000000001110101010101010110000110000000000011101010101010101100001100000000000111010101010101011000011000000000001110101010101010110000110000000000011101010101010101100001100000000000111010101010101011000011000000000001110101010101010110000110000000000011101010101010101100001100000000000111010101010101011000011000000000001110101010101010110000110000000000011101010101010101100001100000000000111010101010101011000011000000000001110101010101010110000110000000000011101010101010101100001100000000000111010101010101011000011000000000001110101010101010110000110000000000011101010101010101100001100000000000111010101010101011000011000000000001110101010101010110000110000000000011101010101010101100001100000000000111010101010101011000011000000000001110101010101010110000110000000000011101010101010101100001100000000000111010101010101011000011000000000001110101010101010110000110000000000011101010101010101100001100000000000111010101011011111000011000000000000101001011111101110000110000000010101010010111111111100001100000000101010100101111111111000011000000001010101001011111111110000110000000010101010010111111111100001100000000101010100101111111111000011000000001010101001011111111110000110000000010101010010111111111100001100000000101010100101111111111000011000000001010101001011111111110000110000000010101010010111111111100001100000000101010100101111111111000011000000001010101001011111111110000110000000010101010010111111111100001100000000101010100101111111111000011000000001010101001011111111110000110000000010101010010111111111100001100000000101010100101111111111000011000000001010101001011111111110000110000000010101010010111111111100001100000000101010100101111111111000011000000001010101001011111111110000110000000010101010010111111111100001100000000101010100101111111111000011000000001010101001011111111110000110000000010101010010111111111100001100000000101010100101111111111000011000000001010101001011111111110000110000000010101010010111111111100001100000000101010100101111111111000011000000001010101001011111111110000110000000010101010010111111111100001100000000101110100100011011111000011000000001011101001000110111110000110000000010111010010001101111100001100000000101110100100011011111000011000000001011101001000110111110000110000000010111010010001101111100001100000000101110100100011011111000011000000001011101001000110111110000110000000010111010010001101111100001100000000101110100100011011111000011000000001011101001000110111110000110000000010111010010001101111100001100000000101110100100011011111000011000000001011101001000110111110000110000000010111010010001101111100001100000000101110100100011011111000011000000001011101001000110111110000110000000010111010010001101111100001100000000101110100100011011111000011000000001011101001000110111110000110000000010111010010001101111100001100000000101110100100011011111000011000000001011101001000110111110000110000000010111010010001101111100001100000000101110100100011011111000011000000001011101001000110111110000110000000010111010010001101111100001100000000101110100100011011111000011000000001011101001000110111110000110000000010111010010001101111100001100000000101110100100011011111000011000000001011101001000110111110000110000000010111101010101010101100001100000000000111010101010101011000011000000000001110101010101010110000110000000000011101010101010101100001100000000000111010101010101011000011000000000001110101010101010110000110000000000011101010101010101100001100000000000111010101010101011000011000000000001110101010101010110000110000000000011101010101010101100001100000000000111010101010101011000011000000000001110101010101010110000110000000000011101010101010101100001100000000000111010101010101011000011000000000001110101010101010110000110000000000011101010101010101100001100000000000111010101010101011000011000000000001110101010101010110000110000000000011101010101010101100001100000000000111010101010101011000011000000000001110101010101010110000110000000000011101010101010101100001100000000000111010101010101011000011000000000001110101010101010110000110000000000011101010101010101100001100000000000111010101010101011000011000000000001110101010101010110000110000000000011101010101010101100001100000000000111010101010101011000011000000000001110101010101010110000110000000000011101010101010101100001100000000000111010101011011111000011000000000000001101010101010110000110000000000000011010101010101100001100000000000000110101010101011000011000000000000001101010101010110000110000000000000011010101010101100001100000000000000110101010101011000011000000000000001101010101010110000110000000000000011010101010101100001100000000000000110101010101011000011000000000000001101010101010110000110000000000000011010101010101100001100000000000000110101010101011000011000000000000001101010101010110000110000000000000011010101010101100001100000000000000110101010101011000011000000000000001101010101010110000110000000000000011010101010101100001100000000000000110101010101011000011000000000000001101010101010110000110000000000000011010101010101100001100000000000000110101010101011000011000000000000001101010101010110000110000000000000011010101010101100001100000000000000110101010101011000011000000000000001101010101010110000110000000000000011010101010101100001100000000000000110101010101011000011000000000000001101010101010110000110000000000000011010101010101100001100000000000000110101010101011000011000000000000001101010101010110000110000000000000011010101010101100001100000000000000110101010101011000011000000000000001101010101010110000110000000000000011010101010101100001100000000000000110101010101011000011000000000000001101001100000110000110000000000010011010101010101100001100000000000100110101010101011000011000000000001001101010101010110000110000000000010011010101010101100001100000000000100110101010101011000011000000000001001101010101010110000110000000000010011010101010101100001100000000000100110101010101011000011000000000001001101010101010110000110000000000010011010101010101100001100000000000100110101010101011000011000000000001001101010101010110000110000000000010011010101010101100001100000000000100110101010101011000011000000000001001101010101010110000110000000000010011010101010101100001100000000000100110101010101011000011000000000001001101010101010110000110000000000010011010101010101100001100000000000100110101010101011000011000000000001001101010101010110000110000000000010011010101010101100001100000000000100110101010101011000011000000000001001101010101010110000110000000000010011010101010101100001100000000000100110101010101011000011000000000001001101011110010110000110000000000011111111111110101100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000010111110110101010110000011111111100001111101101010101100000111111111000011111011010101011000001111111110000111110110101010110000011111111100001111101101010101100000111111111000011111011010101011000001111111110000111110110101010110000011111111100001111101101010101100000111111111000011111011010101011000001111111110000111110110101010110000011111111100001111101101010101100000111111111000011111011010101011000001111111110000111110110101010110000011111111100001111101101010101100000111111111000011111011010101011000001111111110000111110110101010110000011111111100001111101101010101100000111111111000011111011010101011000001111111110000111110110101010110000011111111100001111101101010101100000111111111000011111011010101011000001111111110000111110110101010110000011111111100001111101101010101100000111111111000011111011010101011000001111111110000111110110101010110000011111111100001111101101010101100000111111111000011111011010101011000001111111110000111110110101010110000011111111100001111101101010101100000111111111000011111011010101011000001111111110000111110110101010110000011111111100001111101101010101100000111111111000011111011010101011000001111111110000111110110101010110000011111111100001111101011001111100000111111111000111111011010101011000001001101110001111110110101010110000010011011100011111101101010101100000100110111000111111011010101011000001001101110001111110110101010110000010011011100011111101101010101100000100110111000111111011010101011000001001101110001111110110101010110000010011011100011111101101010101100000100110111000111111011010101011000001001101110001111110110101010110000010011011100011111101101010101100000100110111000111111011010101011000001001101110001111110110101010110000010011011100011111101101010101100000100110111000111111011010101011000001001101110001111110110101010110000010011011100011111101101010101100000100110111000111111011010101011000001001101110001111110110101010110000010011011100011111101101010101100000100110111000111111011010101011000001001101110001111110110101010110000010011011100011111101101010101100000100110111000111111011010101011000001001101110001111110110101010110000010011011100011111101101010101100000100110111000111111011010101011000001001101110001111110110101010110000010011011100011111101101010101100000100110111000111111011010101011000001001101110001111110111111111110000010011011100010011010101010101100001100000000000100110101010101011000011000000000001001101010101010110000110000000000010011010101010101100001100000000000100110101010101011000011000000000001001101010101010110000110000000000010011010101010101100001100000000000100110101010101011000011000000000001001101010101010110000110000000000010011010101010101100001100000000000100110101010101011000011000000000001001101010101010110000110000000000010011010101010101100001100000000000100110101010101011000011000000000001001101010101010110000110000000000010011010101010101100001100000000000100110101010101011000011000000000001001101010101010110000110000000000010011010101010101100001100000000000100110101010101011000011000000000001001101010101010110000110000000000010011010101010101100001100000000000100110101010101011000011000000000001001101010101010110000110000000000010011010101010101100001100000000000100110101010101011000011000000000001001101010101010110000110000000000010011010101010101100001100000000000100110101010101011000011000000000001001101010101010110000110000000000010011010101010101100001100000000000100110101010101011000011000000000001001101010101010110000110000000000010011010111100101100001100000000000010110101010101011000011000000000000101101010101010110000110000000000001011010101010101100001100000000000010110101010101011000011000000000000101101010101010110000110000000000001011010101010101100001100000000000010110101010101011000011000000000000101101010101010110000110000000000001011010101010101100001100000000000010110101010101011000011000000000000101101010101010110000110000000000001011010101010101100001100000000000010110101010101011000011000000000000101101010101010110000110000000000001011010101010101100001100000000000010110101010101011000011000000000000101101010101010110000110000000000001011010101010101100001100000000000010110101010101011000011000000000000101101010101010110000110000000000001011010101010101100001100000000000010110101010101011000011000000000000101101010101010110000110000000000001011010101010101100001100000000000010110101010101011000011000000000000101101010101010110000110000000000001011010101010101100001100000000000010110101010101011000011000000000000101101010101010110000110000000000001011010101010101100001100000000000010110101010101011000011000000000000101101001100111110000110000000000001011010101010101100001100000000000010110101010101011000011000000000000101101010101010110000110000000000001011010101010101100001100000000000010110101010101011000011000000000000101101010101010110000110000000000001011010101010101100001100000000000010110101010101011000011000000000000101101010101010110000110000000000001011010101010101100001100000000000010110101010101011000011000000000000101101010101010110000110000000000001011010101010101100001100000000000010110101010101011000011000000000000101101010101010110000110000000000001011010101010101100001100000000000010110101010101011000011000000000000101101010101010110000110000000000001011010101010101100001100000000000010110101010101011000011000000000000101101010101010110000110000000000001011010101010101100001100000000000010110101010101011000011000000000000101101010101010110000110000000000001011010101010101100001100000000000010110101010101011000011000000000000101101001100111110000110000000000011011010101010101100001100000000000110110101010101011000011000000000001101101010101010110000110000000000011011010101010101100001100000000000110110101010101011000011000000000001101101010101010110000110000000000011011010101010101100001100000000000110110101010101011000011000000000001101101010101010110000110000000000011011010101010101100001100000000000110110101010101011000011000000000001101101010101010110000110000000000011011010101010101100001100000000000110110101010101011000011000000000001101101010101010110000110000000000011011010101010101100001100000000000110110101010101011000011000000000001101101010101010110000110000000000011011010101010101100001100000000000110110101010101011000011000000000001101101010101010110000110000000000011011010101010101100001100000000000110110101010101011000011000000000001101101010101010110000110000000000011011010101010101100001100000000000110110101010101011000011000000000001101101010101010110000110000000000011011010101010101100001100000000000110110101010101011000011000000000001101101010101010110000110000000000011011010101010101100001100000000000110110101111110011000011000000000000011101010101010110000110000000000000111010101010101100001100000000000001110101010101011000011000000000000011101010101010110000110000000000000111010101010101100001100000000000001110101010101011000011000000000000011101010101010110000110000000000000111010101010101100001100000000000001110101010101011000011000000000000011101010101010110000110000000000000111010101010101100001100000000000001110101010101011000011000000000000011101010101010110000110000000000000111010101010101100001100000000000001110101010101011000011000000000000011101010101010110000110000000000000111010101010101100001100000000000001110101010101011000011000000000000011101010101010110000110000000000000111010101010101100001100000000000001110101010101011000011000000000000011101010101010110000110000000000000111010101010101100001100000000000001110101010101011000011000000000000011101010101010110000110000000000000111010101010101100001100000000000001110101010101011000011000000000000011101010101010110000110000000000000111010101010101100001100000000000001110101010101011000011000000000000011101010101010110000110000000000000111010101010101100001100000000000001110101010101011000011000000000000011101010101010110000110000000000000111010101010101100001100000000000001110101010101011000011000000000000011101010110111110000110000000000011111111111001001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000111111111110110001100001100000000001111111111101100011000011000000000011111111111011000110000110000000000110010010111000001100001100000000101100100101110000011000011000000001011001001011100000110000110000000010110010010111000001100001100000000101100100101110000011000011000000001011001001011100000110000110000000010110010010111000001100001100000000101100100101110000011000011000000001011001001011100000110000110000000010110010010111000001100001100000000101100100101110000011000011000000001011001001011100000110000110000000010110010010111000001100001100000000101100100101110000011000011000000001011001001011100000110000110000000010110010010111000001100001100000000101100100101110000011000011000000001011001001011100000110000110000000010110010010111000001100001100000000101100100101110000011000011000000001011001001011100000110000110000000010110010010111000001100001100000000101100100101110000011000011000000001011001001011100000110000110000000010110010010111000001100001100000000101100100101110000011000011000000001011001001011100000110000110000000010110010010111000001100001100000000101100100101110000011000011000000001011001001011100000110000110000000010110010010111000001100001100000000101100100101110000011000011000000001010011101010101010110000110000000000000111010101010101100001000000000000001110101010101011000010000000000000011101010101010110000100000000000000111010101010101100001000000000000001110101010101011000010000000000000011101010101010110000100000000000000111010101010101100001000000000000001110101010101011000010000000000000011101010101010110000100000000000000111010101010101100001000000000000001110101010101011000010000000000000011101010101010110000100000000000000111010101010101100001000000000000001110101010101011000010000000000000011101010101010110000100000000000000111010101010101100001000000000000001110101010101011000010000000000000011101010101010110000100000000000000111010101010101100001000000000000001110101010101011000010000000000000011101010101010110000100000000000000111010101010101100001000000000000001110101010101011000010000000000000011101010101010110000100000000000000111010101010101100001000000000000001110101010101011000010000000000000011101010101010110000100000000000000111010101010101100001000000000000001110101010101011000010000000000000011101010101010110000100000000000000111010101101111100001000000000000101110101010101011000010000000000001011101010101010110000100000000000010111010101010101100001000000000000101110101010101011000010000000000001011101010101010110000100000000000010111010101010101100001000000000000101110101010101011000010000000000001011101010101010110000100000000000010111010101010101100001000000000000101110101010101011000010000000000001011101010101010110000100000000000010111010101010101100001000000000000101110101010101011000010000000000001011101010101010110000100000000000010111010101010101100001000000000000101110101010101011000010000000000001011101010101010110000100000000000010111010101010101100001000000000000101110101010101011000010000000000001011101010101010110000100000000000010111010101010101100001000000000000101110101010101011000010000000000001011101010101010110000100000000000010111010101010101100001000000000000101110101010101011000010000000000001011101010101010110000100000000000010111010101010101100001000000000000101110101010101011000010000000000001011101010101010110000100000000000010111010101010101100001000000000000101110101010101011000010000000000001011101000100000110000100000000000001111010101010101100001000000000000011110101010101011000010000000000000111101010101010110000100000000000001111010101010101100001000000000000011110101010101011000010000000000000111101010101010110000100000000000001111010101010101100001000000000000011110101010101011000010000000000000111101010101010110000100000000000001111010101010101100001000000000000011110101010101011000010000000000000111101010101010110000100000000000001111010101010101100001000000000000011110101010101011000010000000000000111101010101010110000100000000000001111010101010101100001000000000000011110101010101011000010000000000000111101010101010110000100000000000001111010101010101100001000000000000011110101010101011000010000000000000111101010101010110000100000000000001111010101010101100001000000000000011110101010101011000010000000000000111101010101010110000100000000000001111010101010101100001000000000000011110101010101011000010000000000000111101010101010110000100000000000001111010101010101100001000000000000011110101010101011000010000000000000111101010101010110000100000000000001111010101010101100001000000000000011110101010101011000010000000000000111101010101010110000100000000000001111010101010101100001000000000000011110101010101011000010000000000000111101010101010110000100000000000001111010001100101100001000000000000111111110110101111000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001001111011010101011000000000000000000011110110101010110000000000000000000111101101010101100000000000000000001111011010101011000000000000000000011110110101010110000000000000000000111101101010101100000000000000000001111011010101011000000000000000000011110110101010110000000000000000000111101101010101100000000000000000001111011010101011000000000000000000011110110101010110000000000000000000111101101010101100000000000000000001111011010101011000000000000000000011110110101010110000000000000000000111101101010101100000000000000000001111011010101011000000000000000000011110110101010110000000000000000000111101101010101100000000000000000001111011010101011000000000000000000011110110101010110000000000000000000111101101010101100000000000000000001111011010101011000000000000000000011110110101010110000000000000000000111101101010101100000000000000000001111011010101011000000000000000000011110110101010110000000000000000000111101101010101100000000000000000001111011010101011000000000000000000011110110101010110000000000000000000111101101010101100000000000000000001111011010101011000000000000000000011110110101010110000000000000000000111101101010101100000000000000000001111011010101011000000000000000000011110110110111110000000000000000010111101101010101100000011100000000101111011010101011000000111000000001011110110101010110000001110000000010111101101010101100000011100000000101111011010101011000000111000000001011110110101010110000001110000000010111101101010101100000011100000000101111011010101011000000111000000001011110110101010110000001110000000010111101101010101100000011100000000101111011010101011000000111000000001011110110101010110000001110000000010111101101010101100000011100000000101111011010101011000000111000000001011110110101010110000001110000000010111101101010101100000011100000000101111011010101011000000111000000001011110110101010110000001110000000010111101101010101100000011100000000101111011010101011000000111000000001011110110101010110000001110000000010111101101010101100000011100000000101111011010101011000000111000000001011110110101010110000001110000000010111101101010101100000011100000000101111011010101011000000111000000001011110110101010110000001110000000010111101101010101100000011100000000101111011010101011000000111000000001011110110101010110000001110000000010111101101010101100000011100000000101111010000000011000000111000000000111101010101010110000100000000000001111010101010101100001000000000000011110101010101011000010000000000000111101010101010110000100000000000001111010101010101100001000000000000011110101010101011000010000000000000111101010101010110000100000000000001111010101010101100001000000000000011110101010101011000010000000000000111101010101010110000100000000000001111010101010101100001000000000000011110101010101011000010000000000000111101010101010110000100000000000001111010101010101100001000000000000011110101010101011000010000000000000111101010101010110000100000000000001111010101010101100001000000000000011110101010101011000010000000000000111101010101010110000100000000000001111010101010101100001000000000000011110101010101011000010000000000000111101010101010110000100000000000001111010101010101100001000000000000011110101010101011000010000000000000111101010101010110000100000000000001111010101010101100001000000000000011110101010101011000010000000000000111101010101010110000100000000000001111010101010101100001000000000000011110101010101011000010000000000000111101010101010110000100000000000001111010101010101100001000000000000011110101010101011000010000000000000111101000110010110000100000000000011111010101010101100001000000000000111110101010101011000010000000000001111101010101010110000100000000000011111010101010101100001000000000000111110101010101011000010000000000001111101010101010110000100000000000011111010101010101100001000000000000111110101010101011000010000000000001111101010101010110000100000000000011111010101010101100001000000000000111110101010101011000010000000000001111101010101010110000100000000000011111010101010101100001000000000000111110101010101011000010000000000001111101010101010110000100000000000011111010101010101100001000000000000111110101010101011000010000000000001111101010101010110000100000000000011111010101010101100001000000000000111110101010101011000010000000000001111101010101010110000100000000000011111010101010101100001000000000000111110101010101011000010000000000001111101010101010110000100000000000011111010101010101100001000000000000111110101010101011000010000000000001111101011111010110000100000000000011111010101010101100001000000000000111110101010101011000010000000000001111101010101010110000100000000000011111010101010101100001000000000000111110101010101011000010000000000001111101010101010110000100000000000011111010101010101100001000000000000111110101010101011000010000000000001111101010101010110000100000000000011111010101010101100001000000000000111110101010101011000010000000000001111101010101010110000100000000000011111010101010101100001000000000000111110101010101011000010000000000001111101010101010110000100000000000011111010101010101100001000000000000111110101010101011000010000000000001111101010101010110000100000000000011111010101010101100001000000000000111110101010101011000010000000000001111101010101010110000100000000000011111010101010101100001000000000000111110101010101011000010000000000001111101010101010110000100000000000011111010101010101100001000000000000111110101010101011000010000000000001111101010101010110000100000000000011111010101010101100001000000000000111110101010101011000010000000000001111101010101010110000100000000000011111010101010101100001000000000000111110101111101011000010000000000000000011010101010110000100000000000000000110101010101100001000000000000000001101010101011000010000000000000000011010101010110000100000000000000000110101010101100001000000000000000001101010101011000010000000000000000011010101010110000100000000000000000110101010101100001000000000000000001101010101011000010000000000000000011010101010110000100000000000000000110101010101100001000000000000000001101010101011000010000000000000000011010101010110000100000000000000000110101010101100001000000000000000001101010101011000010000000000000000011010101010110000100000000000000000110101010101100001000000000000000001101010101011000010000000000000000011010101010110000100000000000000000110101010101100001000000000000000001101010101011000010000000000000000011010101010110000100000000000000000110101010101100001000000000000000001101010101011000010000000000000000011010101010110000100000000000000000110101010101100001000000000000000001101010101011000010000000000000000011010101010110000100000000000000000110101010101100001000000000000000001101010101011000010000000000000000011010101010110000100000000000000000110101010101100001000000000000000001101010101011000010000000000000000011010101010110000100000000000000000110101010101100001000000000000000001101010101011000010000000000000000011010110111110000100000000000000000110101010101100001000000000000000001101010101011000010000000000000000011010101010110000100000000000000000110101010101100001000000000000000001101010101011000010000000000000000011010101010110000100000000000000000110101010101100001000000000000000001101010101011000010000000000000000011010101010110000100000000000000000110101010101100001000000000000000001101010101011000010000000000000000011010101010110000100000000000000000110101010101100001000000000000000001101010101011000010000000000000000011010101010110000100000000000000000110101010101100001000000000000000001101010101011000010000000000000000011010101010110000100000000000000000110101010101100001000000000000000001101010101011000010000000000000000011010101010110000100000000000000000110101010101100001000000000000000001101010101011000010000000000000000011010101010110000100000000000000000110101010101100001000000000000000001101010101011000010000000000000000011010110111110000100000000000010000110101010101100001000000000000100001101010101011000010000000000001000011010101010110000100000000000010000110101010101100001000000000000100001101010101011000010000000000001000011010101010110000100000000000010000110101010101100001000000000000100001101010101011000010000000000001000011010101010110000100000000000010000110101010101100001000000000000100001101010101011000010000000000001000011010101010110000100000000000010000110101010101100001000000000000100001101010101011000010000000000001000011010101010110000100000000000010000110101010101100001000000000000100001101010101011000010000000000001000011010101010110000100000000000010000110101010101100001000000000000100001101010101011000010000000000001000011010101010110000100000000000010000110101010101100001000000000000100001101010101011000010000000000001000011010101010110000100000000000010000110101010101100001000000000000100001101010101011000010000000000001000011010101010110000100000000000010000110101010101100001000000000000100001101010101011000010000000000001000011010101010110000100000000000010000110101010101100001000000000000100001101000000011000010000000000000100011010101010110000100000000000001000110101010101100001000000000000010001101010101011000010000000000000100011010101010110000100000000000001000110101010101100001000000000000010001101010101011000010000000000000100011010101010110000100000000000001000110101010101100001000000000000010001101010101011000010000000000000100011010101010110000100000000000001000110101010101100001000000000000010001101010101011000010000000000000100011010101010110000100000000000001000110101010101100001000000000000010001101010101011000010000000000000100011010101010110000100000000000001000110101010101100001000000000000010001101010101011000010000000000000100011010101010110000100000000000001000110101010101100001000000000000010001101010101011000010000000000000100011010101010110000100000000000001000110101010101100001000000000000010001101010101011000010000000000000100011010101010110000100000000000001000110101010101100001000000000000010001101010101011000010000000000000100011010101010110000100000000000001000110101010101100001000000000000010001101010101011000010000000000000100011010101010110000100000000000001000110101010101100001000000000000010001101010101011000010000000000000100011010101010110000100000000000001000110101010101100001000000000000010001101010101011000010000000000000100011010011100110000100000000000011111111000010111100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000110011101101010101100000010000000000100111011010101011000000100000000001001110110101010110000001000000000010011101101010101100000010000000000100111011010101011000000100000000001001110110101010110000001000000000010011101101010101100000010000000000100111011010101011000000100000000001001110110101010110000001000000000010011101101010101100000010000000000100111011010101011000000100000000001001110110101010110000001000000000010011101101010101100000010000000000100111011010101011000000100000000001001110110101010110000001000000000010011101101010101100000010000000000100111011010101011000000100000000001001110110101010110000001000000000010011101101010101100000010000000000100111011010101011000000100000000001001110110101010110000001000000000010011101101010101100000010000000000100111011010101011000000100000000001001110110101010110000001000000000010011101101010101100000010000000000100111011010101011000000100000000001001110110101010110000001000000000010011101101010101100000010000000000100111011010101011000000100000000001001110110101010110000001000000000010011101101010101100000010000000000100111011010101011000000100000000001001110110101010110000001000000000010011101101010101100000010000000000100111011000000011000000100000000000101110110101010110000000000000000001011101101010101100000000000000000010111011010101011000000000000000000101110110101010110000000000000000001011101101010101100000000000000000010111011010101011000000000000000000101110110101010110000000000000000001011101101010101100000000000000000010111011010101011000000000000000000101110110101010110000000000000000001011101101010101100000000000000000010111011010101011000000000000000000101110110101010110000000000000000001011101101010101100000000000000000010111011010101011000000000000000000101110110101010110000000000000000001011101101010101100000000000000000010111011010101011000000000000000000101110110101010110000000000000000001011101101010101100000000000000000010111011010101011000000000000000000101110110101010110000000000000000001011101101010101100000000000000000010111011010101011000000000000000000101110110101010110000000000000000001011101101010101100000000000000000010111011010101011000000000000000000101110110101010110000000000000000001011101101010101100000000000000000010111011010101011000000000000000000101110110101010110000000000000000001011101100000001100000000000000000010001101010101011000010000000000000100011010101010110000100000000000001000110101010101100001000000000000010001101010101011000010000000000000100011010101010110000100000000000001000110101010101100001000000000000010001101010101011000010000000000000100011010101010110000100000000000001000110101010101100001000000000000010001101010101011000010000000000000100011010101010110000100000000000001000110101010101100001000000000000010001101010101011000010000000000000100011010101010110000100000000000001000110101010101100001000000000000010001101010101011000010000000000000100011010101010110000100000000000001000110101010101100001000000000000010001101010101011000010000000000000100011010101010110000100000000000001000110101010101100001000000000000010001101010101011000010000000000000100011010101010110000100000000000001000110101010101100001000000000000010001101010101011000010000000000000100011010101010110000100000000000001000110101010101100001000000000000010001101010101011000010000000000000100011010101010110000100000000000001000110101010101100001000000000000010001101010101011000010000000000000100011010101010110000100000000000001000110101010101100001000000000000010001101001110011000010000000000001100011010101010110000100000000000011000110101010101100001000000000000110001101010101011000010000000000001100011010101010110000100000000000011000110101010101100001000000000000110001101010101011000010000000000001100011010101010110000100000000000011000110101010101100001000000000000110001101010101011000010000000000001100011010101010110000100000000000011000110101010101100001000000000000110001101010101011000010000000000001100011010101010110000100000000000011000110101010101100001000000000000110001101010101011000010000000000001100011010101010110000100000000000011000110101010101100001000000000000110001101010101011000010000000000001100011010101010110000100000000000011000110101010101100001000000000000110001101010101011000010000000000001100011010101010110000100000000000011000110101010101100001000000000000110001101010101011000010000000000001100011010101010110000100000000000011000110101010101100001000000000000110001100010110011000010000000000000000110110101010110000100000000000000001101101010101100001000000000000000011011010101011000010000000000000000110110101010110000100000000000000001101101010101100001000000000000000011011010101011000010000000000000000110110101010110000100000000000000001101101010101100001000000000000000011011010101011000010000000000000000110110101010110000100000000000000001101101010101100001000000000000000011011010101011000010000000000000000110110101010110000100000000000000001101101010101100001000000000000000011011010101011000010000000000000000110110101010110000100000000000000001101101010101100001000000000000000011011010101011000010000000000000000110110101010110000100000000000000001101101010101100001000000000000000011011010101011000010000000000000000110110101010110000100000000000000001101101010101100001000000000000000011011010101011000010000000000000000110110101010110000100000000000000001101101010101100001000000000000000011011010101011000010000000000000000110110101010110000100000000000000001101101010101100001000000000000000011011010101011000010000000000000000110110101010110000100000000000000001101101010101100001000000000000000011011010101011000010000000000000000110110101010110000100000000000000001101101010101100001000000000000000011011010101011000010000000000000000110111110001110000100000000000010001101101010101100001000000000000100011011010101011000010000000000001000110110101010110000100000000000010001101101010101100001000000000000100011011010101011000010000000000001000110110101010110000100000000000010001101101010101100001000000000000100011011010101011000010000000000001000110110101010110000100000000000010001101101010101100001000000000000100011011010101011000010000000000001000110110101010110000100000000000010001101101010101100001000000000000100011011010101011000010000000000001000110110101010110000100000000000010001101101010101100001000000000000100011011010101011000010000000000001000110110101010110000100000000000010001101101010101100001000000000000100011011010101011000010000000000001000110110101010110000100000000000010001101101010101100001000000000000100011011010101011000010000000000001000110110101010110000100000000000010001101101010101100001000000000000100011011010101011000010000000000001000110100101001110000100000000000011111111111111111100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000010010100110101010110000100000000000000101001101010101100001000000000000001010011010101011000010000000000000010100110101010110000100000000000000101001101010101100001000000000000001010011010101011000010000000000000010100110101010110000100000000000000101001101010101100001000000000000001010011010101011000010000000000000010100110101010110000100000000000000101001101010101100001000000000000001010011010101011000010000000000000010100110101010110000100000000000000101001101010101100001000000000000001010011010101011000010000000000000010100110101010110000100000000000000101001101010101100001000000000000001010011010101011000010000000000000010100110101010110000100000000000000101001101010101100001000000000000001010011010101011000010000000000000010100110101010110000100000000000000101001101010101100001000000000000001010011010101011000010000000000000010100110101010110000100000000000000101001101010101100001000000000000001010011010101011000010000000000000010100110101010110000100000000000000101001101010101100001000000000000001010011010101011000010000000000000010100110101010110000100000000000000101001101010101100001000000000000001010011010101011000010000000000000010100110101010110000100000000000000101001101010101100001000000000000001010011010101011000010000000000000010100110101100110000100000000000010101001101010101100001000000000000101010011010101011000010000000000001010100110101010110000100000000000010101001101010101100001000000000000101010011010101011000010000000000001010100110101010110000100000000000010101001101010101100001000000000000101010011010101011000010000000000001010100110101010110000100000000000010101001101010101100001000000000000101010011010101011000010000000000001010100110101010110000100000000000010101001101010101100001000000000000101010011010101011000010000000000001010100110101010110000100000000000010101001101010101100001000000000000101010011010101011000010000000000001010100110101010110000100000000000010101001101010101100001000000000000101010011010101011000010000000000001010100110101010110000100000000000010101001101010101100001000000000000101010011010101011000010000000000001010100110101010110000100000000000010101001101010101100001000000000000101010011010101011000010000000000001010100100000110110000100000000000011111111010110101100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001010011011010101011000010000000000000100110110101010110000100000000000001001101101010101100001000000000000010011011010101011000010000000000000100110110101010110000100000000000001001101101010101100001000000000000010011011010101011000010000000000000100110110101010110000100000000000001001101101010101100001000000000000010011011010101011000010000000000000100110110101010110000100000000000001001101101010101100001000000000000010011011010101011000010000000000000100110110101010110000100000000000001001101101010101100001000000000000010011011010101011000010000000000000100110110101010110000100000000000001001101101010101100001000000000000010011011010101011000010000000000000100110110101010110000100000000000001001101101010101100001000000000000010011011010101011000010000000000000100110110101010110000100000000000001001101101010101100001000000000000010011011010101011000010000000000000100110110101010110000100000000000001001101101010101100001000000000000010011011010101011000010000000000000100110110101010110000100000000000001001101101010101100001000000000000010011011010101011000010000000000000100110110101010110000100000000000001001101101010101100001000000000000010011011010101011000010000000000000100110110101010110000100000000000001001101101010101100001000000000000010011011011101011000010000000000001100110110101010110000100000000000011001101101010101100001000000000000110011011010101011000010000000000001100110110101010110000100000000000011001101101010101100001000000000000110011011010101011000010000000000001100110110101010110000100000000000011001101101010101100001000000000000110011011010101011000010000000000001100110110101010110000100000000000011001101101010101100001000000000000110011011010101011000010000000000001100110110101010110000100000000000011001101101010101100001000000000000110011011010101011000010000000000001100110110101010110000100000000000011001101101010101100001000000000000110011011010101011000010000000000001100110110101010110000100000000000011001101101010101100001000000000000110011011010101011000010000000000001100110110101010110000100000000000011001101101010101100001000000000000110011011010101011000010000000000001100110110101010110000100000000000011001101101010101100001000000000000110011010000000111000010000000000000010110110101010110000100000000000000101101101010101100001000000000000001011011010101011000010000000000000010110110101010110000100000000000000101101101010101100001000000000000001011011010101011000010000000000000010110110101010110000100000000000000101101101010101100001000000000000001011011010101011000010000000000000010110110101010110000100000000000000101101101010101100001000000000000001011011010101011000010000000000000010110110101010110000100000000000000101101101010101100001000000000000001011011010101011000010000000000000010110110101010110000100000000000000101101101010101100001000000000000001011011010101011000010000000000000010110110101010110000100000000000000101101101010101100001000000000000001011011010101011000010000000000000010110110101010110000100000000000000101101101010101100001000000000000001011011010101011000010000000000000010110110101010110000100000000000000101101101010101100001000000000000001011011010101011000010000000000000010110110101010110000100000000000000101101101010101100001000000000000001011011010101011000010000000000000010110110101010110000100000000000000101101101010101100001000000000000001011011010101011000010000000000000010110110101010110000100000000000000101101101010101100001000000000000001011011010101011000010000000000000010110100111010110000100000000000010101101101010101100001000000000000101011011010101011000010000000000001010110110101010110000100000000000010101101101010101100001000000000000101011011010101011000010000000000001010110110101010110000100000000000010101101101010101100001000000000000101011011010101011000010000000000001010110110101010110000100000000000010101101101010101100001000000000000101011011010101011000010000000000001010110110101010110000100000000000010101101101010101100001000000000000101011011010101011000010000000000001010110110101010110000100000000000010101101101010101100001000000000000101011011010101011000010000000000001010110110101010110000100000000000010101101101010101100001000000000000101011011010101011000010000000000001010110110101010110000100000000000010101101101010101100001000000000000101011011010101011000010000000000001010110110101010110000100000000000010101101101010101100001000000000000101011011010101011000010000000000001010110111111100110000100000000000001101101101010101100001000000000000011011011010101011000010000000000000110110110101010110000100000000000001101101101010101100001000000000000011011011010101011000010000000000000110110110101010110000100000000000001101101101010101100001000000000000011011011010101011000010000000000000110110110101010110000100000000000001101101101010101100001000000000000011011011010101011000010000000000000110110110101010110000100000000000001101101101010101100001000000000000011011011010101011000010000000000000110110110101010110000100000000000001101101101010101100001000000000000011011011010101011000010000000000000110110110101010110000100000000000001101101101010101100001000000000000011011011010101011000010000000000000110110110101010110000100000000000001101101101010101100001000000000000011011011010101011000010000000000000110110110101010110000100000000000001101101101010101100001000000000000011011011010101011000010000000000000110110110101010110000100000000000001101101101010101100001000000000000011011011010101011000010000000000000110110110101010110000100000000000001101101101010101100001000000000000011011011010101011000010000000000000110110110101010110000100000000000001101101101010101100001000000000000011011011010101011000010000000000000110110110101010110000100000000000001101101111100011100001000000000000011010011010101011000010000000000000110100110101010110000100000000000001101001101010101100001000000000000011010011010101011000010000000000000110100110101010110000100000000000001101001101010101100001000000000000011010011010101011000010000000000000110100110101010110000100000000000001101001101010101100001000000000000011010011010101011000010000000000000110100110101010110000100000000000001101001101010101100001000000000000011010011010101011000010000000000000110100110101010110000100000000000001101001101010101100001000000000000011010011010101011000010000000000000110100110101010110000100000000000001101001101010101100001000000000000011010011010101011000010000000000000110100110101010110000100000000000001101001101010101100001000000000000011010011010101011000010000000000000110100110101010110000100000000000001101001101010101100001000000000000011010011010101011000010000000000000110100110101010110000100000000000001101001101010101100001000000000000011010011010101011000010000000000000110100110101010110000100000000000001101001101010101100001000000000000011010011010101011000010000000000000110100110011100110000100000000000011101001101010101100001000000000000111010011010101011000010000000000001110100110101010110000100000000000011101001101010101100001000000000000111010011010101011000010000000000001110100110101010110000100000000000011101001101010101100001000000000000111010011010101011000010000000000001110100110101010110000100000000000011101001101010101100001000000000000111010011010101011000010000000000001110100110101010110000100000000000011101001101010101100001000000000000111010011010101011000010000000000001110100110101010110000100000000000011101001101010101100001000000000000111010011010101011000010000000000001110100110101010110000100000000000011101001101010101100001000000000000111010011010101011000010000000000001110100110101010110000100000000000011101001101010101100001000000000000111010011010101011000010000000000001110100110101010110000100000000000011101001101010101100001000000000000111010011010101011000010000000000001110100101100101110000100000000000001101101101010101100001000000000000011011011010101011000010000000000000110110110101010110000100000000000001101101101010101100001000000000000011011011010101011000010000000000000110110110101010110000100000000000001101101101010101100001000000000000011011011010101011000010000000000000110110110101010110000100000000000001101101101010101100001000000000000011011011010101011000010000000000000110110110101010110000100000000000001101101101010101100001000000000000011011011010101011000010000000000000110110110101010110000100000000000001101101101010101100001000000000000011011011010101011000010000000000000110110110101010110000100000000000001101101101010101100001000000000000011011011010101011000010000000000000110110110101010110000100000000000001101101101010101100001000000000000011011011010101011000010000000000000110110110101010110000100000000000001101101101010101100001000000000000011011011010101011000010000000000000110110110101010110000100000000000001101101101010101100001000000000000011011011010101011000010000000000000110110110101010110000100000000000001101101101010101100001000000000000011011011010101011000010000000000000110110110101010110000100000000000001101101101010101100001000000000000011011011010101011000010000000000000110110110101010110000100000000000001101101111100011100001000000000000111011011010101011000010000000000001110110110101010110000100000000000011101101101010101100001000000000000111011011010101011000010000000000001110110110101010110000100000000000011101101101010101100001000000000000111011011010101011000010000000000001110110110101010110000100000000000011101101101010101100001000000000000111011011010101011000010000000000001110110110101010110000100000000000011101101101010101100001000000000000111011011010101011000010000000000001110110110101010110000100000000000011101101101010101100001000000000000111011011010101011000010000000000001110110110101010110000100000000000011101101101010101100001000000000000111011011010101011000010000000000001110110110101010110000100000000000011101101101010101100001000000000000111011011010101011000010000000000001110110110101010110000100000000000011101101101010101100001000000000000111011011010101011000010000000000001110110110101010110000100000000000011101101000001101100001000000000000111111111100111111000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000100000110101010101100001000000000000000001101010101011000010000000000000000011010101010110000100000000000000000110101010101100001000000000000000001101010101011000010000000000000000011010101010110000100000000000000000110101010101100001000000000000000001101010101011000010000000000000000011010101010110000100000000000000000110101010101100001000000000000000001101010101011000010000000000000000011010101010110000100000000000000000110101010101100001000000000000000001101010101011000010000000000000000011010101010110000100000000000000000110101010101100001000000000000000001101010101011000010000000000000000011010101010110000100000000000000000110101010101100001000000000000000001101010101011000010000000000000000011010101010110000100000000000000000110101010101100001000000000000000001101010101011000010000000000000000011010101010110000100000000000000000110101010101100001000000000000000001101010101011000010000000000000000011010101010110000100000000000000000110101010101100001000000000000000001101010101011000010000000000000000011010101010110000100000000000000000110101010101100001000000000000000001101010101011000010000000000000000011010101010110000100000000000000000110101010101100001000000000000000001101010101011000010000000000000000011010101010110000100000000000000000110011001011100001000000000000100001101010101011000010000000000001000011010101010110000100000000000010000110101010101100001000000000000100001101010101011000010000000000001000011010101010110000100000000000010000110101010101100001000000000000100001101010101011000010000000000001000011010101010110000100000000000010000110101010101100001000000000000100001101010101011000010000000000001000011010101010110000100000000000010000110101010101100001000000000000100001101010101011000010000000000001000011010101010110000100000000000010000110101010101100001000000000000100001101010101011000010000000000001000011010101010110000100000000000010000110101010101100001000000000000100001101010101011000010000000000001000011010101010110000100000000000010000110101010101100001000000000000100001101010101011000010000000000001000011010101010110000100000000000010000110101010101100001000000000000100001101010101011000010000000000001000011010101010110000100000000000010000110100001101100001000000000000010001101010101011000010000000000000100011010101010110000100000000000001000110101010101100001000000000000010001101010101011000010000000000000100011010101010110000100000000000001000110101010101100001000000000000010001101010101011000010000000000000100011010101010110000100000000000001000110101010101100001000000000000010001101010101011000010000000000000100011010101010110000100000000000001000110101010101100001000000000000010001101010101011000010000000000000100011010101010110000100000000000001000110101010101100001000000000000010001101010101011000010000000000000100011010101010110000100000000000001000110101010101100001000000000000010001101010101011000010000000000000100011010101010110000100000000000001000110101010101100001000000000000010001101010101011000010000000000000100011010101010110000100000000000001000110101010101100001000000000000010001101010101011000010000000000000100011010101010110000100000000000001000110101010101100001000000000000010001101010101011000010000000000000100011010101010110000100000000000001000110101010101100001000000000000010001101010101011000010000000000000100011010101010110000100000000000001000110101010101100001000000000000010001101010101011000010000000000000100011010101010110000100000000000001000110101010101100001000000000000010001100100110011000010000000000001111111110000101110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011001110110101010110000100000000000010011101101010101100001000000000000100111011010101011000010000000000001001110110101010110000100000000000010011101101010101100001000000000000100111011010101011000010000000000001001110110101010110000100000000000010011101101010101100001000000000000100111011010101011000010000000000001001110110101010110000100000000000010011101101010101100001000000000000100111011010101011000010000000000001001110110101010110000100000000000010011101101010101100001000000000000100111011010101011000010000000000001001110110101010110000100000000000010011101101010101100001000000000000100111011010101011000010000000000001001110110101010110000100000000000010011101101010101100001000000000000100111011010101011000010000000000001001110110101010110000100000000000010011101101010101100001000000000000100111011010101011000010000000000001001110110101010110000100000000000010011101101010101100001000000000000100111011010101011000010000000000001001110110101010110000100000000000010011101101010101100001000000000000100111011010101011000010000000000001001110110101010110000100000000000010011101101010101100001000000000000100111011010101011000010000000000001001110110101010110000100000000000010011101101010101100001000000000000100111011010101011000010000000000001001110110000000110000100000000000001000110101010101100001000000000000010001101010101011000010000000000000100011010101010110000100000000000001000110101010101100001000000000000010001101010101011000010000000000000100011010101010110000100000000000001000110101010101100001000000000000010001101010101011000010000000000000100011010101010110000100000000000001000110101010101100001000000000000010001101010101011000010000000000000100011010101010110000100000000000001000110101010101100001000000000000010001101010101011000010000000000000100011010101010110000100000000000001000110101010101100001000000000000010001101010101011000010000000000000100011010101010110000100000000000001000110101010101100001000000000000010001101010101011000010000000000000100011010101010110000100000000000001000110101010101100001000000000000010001101010101011000010000000000000100011010101010110000100000000000001000110101010101100001000000000000010001101010101011000010000000000000100011010101010110000100000000000001000110101010101100001000000000000010001101010101011000010000000000000100011010101010110000100000000000001000110101010101100001000000000000010001100100110011000010000000000001100011010101010110000100000000000011000110101010101100001000000000000110001101010101011000010000000000001100011010101010110000100000000000011000110101010101100001000000000000110001101010101011000010000000000001100011010101010110000100000000000011000110101010101100001000000000000110001101010101011000010000000000001100011010101010110000100000000000011000110101010101100001000000000000110001101010101011000010000000000001100011010101010110000100000000000011000110101010101100001000000000000110001101010101011000010000000000001100011010101010110000100000000000011000110101010101100001000000000000110001101010101011000010000000000001100011010101010110000100000000000011000110101010101100001000000000000110001101010101011000010000000000001100011010101010110000100000000000011000110101010101100001000000000000110001101010101011000010000000000001100011010101010110000100000000000011000110101010101100001000000000000110001100011011011000010000000000000010011010101010110000100000000000000100110101010101100001000000000000001001101010101011000010000000000000010011010101010110000100000000000000100110101010101100001000000000000001001101010101011000010000000000000010011010101010110000100000000000000100110101010101100001000000000000001001101010101011000010000000000000010011010101010110000100000000000000100110101010101100001000000000000001001101010101011000010000000000000010011010101010110000100000000000000100110101010101100001000000000000001001101010101011000010000000000000010011010101010110000100000000000000100110101010101100001000000000000001001101010101011000010000000000000010011010101010110000100000000000000100110101010101100001000000000000001001101010101011000010000000000000010011010101010110000100000000000000100110101010101100001000000000000001001101010101011000010000000000000010011010101010110000100000000000000100110101010101100001000000000000001001101010101011000010000000000000010011010101010110000100000000000000100110101010101100001000000000000001001101010101011000010000000000000010011010101010110000100000000000000100110101010101100001000000000000001001101010101011000010000000000000010011010101010110000100000000000000100110101010101100001000000000000001001101010101011000010000000000000010011010101100110000100000000000011111111011001001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000010010011010101010110000100000000000000100110101010101100001000000000000001001101010101011000010000000000000010011010101010110000100000000000000100110101010101100001000000000000001001101010101011000010000000000000010011010101010110000100000000000000100110101010101100001000000000000001001101010101011000010000000000000010011010101010110000100000000000000100110101010101100001000000000000001001101010101011000010000000000000010011010101010110000100000000000000100110101010101100001000000000000001001101010101011000010000000000000010011010101010110000100000000000000100110101010101100001000000000000001001101010101011000010000000000000010011010101010110000100000000000000100110101010101100001000000000000001001101010101011000010000000000000010011010101010110000100000000000000100110101010101100001000000000000001001101010101011000010000000000000010011010101010110000100000000000000100110101010101100001000000000000001001101010101011000010000000000000010011010101010110000100000000000000100110101010101100001000000000000001001101010101011000010000000000000010011010101010110000100000000000000100110101011001100001000000000000101001101010101011000010000000000001010011010101010110000100000000000010100110101010101100001000000000000101001101010101011000010000000000001010011010101010110000100000000000010100110101010101100001000000000000101001101010101011000010000000000001010011010101010110000100000000000010100110101010101100001000000000000101001101010101011000010000000000001010011010101010110000100000000000010100110101010101100001000000000000101001101010101011000010000000000001010011010101010110000100000000000010100110101010101100001000000000000101001101010101011000010000000000001010011010101010110000100000000000010100110101010101100001000000000000101001101010101011000010000000000001010011010101010110000100000000000010100110101010101100001000000000000101001101010101011000010000000000001010011010101010110000100000000000010100110101010101100001000000000000101001101010101011000010000000000001010011010101010110000100000000000010100110101010101100001000000000000101001101010101011000010000000000001010011010101010110000100000000000010100110101010101100001000000000000101001101010101011000010000000000001010011000001000110000100000000000011111111011100001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001001000111010101011000010000000000000010001110101010110000100000000000000100011101010101100001000000000000001000111010101011000010000000000000010001110101010110000100000000000000100011101010101100001000000000000001000111010101011000010000000000000010001110101010110000100000000000000100011101010101100001000000000000001000111010101011000010000000000000010001110101010110000100000000000000100011101010101100001000000000000001000111010101011000010000000000000010001110101010110000100000000000000100011101010101100001000000000000001000111010101011000010000000000000010001110101010110000100000000000000100011101010101100001000000000000001000111010101011000010000000000000010001110101010110000100000000000000100011101010101100001000000000000001000111010101011000010000000000000010001110101010110000100000000000000100011101010101100001000000000000001000111010101011000010000000000000010001110101010110000100000000000000100011101010101100001000000000000001000111010101011000010000000000000010001110101010110000100000000000000100011101010101100001000000000000001000111010101011000010000000000000010001110101010110000100000000000000100011101010101100001000000000000001000111010101011000010000000000000010001110101010110000100000000000000100011101010101100001000000000000001000110000101011000010000000000001010001110101010110000100000000000010100011101010101100001000000000000101000111010101011000010000000000001010001110101010110000100000000000010100011101010101100001000000000000101000111010101011000010000000000001010001110101010110000100000000000010100011101010101100001000000000000101000111010101011000010000000000001010001110101010110000100000000000010100011101010101100001000000000000101000111010101011000010000000000001010001110101010110000100000000000010100011101010101100001000000000000101000111010101011000010000000000001010001110101010110000100000000000010100011101010101100001000000000000101000111010101011000010000000000001010001110101010110000100000000000010100011101010101100001000000000000101000111010101011000010000000000001010001110101010110000100000000000010100011101010101100001000000000000101000111010101011000010000000000001010001110101010110000100000000000010100011101010101100001000000000000101000110010111111000010000000000000110001110101010110000100000000000001100011101010101100001000000000000011000111010101011000010000000000000110001110101010110000100000000000001100011101010101100001000000000000011000111010101011000010000000000000110001110101010110000100000000000001100011101010101100001000000000000011000111010101011000010000000000000110001110101010110000100000000000001100011101010101100001000000000000011000111010101011000010000000000000110001110101010110000100000000000001100011101010101100001000000000000011000111010101011000010000000000000110001110101010110000100000000000001100011101010101100001000000000000011000111010101011000010000000000000110001110101010110000100000000000001100011101010101100001000000000000011000111010101011000010000000000000110001110101010110000100000000000001100011101010101100001000000000000011000111010101011000010000000000000110001110101010110000100000000000001100011101010101100001000000000000011000111010101011000010000000000000110001110101010110000100000000000001100011101010101100001000000000000011000111010101011000010000000000000110001110101010110000100000000000001100011101010101100001000000000000011000111010101011000010000000000000110001110101010110000100000000000001100011101010101100001000000000000011000111010101011000010000000000000110001100111010110000100000000000001100110101010101100001000000000000011001101010101011000010000000000000110011010101010110000100000000000001100110101010101100001000000000000011001101010101011000010000000000000110011010101010110000100000000000001100110101010101100001000000000000011001101010101011000010000000000000110011010101010110000100000000000001100110101010101100001000000000000011001101010101011000010000000000000110011010101010110000100000000000001100110101010101100001000000000000011001101010101011000010000000000000110011010101010110000100000000000001100110101010101100001000000000000011001101010101011000010000000000000110011010101010110000100000000000001100110101010101100001000000000000011001101010101011000010000000000000110011010101010110000100000000000001100110101010101100001000000000000011001101010101011000010000000000000110011010101010110000100000000000001100110101010101100001000000000000011001101010101011000010000000000000110011010101010110000100000000000001100110101010101100001000000000000011001101010101011000010000000000000110011010101010110000100000000000001100110101010101100001000000000000011001101111010111000010000000000001110011010101010110000100000000000011100110101010101100001000000000000111001101010101011000010000000000001110011010101010110000100000000000011100110101010101100001000000000000111001101010101011000010000000000001110011010101010110000100000000000011100110101010101100001000000000000111001101010101011000010000000000001110011010101010110000100000000000011100110101010101100001000000000000111001101010101011000010000000000001110011010101010110000100000000000011100110101010101100001000000000000111001101010101011000010000000000001110011010101010110000100000000000011100110101010101100001000000000000111001101010101011000010000000000001110011010101010110000100000000000011100110101010101100001000000000000111001101010101011000010000000000001110011010101010110000100000000000011100110101010101100001000000000000111001101010101011000010000000000001110011010101010110000100000000000011100110101010101100001000000000000111001100110010011000010000000000000001011010101010110000100000000000000010110101010101100001000000000000000101101010101011000010000000000000001011010101010110000100000000000000010110101010101100001000000000000000101101010101011000010000000000000001011010101010110000100000000000000010110101010101100001000000000000000101101010101011000010000000000000001011010101010110000100000000000000010110101010101100001000000000000000101101010101011000010000000000000001011010101010110000100000000000000010110101010101100001000000000000000101101010101011000010000000000000001011010101010110000100000000000000010110101010101100001000000000000000101101010101011000010000000000000001011010101010110000100000000000000010110101010101100001000000000000000101101010101011000010000000000000001011010101010110000100000000000000010110101010101100001000000000000000101101010101011000010000000000000001011010101010110000100000000000000010110101010101100001000000000000000101101010101011000010000000000000001011010101010110000100000000000000010110101010101100001000000000000000101101010101011000010000000000000001011010101010110000100000000000000010110101010101100001000000000000000101101010101011000010000000000000001011010101010110000100000000000000010110101010101100001000000000000000101101010101011000010000000000000001011010101100110000100000000000011111111011001001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000101100001101010101100000000001010000011000011010101011000000000010100000110000110101010110000000000101000001100001101010101100000000001010000011000011010101011000000000010100000110000110101010110000000000101000001100001101010101100000000001010000011000011010101011000000000010100000110000110101010110000000000101000001100001101010101100000000001010000011000011010101011000000000010100000110000110101010110000000000101000001100001101010101100000000001010000011000011010101011000000000010100000110000110101010110000000000101000001100001101010101100000000001010000011000011010101011000000000010100000110000110101010110000000000101000001100001101010101100000000001010000011000011010101011000000000010100000110000110101010110000000000101000001100001101010101100000000001010000011000011010101011000000000010100000110000110101010110000000000101000001100001101010101100000000001010000011000011010101011000000000010100000110000110101010110000000000101000001100001101010101100000000001010000011000011010101011000000000010100000110000110101010110000000000101000001100001101010101100000000001010000011000011010101011000000000010100000110000110101010110000000000101000001100001101010101100000000001010000011000011010101011000000000010100000110000110101010110000000000101000001100001100101101100000000001010000111000011010101011000000001011110001110000110101010110000000010111100011100001101010101100000000101111000111000011010101011000000001011110001110000110101010110000000010111100011100001101010101100000000101111000111000011010101011000000001011110001110000110101010110000000010111100011100001101010101100000000101111000111000011010101011000000001011110001110000110101010110000000010111100011100001101010101100000000101111000111000011010101011000000001011110001110000110101010110000000010111100011100001101010101100000000101111000111000011010101011000000001011110001110000110101010110000000010111100011100001101010101100000000101111000111000011010101011000000001011110001110000110101010110000000010111100011100001101010101100000000101111000111000011010101011000000001011110001110000110101010110000000010111100011100001101010101100000000101111000111000011010101011000000001011110001110000110101010110000000010111100011100001101010101100000000101111000111000011010101011000000001011110001110000110101010110000000010111100011100001101010101100000000101111000111000011000000011000000001011110000001011010101010110000100000000000000010110101010101100001000000000000000101101010101011000010000000000000001011010101010110000100000000000000010110101010101100001000000000000000101101010101011000010000000000000001011010101010110000100000000000000010110101010101100001000000000000000101101010101011000010000000000000001011010101010110000100000000000000010110101010101100001000000000000000101101010101011000010000000000000001011010101010110000100000000000000010110101010101100001000000000000000101101010101011000010000000000000001011010101010110000100000000000000010110101010101100001000000000000000101101010101011000010000000000000001011010101010110000100000000000000010110101010101100001000000000000000101101010101011000010000000000000001011010101010110000100000000000000010110101010101100001000000000000000101101010101011000010000000000000001011010101010110000100000000000000010110101010101100001000000000000000101101010101011000010000000000000001011010101010110000100000000000000010110101010101100001000000000000000101101010101011000010000000000000001011010101010110000100000000000000010110101010101100001000000000000000101101010110011000010000000000001001011010101010110000100000000000010010110101010101100001000000000000100101101010101011000010000000000001001011010101010110000100000000000010010110101010101100001000000000000100101101010101011000010000000000001001011010101010110000100000000000010010110101010101100001000000000000100101101010101011000010000000000001001011010101010110000100000000000010010110101010101100001000000000000100101101010101011000010000000000001001011010101010110000100000000000010010110101010101100001000000000000100101101010101011000010000000000001001011010101010110000100000000000010010110101010101100001000000000000100101101010101011000010000000000001001011010101010110000100000000000010010110101010101100001000000000000100101101010101011000010000000000001001011010101010110000100000000000010010110101010101100001000000000000100101101010101011000010000000000001001011010101010110000100000000000010010110101010101100001000000000000100101100000100011000010000000000001111111101010000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000101100011101010101100001000000000000011000111010101011000010000000000000110001110101010110000100000000000001100011101010101100001000000000000011000111010101011000010000000000000110001110101010110000100000000000001100011101010101100001000000000000011000111010101011000010000000000000110001110101010110000100000000000001100011101010101100001000000000000011000111010101011000010000000000000110001110101010110000100000000000001100011101010101100001000000000000011000111010101011000010000000000000110001110101010110000100000000000001100011101010101100001000000000000011000111010101011000010000000000000110001110101010110000100000000000001100011101010101100001000000000000011000111010101011000010000000000000110001110101010110000100000000000001100011101010101100001000000000000011000111010101011000010000000000000110001110101010110000100000000000001100011101010101100001000000000000011000111010101011000010000000000000110001110101010110000100000000000001100011101010101100001000000000000011000111010101011000010000000000000110001110101010110000100000000000001100011101010101100001000000000000011000111010101011000010000000000000110001110101010110000100000000000001100011101010101100001000000000000011000111010101011000010000000000000110001110101010110000100000000000001100011101010101100001000000000000011000110011101011000010000000000001110001110101010110000100000000000011100011101010101100001000000000000111000111010101011000010000000000001110001110101010110000100000000000011100011101010101100001000000000000111000111010101011000010000000000001110001110101010110000100000000000011100011101010101100001000000000000111000111010101011000010000000000001110001110101010110000100000000000011100011101010101100001000000000000111000111010101011000010000000000001110001110101010110000100000000000011100011101010101100001000000000000111000111010101011000010000000000001110001110101010110000100000000000011100011101010101100001000000000000111000111010101011000010000000000001110001110101010110000100000000000011100011101010101100001000000000000111000111010101011000010000000000001110001110101010110000100000000000011100011101010101100001000000000000111000111010101011000010000000000001110001110101010110000100000000000011100011000110101100001000000000000000100111010101011000010000000000000001001110101010110000100000000000000010011101010101100001000000000000000100111010101011000010000000000000001001110101010110000100000000000000010011101010101100001000000000000000100111010101011000010000000000000001001110101010110000100000000000000010011101010101100001000000000000000100111010101011000010000000000000001001110101010110000100000000000000010011101010101100001000000000000000100111010101011000010000000000000001001110101010110000100000000000000010011101010101100001000000000000000100111010101011000010000000000000001001110101010110000100000000000000010011101010101100001000000000000000100111010101011000010000000000000001001110101010110000100000000000000010011101010101100001000000000000000100111010101011000010000000000000001001110101010110000100000000000000010011101010101100001000000000000000100111010101011000010000000000000001001110101010110000100000000000000010011101010101100001000000000000000100111010101011000010000000000000001001110101010110000100000000000000010011101010101100001000000000000000100111010101011000010000000000000001001110101010110000100000000000000010011101010101100001000000000000000100111010101011000010000000000000001001110101010110000100000000000000010011101010101100001000000000000000100111010101011000010000000000000001001110101010110000100000000000000010011001100011100001000000000000010101101010101011000010000000000000101011010101010110000100000000000001010110101010101100001000000000000010101101010101011000010000000000000101011010101010110000100000000000001010110101010101100001000000000000010101101010101011000010000000000000101011010101010110000100000000000001010110101010101100001000000000000010101101010101011000010000000000000101011010101010110000100000000000001010110101010101100001000000000000010101101010101011000010000000000000101011010101010110000100000000000001010110101010101100001000000000000010101101010101011000010000000000000101011010101010110000100000000000001010110101010101100001000000000000010101101010101011000010000000000000101011010101010110000100000000000001010110101010101100001000000000000010101101010101011000010000000000000101011010101010110000100000000000001010110101010101100001000000000000010101101010101011000010000000000000101011010101010110000100000000000001010110101010101100001000000000000010101101010101011000010000000000000101011010101010110000100000000000001010110101010101100001000000000000010101101010010011000010000000000001101011010101010110000100000000000011010110101010101100001000000000000110101101010101011000010000000000001101011010101010110000100000000000011010110101010101100001000000000000110101101010101011000010000000000001101011010101010110000100000000000011010110101010101100001000000000000110101101010101011000010000000000001101011010101010110000100000000000011010110101010101100001000000000000110101101010101011000010000000000001101011010101010110000100000000000011010110101010101100001000000000000110101101010101011000010000000000001101011010101010110000100000000000011010110101010101100001000000000000110101101010101011000010000000000001101011010101010110000100000000000011010110101010101100001000000000000110101101010101011000010000000000001101011010101010110000100000000000011010110101010101100001000000000000110101101010101011000010000000000001101011010101010110000100000000000011010110001010001100001000000000000111111110010000011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000100110110101010101100001000000000000001101101010101011000010000000000000011011010101010110000100000000000000110110101010101100001000000000000001101101010101011000010000000000000011011010101010110000100000000000000110110101010101100001000000000000001101101010101011000010000000000000011011010101010110000100000000000000110110101010101100001000000000000001101101010101011000010000000000000011011010101010110000100000000000000110110101010101100001000000000000001101101010101011000010000000000000011011010101010110000100000000000000110110101010101100001000000000000001101101010101011000010000000000000011011010101010110000100000000000000110110101010101100001000000000000001101101010101011000010000000000000011011010101010110000100000000000000110110101010101100001000000000000001101101010101011000010000000000000011011010101010110000100000000000000110110101010101100001000000000000001101101010101011000010000000000000011011010101010110000100000000000000110110101010101100001000000000000001101101010101011000010000000000000011011010101010110000100000000000000110110101010101100001000000000000001101101010101011000010000000000000011011010101010110000100000000000000110110101010101100001000000000000001101101010101011000010000000000000011011010101010110000100000000000000110110100000011100001000000000000101101101010101011000010000000000001011011010101010110000100000000000010110110101010101100001000000000000101101101010101011000010000000000001011011010101010110000100000000000010110110101010101100001000000000000101101101010101011000010000000000001011011010101010110000100000000000010110110101010101100001000000000000101101101010101011000010000000000001011011010101010110000100000000000010110110101010101100001000000000000101101101010101011000010000000000001011011010101010110000100000000000010110110101010101100001000000000000101101101010101011000010000000000001011011010101010110000100000000000010110110101010101100001000000000000101101101010101011000010000000000001011011010101010110000100000000000010110110101010101100001000000000000101101101010101011000010000000000001011011010101010110000100000000000010110110101010101100001000000000000101101101010101011000010000000000001011011010101010110000100000000000010110110000100001100001000000000000011101101010101011000010000000000000111011010101010110000100000000000001110110101010101100001000000000000011101101010101011000010000000000000111011010101010110000100000000000001110110101010101100001000000000000011101101010101011000010000000000000111011010101010110000100000000000001110110101010101100001000000000000011101101010101011000010000000000000111011010101010110000100000000000001110110101010101100001000000000000011101101010101011000010000000000000111011010101010110000100000000000001110110101010101100001000000000000011101101010101011000010000000000000111011010101010110000100000000000001110110101010101100001000000000000011101101010101011000010000000000000111011010101010110000100000000000001110110101010101100001000000000000011101101010101011000010000000000000111011010101010110000100000000000001110110101010101100001000000000000011101101010101011000010000000000000111011010101010110000100000000000001110110101010101100001000000000000011101101010101011000010000000000000111011010101010110000100000000000001110110101010101100001000000000000011101101010101011000010000000000000111011010101010110000100000000000001110110101010101100001000000000000011101101010101011000010000000000000111011010101010110000100000000000001110110101010101100001000000000000011101101110010011000010000000000001111011010101010110000100000000000011110110101010101100001000000000000111101101010101011000010000000000001111011010101010110000100000000000011110110101010101100001000000000000111101101010101011000010000000000001111011010101010110000100000000000011110110101010101100001000000000000111101101010101011000010000000000001111011010101010110000100000000000011110110101010101100001000000000000111101101010101011000010000000000001111011010101010110000100000000000011110110101010101100001000000000000111101101010101011000010000000000001111011010101010110000100000000000011110110101010101100001000000000000111101101010101011000010000000000001111011010101010110000100000000000011110110101010101100001000000000000111101101010101011000010000000000001111011010101010110000100000000000011110110101010101100001000000000000111101101010101011000010000000000001111011010101010110000100000000000011110110101010101100001000000000000111101100100000011000010000000000001111111100100000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001000011101010101011000010000000000000000111010101010110000100000000000000001110101010101100001000000000000000011101010101011000010000000000000000111010101010110000100000000000000001110101010101100001000000000000000011101010101011000010000000000000000111010101010110000100000000000000001110101010101100001000000000000000011101010101011000010000000000000000111010101010110000100000000000000001110101010101100001000000000000000011101010101011000010000000000000000111010101010110000100000000000000001110101010101100001000000000000000011101010101011000010000000000000000111010101010110000100000000000000001110101010101100001000000000000000011101010101011000010000000000000000111010101010110000100000000000000001110101010101100001000000000000000011101010101011000010000000000000000111010101010110000100000000000000001110101010101100001000000000000000011101010101011000010000000000000000111010101010110000100000000000000001110101010101100001000000000000000011101010101011000010000000000000000111010101010110000100000000000000001110101010101100001000000000000000011101010101011000010000000000000000111010101010110000100000000000000001110101010101100001000000000000000011101010101011000010000000000000000111010101010110000100000000000000001110101010101100001000000000000000011100010001011000010000000000001000111010101010110000100000000000010001110101010101100001000000000000100011101010101011000010000000000001000111010101010110000100000000000010001110101010101100001000000000000100011101010101011000010000000000001000111010101010110000100000000000010001110101010101100001000000000000100011101010101011000010000000000001000111010101010110000100000000000010001110101010101100001000000000000100011101010101011000010000000000001000111010101010110000100000000000010001110101010101100001000000000000100011101010101011000010000000000001000111010101010110000100000000000010001110101010101100001000000000000100011101010101011000010000000000001000111010101010110000100000000000010001110101010101100001000000000000100011101010101011000010000000000001000111010101010110000100000000000010001110101010101100001000000000000100011101010101011000010000000000001000111010101010110000100000000000010001110101010101100001000000000000100011100011000111000010000000000001000111010101010110000100000000000010001110101010101100001000000000000100011101010101011000010000000000001000111010101010110000100000000000010001110101010101100001000000000000100011101010101011000010000000000001000111010101010110000100000000000010001110101010101100001000000000000100011101010101011000010000000000001000111010101010110000100000000000010001110101010101100001000000000000100011101010101011000010000000000001000111010101010110000100000000000010001110101010101100001000000000000100011101010101011000010000000000001000111010101010110000100000000000010001110101010101100001000000000000100011101010101011000010000000000001000111010101010110000100000000000010001110101010101100001000000000000100011101010101011000010000000000001000111010101010110000100000000000010001110101010101100001000000000000100011101010101011000010000000000001000111010101010110000100000000000010001110101010101100001000000000000100011101010101011000010000000000001000111010101010110000100000000000010001110101010101100001000000000000100011101010101011000010000000000001000111010101010110000100000000000010001110001100011100001000000000000010011101010101011000010000000000000100111010101010110000100000000000001001110101010101100001000000000000010011101010101011000010000000000000100111010101010110000100000000000001001110101010101100001000000000000010011101010101011000010000000000000100111010101010110000100000000000001001110101010101100001000000000000010011101010101011000010000000000000100111010101010110000100000000000001001110101010101100001000000000000010011101010101011000010000000000000100111010101010110000100000000000001001110101010101100001000000000000010011101010101011000010000000000000100111010101010110000100000000000001001110101010101100001000000000000010011101010101011000010000000000000100111010101010110000100000000000001001110101010101100001000000000000010011101010101011000010000000000000100111010101010110000100000000000001001110101010101100001000000000000010011101010101011000010000000000000100111010101010110000100000000000001001110101010101100001000000000000010011101010101011000010000000000000100111010101010110000100000000000001001110101010101100001000000000000010011101010101011000010000000000000100111010101010110000100000000000001001110101010101100001000000000000010011101010101011000010000000000000100111010101010110000100000000000001001110101010101100001000000000000010011100110000111000010000000000001100111010101010110000100000000000011001110101010101100001000000000000110011101010101011000010000000000001100111010101010110000100000000000011001110101010101100001000000000000110011101010101011000010000000000001100111010101010110000100000000000011001110101010101100001000000000000110011101010101011000010000000000001100111010101010110000100000000000011001110101010101100001000000000000110011101010101011000010000000000001100111010101010110000100000000000011001110101010101100001000000000000110011101010101011000010000000000001100111010101010110000100000000000011001110101010101100001000000000000110011101010101011000010000000000001100111010101010110000100000000000011001110101010101100001000000000000110011101010101011000010000000000001100111010101010110000100000000000011001110101010101100001000000000000110011101010101011000010000000000001100111010101010110000100000000000011001110101010101100001000000000000110011101100000011000010000000000001111111101011011110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001001011101010101011000010000000000000010111010101010110000100000000000000101110101010101100001000000000000001011101010101011000010000000000000010111010101010110000100000000000000101110101010101100001000000000000001011101010101011000010000000000000010111010101010110000100000000000000101110101010101100001000000000000001011101010101011000010000000000000010111010101010110000100000000000000101110101010101100001000000000000001011101010101011000010000000000000010111010101010110000100000000000000101110101010101100001000000000000001011101010101011000010000000000000010111010101010110000100000000000000101110101010101100001000000000000001011101010101011000010000000000000010111010101010110000100000000000000101110101010101100001000000000000001011101010101011000010000000000000010111010101010110000100000000000000101110101010101100001000000000000001011101010101011000010000000000000010111010101010110000100000000000000101110101010101100001000000000000001011101010101011000010000000000000010111010101010110000100000000000000101110101010101100001000000000000001011101010101011000010000000000000010111010101010110000100000000000000101110101010101100001000000000000001011101010101011000010000000000000010111010101010110000100000000000000101110101010101100001000000000000001011101110010111000010000000000001010111010101010110000100000000000010101110101010101100001000000000000101011101010101011000010000000000001010111010101010110000100000000000010101110101010101100001000000000000101011101010101011000010000000000001010111010101010110000100000000000010101110101010101100001000000000000101011101010101011000010000000000001010111010101010110000100000000000010101110101010101100001000000000000101011101010101011000010000000000001010111010101010110000100000000000010101110101010101100001000000000000101011101010101011000010000000000001010111010101010110000100000000000010101110101010101100001000000000000101011101010101011000010000000000001010111010101010110000100000000000010101110101010101100001000000000000101011101010101011000010000000000001010111010101010110000100000000000010101110101010101100001000000000000101011101010101011000010000000000001010111010101010110000100000000000010101110101010101100001000000000000101011100010000111000010000000000000110111010101010110000100000000000001101110101010101100001000000000000011011101010101011000010000000000000110111010101010110000100000000000001101110101010101100001000000000000011011101010101011000010000000000000110111010101010110000100000000000001101110101010101100001000000000000011011101010101011000010000000000000110111010101010110000100000000000001101110101010101100001000000000000011011101010101011000010000000000000110111010101010110000100000000000001101110101010101100001000000000000011011101010101011000010000000000000110111010101010110000100000000000001101110101010101100001000000000000011011101010101011000010000000000000110111010101010110000100000000000001101110101010101100001000000000000011011101010101011000010000000000000110111010101010110000100000000000001101110101010101100001000000000000011011101010101011000010000000000000110111010101010110000100000000000001101110101010101100001000000000000011011101010101011000010000000000000110111010101010110000100000000000001101110101010101100001000000000000011011101010101011000010000000000000110111010101010110000100000000000001101110101010101100001000000000000011011101010101011000010000000000000110111010101010110000100000000000001101110101010101100001000000000000011011101010101011000010000000000000110111000101100110000100000000000000011010101010101100000000000000000000110101010101011000000000000000000001101010101010110000000000000000000011010101010101100000000000000000000110101010101011000000000000000000001101010101010110000000000000000000011010101010101100000000000000000000110101010101011000000000000000000001101010101010110000000000000000000011010101010101100000000000000000000110101010101011000000000000000000001101010101010110000000000000000000011010101010101100000000000000000000110101010101011000000000000000000001101010101010110000000000000000000011010101010101100000000000000000000110101010101011000000000000000000001101010101010110000000000000000000011010101010101100000000000000000000110101010101011000000000000000000001101010101010110000000000000000000011010101010101100000000000000000000110101010101011000000000000000000001101010101010110000000000000000000011010101010101100000000000000000000110101010101011000000000000000000001101010101010110000000000000000000011010101010101100000000000000000000110101010101011000000000000000000001101011100101110000000000000000001101110101010101100001000000000000011011101010101011000010000000000000110111010101010110000100000000000001101110101010101100001000000000000011011101010101011000010000000000000110111010101010110000100000000000001101110101010101100001000000000000011011101010101011000010000000000000110111010101010110000100000000000001101110101010101100001000000000000011011101010101011000010000000000000110111010101010110000100000000000001101110101010101100001000000000000011011101010101011000010000000000000110111010101010110000100000000000001101110101010101100001000000000000011011101010101011000010000000000000110111010101010110000100000000000001101110101010101100001000000000000011011101010101011000010000000000000110111010101010110000100000000000001101110101010101100001000000000000011011101010101011000010000000000000110111010101010110000100000000000001101110101010101100001000000000000011011101010101011000010000000000000110111010101010110000100000000000001101110101010101100001000000000000011011101010101011000010000000000000110111010101010110000100000000000001101110101010101100001000000000000011011101010101011000010000000000000110111010101010110000100000000000001101110001011001100001000000000000111011101010101011000010000000000001110111010101010110000100000000000011101110101010101100001000000000000111011101010101011000010000000000001110111010101010110000100000000000011101110101010101100001000000000000111011101010101011000010000000000001110111010101010110000100000000000011101110101010101100001000000000000111011101010101011000010000000000001110111010101010110000100000000000011101110101010101100001000000000000111011101010101011000010000000000001110111010101010110000100000000000011101110101010101100001000000000000111011101010101011000010000000000001110111010101010110000100000000000011101110101010101100001000000000000111011101010101011000010000000000001110111010101010110000100000000000011101110101010101100001000000000000111011101010101011000010000000000001110111010101010110000100000000000011101110101010101100001000000000000111011101010101011000010000000000001110111010101010110000100000000000011101110010000001100001000000000000111111111001101111000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000010001001110101010110000100000000000000010011101010101100001000000000000000100111010101011000010000000000000001001110101010110000100000000000000010011101010101100001000000000000000100111010101011000010000000000000001001110101010110000100000000000000010011101010101100001000000000000000100111010101011000010000000000000001001110101010110000100000000000000010011101010101100001000000000000000100111010101011000010000000000000001001110101010110000100000000000000010011101010101100001000000000000000100111010101011000010000000000000001001110101010110000100000000000000010011101010101100001000000000000000100111010101011000010000000000000001001110101010110000100000000000000010011101010101100001000000000000000100111010101011000010000000000000001001110101010110000100000000000000010011101010101100001000000000000000100111010101011000010000000000000001001110101010110000100000000000000010011101010101100001000000000000000100111010101011000010000000000000001001110101010110000100000000000000010011101010101100001000000000000000100111010101011000010000000000000001001110101010110000100000000000000010011101010101100001000000000000000100111010101011000010000000000000001001110101010110000100000000000000010011101010101100001000000000000000100111010101011000010000000000000001001100110001110000100000000000011100011101010101100000000000000000111000111010101011000000000000000001110001110101010110000000000000000011100011101010101100000000000000000111000111010101011000000000000000001110001110101010110000000000000000011100011101010101100000000000000000111000111010101011000000000000000001110001110101010110000000000000000011100011101010101100000000000000000111000111010101011000000000000000001110001110101010110000000000000000011100011101010101100000000000000000111000111010101011000000000000000001110001110101010110000000000000000011100011101010101100000000000000000111000111010101011000000000000000001110001110101010110000000000000000011100011101010101100000000000000000111000111010101011000000000000000001110001110101010110000000000000000011100011101010101100000000000000000111000111010101011000000000000000001110001110101010110000000000000000011100011101010101100000000000000000111000111010101011000000000000000001110001110101010110000000000000000011100011101010101100000000000000000111000111010101011000000000000000001110001100000000110000000000000000000011110101010101100001000000000000000111101010101011000010000000000000001111010101010110000100000000000000011110101010101100001000000000000000111101010101011000010000000000000001111010101010110000100000000000000011110101010101100001000000000000000111101010101011000010000000000000001111010101010110000100000000000000011110101010101100001000000000000000111101010101011000010000000000000001111010101010110000100000000000000011110101010101100001000000000000000111101010101011000010000000000000001111010101010110000100000000000000011110101010101100001000000000000000111101010101011000010000000000000001111010101010110000100000000000000011110101010101100001000000000000000111101010101011000010000000000000001111010101010110000100000000000000011110101010101100001000000000000000111101010101011000010000000000000001111010101010110000100000000000000011110101010101100001000000000000000111101010101011000010000000000000001111010101010110000100000000000000011110101010101100001000000000000000111101010101011000010000000000000001111010101010110000100000000000000011110101010101100001000000000000000111101010101011000010000000000000001111010101010110000100000000000000011110011001011100001000000000000100111101010101011000010000000000001001111010101010110000100000000000010011110101010101100001000000000000100111101010101011000010000000000001001111010101010110000100000000000010011110101010101100001000000000000100111101010101011000010000000000001001111010101010110000100000000000010011110101010101100001000000000000100111101010101011000010000000000001001111010101010110000100000000000010011110101010101100001000000000000100111101010101011000010000000000001001111010101010110000100000000000010011110101010101100001000000000000100111101010101011000010000000000001001111010101010110000100000000000010011110101010101100001000000000000100111101010101011000010000000000001001111010101010110000100000000000010011110101010101100001000000000000100111101010101011000010000000000001001111010101010110000100000000000010011110101010101100001000000000000100111101010101011000010000000000001001111010101010110000100000000000010011110000101011100001000000000000010111101010101011000010000000000000101111010101010110000100000000000001011110101010101100001000000000000010111101010101011000010000000000000101111010101010110000100000000000001011110101010101100001000000000000010111101010101011000010000000000000101111010101010110000100000000000001011110101010101100001000000000000010111101010101011000010000000000000101111010101010110000100000000000001011110101010101100001000000000000010111101010101011000010000000000000101111010101010110000100000000000001011110101010101100001000000000000010111101010101011000010000000000000101111010101010110000100000000000001011110101010101100001000000000000010111101010101011000010000000000000101111010101010110000100000000000001011110101010101100001000000000000010111101010101011000010000000000000101111010101010110000100000000000001011110101010101100001000000000000010111101010101011000010000000000000101111010101010110000100000000000001011110101010101100001000000000000010111101010101011000010000000000000101111010101010110000100000000000001011110101010101100001000000000000010111101010101011000010000000000000101111010101010110000100000000000001011110101010101100001000000000000010111101010101011000010000000000000101111010101010110000100000000000001011110101010101100001000000000000010111101100010011000010000000000001111111110100001110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011100010110101010110000100000000000011000101101010101100001000000000000110001011010101011000010000000000001100010110101010110000100000000000011000101101010101100001000000000000110001011010101011000010000000000001100010110101010110000100000000000011000101101010101100001000000000000110001011010101011000010000000000001100010110101010110000100000000000011000101101010101100001000000000000110001011010101011000010000000000001100010110101010110000100000000000011000101101010101100001000000000000110001011010101011000010000000000001100010110101010110000100000000000011000101101010101100001000000000000110001011010101011000010000000000001100010110101010110000100000000000011000101101010101100001000000000000110001011010101011000010000000000001100010110101010110000100000000000011000101101010101100001000000000000110001011010101011000010000000000001100010110101010110000100000000000011000101101010101100001000000000000110001011010101011000010000000000001100010110101010110000100000000000011000101101010101100001000000000000110001011010101011000010000000000001100010110101010110000100000000000011000101101010101100001000000000000110001011010101011000010000000000001100010110101010110000100000000000011000101101010101100001000000000000110001011010101011000010000000000001100010100000001110000100000000000011011110101010101100001000000000000110111101010101011000010000000000001101111010101010110000100000000000011011110101010101100001000000000000110111101010101011000010000000000001101111010101010110000100000000000011011110101010101100001000000000000110111101010101011000010000000000001101111010101010110000100000000000011011110101010101100001000000000000110111101010101011000010000000000001101111010101010110000100000000000011011110101010101100001000000000000110111101010101011000010000000000001101111010101010110000100000000000011011110101010101100001000000000000110111101010101011000010000000000001101111010101010110000100000000000011011110101010101100001000000000000110111101010101011000010000000000001101111010101010110000100000000000011011110101010101100001000000000000110111101010101011000010000000000001101111010101010110000100000000000011011110101010101100001000000000000110111101010101011000010000000000001101111010101010110000100000000000011011110101010101100001000000000000110111101010101011000010000000000001101111010101010110000100000000000011011110101010101100001000000000000110111100010000111000010000000000000011111010101010110000100000000000000111110101010101100001000000000000001111101010101011000010000000000000011111010101010110000100000000000000111110101010101100001000000000000001111101010101011000010000000000000011111010101010110000100000000000000111110101010101100001000000000000001111101010101011000010000000000000011111010101010110000100000000000000111110101010101100001000000000000001111101010101011000010000000000000011111010101010110000100000000000000111110101010101100001000000000000001111101010101011000010000000000000011111010101010110000100000000000000111110101010101100001000000000000001111101010101011000010000000000000011111010101010110000100000000000000111110101010101100001000000000000001111101010101011000010000000000000011111010101010110000100000000000000111110101010101100001000000000000001111101010101011000010000000000000011111010101010110000100000000000000111110101010101100001000000000000001111101010101011000010000000000000011111010101010110000100000000000000111110101010101100001000000000000001111101010101011000010000000000000011111010101010110000100000000000000111110001111111100001000000000000101111101010101011000010000000000001011111010101010110000100000000000010111110101010101100001000000000000101111101010101011000010000000000001011111010101010110000100000000000010111110101010101100001000000000000101111101010101011000010000000000001011111010101010110000100000000000010111110101010101100001000000000000101111101010101011000010000000000001011111010101010110000100000000000010111110101010101100001000000000000101111101010101011000010000000000001011111010101010110000100000000000010111110101010101100001000000000000101111101010101011000010000000000001011111010101010110000100000000000010111110101010101100001000000000000101111101010101011000010000000000001011111010101010110000100000000000010111110101010101100001000000000000101111101010101011000010000000000001011111010101010110000100000000000010111110101010101100001000000000000101111101010101011000010000000000001011111010101010110000100000000000010111110010101011100001000000000000011111101010101011000010000000000000111111010101010110000100000000000001111110101010101100001000000000000011111101010101011000010000000000000111111010101010110000100000000000001111110101010101100001000000000000011111101010101011000010000000000000111111010101010110000100000000000001111110101010101100001000000000000011111101010101011000010000000000000111111010101010110000100000000000001111110101010101100001000000000000011111101010101011000010000000000000111111010101010110000100000000000001111110101010101100001000000000000011111101010101011000010000000000000111111010101010110000100000000000001111110101010101100001000000000000011111101010101011000010000000000000111111010101010110000100000000000001111110101010101100001000000000000011111101010101011000010000000000000111111010101010110000100000000000001111110101010101100001000000000000011111101010101011000010000000000000111111010101010110000100000000000001111110101010101100001000000000000011111101010101011000010000000000000111111010101010110000100000000000001111110101010101100001000000000000011111101010101011000010000000000000111111010101010110000100000000000001111110101010101100001000000000000011111101010101011000010000000000000111111010101010110000100000000000001111110101010101100001000000000000011111100000011111000010000000000001111111010101010110000100000000000011111110101010101100001000000000000111111101010101011000010000000000001111111010101010110000100000000000011111110101010101100001000000000000111111101010101011000010000000000001111111010101010110000100000000000011111110101010101100001000000000000111111101010101011000010000000000001111111010101010110000100000000000011111110101010101100001000000000000111111101010101011000010000000000001111111010101010110000100000000000011111110101010101100001000000000000111111101010101011000010000000000001111111010101010110000100000000000011111110101010101100001000000000000111111101010101011000010000000000001111111010101010110000100000000000011111110101010101100001000000000000111111101010101011000010000000000001111111010101010110000100000000000011111110101010101100001000000000000111111101010101011000010000000000001111111010101010110000100000000000011111110101010101100001000000000000111111101111101011000010000000000001111111110011011110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111100011101010101100001000000000000111000111010101011000010000000000001110001110101010110000100000000000011100011101010101100001000000000000111000111010101011000010000000000001110001110101010110000100000000000011100011101010101100001000000000000111000111010101011000010000000000001110001110101010110000100000000000011100011101010101100001000000000000111000111010101011000010000000000001110001110101010110000100000000000011100011101010101100001000000000000111000111010101011000010000000000001110001110101010110000100000000000011100011101010101100001000000000000111000111010101011000010000000000001110001110101010110000100000000000011100011101010101100001000000000000111000111010101011000010000000000001110001110101010110000100000000000011100011101010101100001000000000000111000111010101011000010000000000001110001110101010110000100000000000011100011101010101100001000000000000111000111010101011000010000000000001110001110101010110000100000000000011100011101010101100001000000000000111000111010101011000010000000000001110001110101010110000100000000000011100011101010101100001000000000000111000111010101011000010000000000001110001110101010110000100000000000011100011101010101100001000000000000111000111010101011000010000000000001110001110101010110000100000000000011100011000000001100001000000000000111111101010101011000010000000000001111111010101010110000100000000000011111110101010101100001000000000000111111101010101011000010000000000001111111010101010110000100000000000011111110101010101100001000000000000111111101010101011000010000000000001111111010101010110000100000000000011111110101010101100001000000000000111111101010101011000010000000000001111111010101010110000100000000000011111110101010101100001000000000000111111101010101011000010000000000001111111010101010110000100000000000011111110101010101100001000000000000111111101010101011000010000000000001111111010101010110000100000000000011111110101010101100001000000000000111111101010101011000010000000000001111111010101010110000100000000000011111110101010101100001000000000000111111101010101011000010000000000001111111010101010110000100000000000011111110101010101100001000000000000111111101010101011000010000000000001111111010101010110000100000000000011111110101010101100001000000000000111111101010101011000010000000000001111111010101010110000100000000000011111110101010101100001000000000000111111101010101011000010000000000001111111011111010110000100000000000000000001101010101100001000000000000000000011010101011000010000000000000000000110101010110000100000000000000000001101010101100001000000000000000000011010101011000010000000000000000000110101010110000100000000000000000001101010101100001000000000000000000011010101011000010000000000000000000110101010110000100000000000000000001101010101100001000000000000000000011010101011000010000000000000000000110101010110000100000000000000000001101010101100001000000000000000000011010101011000010000000000000000000110101010110000100000000000000000001101010101100001000000000000000000011010101011000010000000000000000000110101010110000100000000000000000001101010101100001000000000000000000011010101011000010000000000000000000110101010110000100000000000000000001101010101100001000000000000000000011010101011000010000000000000000000110101010110000100000000000000000001101010101100001000000000000000000011010101011000010000000000000000000110101010110000100000000000000000001101010101100001000000000000000000011010101011000010000000000000000000110101010110000100000000000000000001101010101100001000000000000000000011001110011000010000000000000000000110101010110000100000000000000000001101010101100001000000000000000000011010101011000010000000000000000000110101010110000100000000000000000001101010101100001000000000000000000011010101011000010000000000000000000110101010110000100000000000000000001101010101100001000000000000000000011010101011000010000000000000000000110101010110000100000000000000000001101010101100001000000000000000000011010101011000010000000000000000000110101010110000100000000000000000001101010101100001000000000000000000011010101011000010000000000000000000110101010110000100000000000000000001101010101100001000000000000000000011010101011000010000000000000000000110101010110000100000000000000000001101010101100001000000000000000000011010101011000010000000000000000000110101010110000100000000000000000001101010101100001000000000000000000011010101011000010000000000000000000110101010110000100000000000000000001101010101100001000000000000000000011001110011000010000000000001000000110101010110000100000000000010000001101010101100001000000000000100000011010101011000010000000000001000000110101010110000100000000000010000001101010101100001000000000000100000011010101011000010000000000001000000110101010110000100000000000010000001101010101100001000000000000100000011010101011000010000000000001000000110101010110000100000000000010000001101010101100001000000000000100000011010101011000010000000000001000000110101010110000100000000000010000001101010101100001000000000000100000011010101011000010000000000001000000110101010110000100000000000010000001101010101100001000000000000100000011010101011000010000000000001000000110101010110000100000000000010000001101010101100001000000000000100000011010101011000010000000000001000000110101010110000100000000000010000001101010101100001000000000000100000011010101011000010000000000001000000110101010110000100000000000010000001101010101100001000000000000100000011010101011000010000000000001000000110101010110000100000000000010000001101010101100001000000000000100000011010101011000010000000000001000000110101010110000100000000000010000001110011001100001000000000000000100111010101011000010000000000000001001110101010110000100000000000000010011101010101100001000000000000000100111010101011000010000000000000001001110101010110000100000000000000010011101010101100001000000000000000100111010101011000010000000000000001001110101010110000100000000000000010011101010101100001000000000000000100111010101011000010000000000000001001110101010110000100000000000000010011101010101100001000000000000000100111010101011000010000000000000001001110101010110000100000000000000010011101010101100001000000000000000100111010101011000010000000000000001001110101010110000100000000000000010011101010101100001000000000000000100111010101011000010000000000000001001110101010110000100000000000000010011101010101100001000000000000000100111010101011000010000000000000001001110101010110000100000000000000010011101010101100001000000000000000100111010101011000010000000000000001001110101010110000100000000000000010011101010101100001000000000000000100111010101011000010000000000000001001110101010110000100000000000000010011101010101100001000000000000000100111010101011000010000000000000001001110101010110000100000000000000010011101010101100001000000000000000100111010101011000010000000000000001001110101010110000100000000000000010011101010101100001000000000000000100110011000111000010000000000001001001110101010110000100000000000010010011101010101100001000000000000100100111010101011000010000000000001001001110101010110000100000000000010010011101010101100001000000000000100100111010101011000010000000000001001001110101010110000100000000000010010011101010101100001000000000000100100111010101011000010000000000001001001110101010110000100000000000010010011101010101100001000000000000100100111010101011000010000000000001001001110101010110000100000000000010010011101010101100001000000000000100100111010101011000010000000000001001001110101010110000100000000000010010011101010101100001000000000000100100111010101011000010000000000001001001110101010110000100000000000010010011101010101100001000000000000100100111010101011000010000000000001001001110101010110000100000000000010010011101010101100001000000000000100100111010101011000010000000000001001001110101010110000100000000000010010011101010101100001000000000000100100110011010011000010000000000001111111100000000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001001101001010101011000010000000000000011010010101010110000100000000000000110100101010101100001000000000000001101001010101011000010000000000000011010010101010110000100000000000000110100101010101100001000000000000001101001010101011000010000000000000011010010101010110000100000000000000110100101010101100001000000000000001101001010101011000010000000000000011010010101010110000100000000000000110100101010101100001000000000000001101001010101011000010000000000000011010010101010110000100000000000000110100101010101100001000000000000001101001010101011000010000000000000011010010101010110000100000000000000110100101010101100001000000000000001101001010101011000010000000000000011010010101010110000100000000000000110100101010101100001000000000000001101001010101011000010000000000000011010010101010110000100000000000000110100101010101100001000000000000001101001010101011000010000000000000011010010101010110000100000000000000110100101010101100001000000000000001101001010101011000010000000000000011010010101010110000100000000000000110100101010101100001000000000000001101001010101011000010000000000000011010010101010110000100000000000000110100101010101100001000000000000001101001010101011000010000000000000011010010101010110000100000000000000110100101010101100001000000000000001101001010110011000010000000000001011010010101010110000100000000000010110100101010101100001000000000000101101001010101011000010000000000001011010010101010110000100000000000010110100101010101100001000000000000101101001010101011000010000000000001011010010101010110000100000000000010110100101010101100001000000000000101101001010101011000010000000000001011010010101010110000100000000000010110100101010101100001000000000000101101001010101011000010000000000001011010010101010110000100000000000010110100101010101100001000000000000101101001010101011000010000000000001011010010101010110000100000000000010110100101010101100001000000000000101101001010101011000010000000000001011010010101010110000100000000000010110100101010101100001000000000000101101001010101011000010000000000001011010010101010110000100000000000010110100101010101100001000000000000101101001010101011000010000000000001011010010101010110000100000000000010110100101010101100001000000000000101101000000001011000010000000000001111111111000100110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000101010011101010101100001000000000000010100111010101011000010000000000000101001110101010110000100000000000001010011101010101100001000000000000010100111010101011000010000000000000101001110101010110000100000000000001010011101010101100001000000000000010100111010101011000010000000000000101001110101010110000100000000000001010011101010101100001000000000000010100111010101011000010000000000000101001110101010110000100000000000001010011101010101100001000000000000010100111010101011000010000000000000101001110101010110000100000000000001010011101010101100001000000000000010100111010101011000010000000000000101001110101010110000100000000000001010011101010101100001000000000000010100111010101011000010000000000000101001110101010110000100000000000001010011101010101100001000000000000010100111010101011000010000000000000101001110101010110000100000000000001010011101010101100001000000000000010100111010101011000010000000000000101001110101010110000100000000000001010011101010101100001000000000000010100111010101011000010000000000000101001110101010110000100000000000001010011101010101100001000000000000010100111010101011000010000000000000101001110101010110000100000000000001010011101010101100001000000000000010100111010101011000010000000000000101001110101010110000100000000000001010011110110101100001000000000000110100111010101011000010000000000001101001110101010110000100000000000011010011101010101100001000000000000110100111010101011000010000000000001101001110101010110000100000000000011010011101010101100001000000000000110100111010101011000010000000000001101001110101010110000100000000000011010011101010101100001000000000000110100111010101011000010000000000001101001110101010110000100000000000011010011101010101100001000000000000110100111010101011000010000000000001101001110101010110000100000000000011010011101010101100001000000000000110100111010101011000010000000000001101001110101010110000100000000000011010011101010101100001000000000000110100111010101011000010000000000001101001110101010110000100000000000011010011101010101100001000000000000110100111010101011000010000000000001101001110101010110000100000000000011010011101010101100001000000000000110100111010101011000010000000000001101001110101010110000100000000000011010011000000001100001000000000000001100111010101011000010000000000000011001110101010110000100000000000000110011101010101100001000000000000001100111010101011000010000000000000011001110101010110000100000000000000110011101010101100001000000000000001100111010101011000010000000000000011001110101010110000100000000000000110011101010101100001000000000000001100111010101011000010000000000000011001110101010110000100000000000000110011101010101100001000000000000001100111010101011000010000000000000011001110101010110000100000000000000110011101010101100001000000000000001100111010101011000010000000000000011001110101010110000100000000000000110011101010101100001000000000000001100111010101011000010000000000000011001110101010110000100000000000000110011101010101100001000000000000001100111010101011000010000000000000011001110101010110000100000000000000110011101010101100001000000000000001100111010101011000010000000000000011001110101010110000100000000000000110011101010101100001000000000000001100111010101011000010000000000000011001110101010110000100000000000000110011101010101100001000000000000001100111010101011000010000000000000011001110101010110000100000000000000110011101010101100001000000000000001100111010101011000010000000000000011001110101010110000100000000000000110011101010101100001000000000000001100111001000011000010000000000000111010010101010110000100000000000001110100101010101100001000000000000011101001010101011000010000000000000111010010101010110000100000000000001110100101010101100001000000000000011101001010101011000010000000000000111010010101010110000100000000000001110100101010101100001000000000000011101001010101011000010000000000000111010010101010110000100000000000001110100101010101100001000000000000011101001010101011000010000000000000111010010101010110000100000000000001110100101010101100001000000000000011101001010101011000010000000000000111010010101010110000100000000000001110100101010101100001000000000000011101001010101011000010000000000000111010010101010110000100000000000001110100101010101100001000000000000011101001010101011000010000000000000111010010101010110000100000000000001110100101010101100001000000000000011101001010101011000010000000000000111010010101010110000100000000000001110100101010101100001000000000000011101001010101011000010000000000000111010010101010110000100000000000001110100101010101100001000000000000011101001010101011000010000000000000111010010101010110000100000000000001110100000010001100001000000000000111101001010101011000010000000000001111010010101010110000100000000000011110100101010101100001000000000000111101001010101011000010000000000001111010010101010110000100000000000011110100101010101100001000000000000111101001010101011000010000000000001111010010101010110000100000000000011110100101010101100001000000000000111101001010101011000010000000000001111010010101010110000100000000000011110100101010101100001000000000000111101001010101011000010000000000001111010010101010110000100000000000011110100101010101100001000000000000111101001010101011000010000000000001111010010101010110000100000000000011110100101010101100001000000000000111101001010101011000010000000000001111010010101010110000100000000000011110100101010101100001000000000000111101001010101011000010000000000001111010010101010110000100000000000011110100101010101100001000000000000111101001010101011000010000000000001111010010101010110000100000000000011110100011101011100001000000000000000011001010101011000010000000000000000110010101010110000100000000000000001100101010101100001000000000000000011001010101011000010000000000000000110010101010110000100000000000000001100101010101100001000000000000000011001010101011000010000000000000000110010101010110000100000000000000001100101010101100001000000000000000011001010101011000010000000000000000110010101010110000100000000000000001100101010101100001000000000000000011001010101011000010000000000000000110010101010110000100000000000000001100101010101100001000000000000000011001010101011000010000000000000000110010101010110000100000000000000001100101010101100001000000000000000011001010101011000010000000000000000110010101010110000100000000000000001100101010101100001000000000000000011001010101011000010000000000000000110010101010110000100000000000000001100101010101100001000000000000000011001010101011000010000000000000000110010101010110000100000000000000001100101010101100001000000000000000011001010101011000010000000000000000110010101010110000100000000000000001100101010101100001000000000000000011001010101011000010000000000000000110010101010110000100000000000000001100101010101100001000000000000000011001010101011000010000000000000000110010101010110000100000000000000001100101010101100001000000000000000011000010011011000010000000000001000110010101010110000100000000000010001100101010101100001000000000000100011001010101011000010000000000001000110010101010110000100000000000010001100101010101100001000000000000100011001010101011000010000000000001000110010101010110000100000000000010001100101010101100001000000000000100011001010101011000010000000000001000110010101010110000100000000000010001100101010101100001000000000000100011001010101011000010000000000001000110010101010110000100000000000010001100101010101100001000000000000100011001010101011000010000000000001000110010101010110000100000000000010001100101010101100001000000000000100011001010101011000010000000000001000110010101010110000100000000000010001100101010101100001000000000000100011001010101011000010000000000001000110010101010110000100000000000010001100101010101100001000000000000100011001010101011000010000000000001000110010101010110000100000000000010001100101010101100001000000000000100011000010110011000010000000000001111111111111111110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001000010111010101011000010000000000000000101110101010110000100000000000000001011101010101100001000000000000000010111010101011000010000000000000000101110101010110000100000000000000001011101010101100001000000000000000010111010101011000010000000000000000101110101010110000100000000000000001011101010101100001000000000000000010111010101011000010000000000000000101110101010110000100000000000000001011101010101100001000000000000000010111010101011000010000000000000000101110101010110000100000000000000001011101010101100001000000000000000010111010101011000010000000000000000101110101010110000100000000000000001011101010101100001000000000000000010111010101011000010000000000000000101110101010110000100000000000000001011101010101100001000000000000000010111010101011000010000000000000000101110101010110000100000000000000001011101010101100001000000000000000010111010101011000010000000000000000101110101010110000100000000000000001011101010101100001000000000000000010111010101011000010000000000000000101110101010110000100000000000000001011101010101100001000000000000000010111010101011000010000000000000000101110101010110000100000000000000001011101010101100001000000000000000010111010101011000010000000000000000101110101010110000100000000000000001011101010101100001000000000000000010111011101011000010000000000001000101110101010110000100000000000010001011101010101100001000000000000100010111010101011000010000000000001000101110101010110000100000000000010001011101010101100001000000000000100010111010101011000010000000000001000101110101010110000100000000000010001011101010101100001000000000000100010111010101011000010000000000001000101110101010110000100000000000010001011101010101100001000000000000100010111010101011000010000000000001000101110101010110000100000000000010001011101010101100001000000000000100010111010101011000010000000000001000101110101010110000100000000000010001011101010101100001000000000000100010111010101011000010000000000001000101110101010110000100000000000010001011101010101100001000000000000100010111010101011000010000000000001000101110101010110000100000000000010001011101010101100001000000000000100010111010101011000010000000000001000101110101010110000100000000000010001011101010101100001000000000000100010110000000111000010000000000001000110010101010110000100000000000010001100101010101100001000000000000100011001010101011000010000000000001000110010101010110000100000000000010001100101010101100001000000000000100011001010101011000010000000000001000110010101010110000100000000000010001100101010101100001000000000000100011001010101011000010000000000001000110010101010110000100000000000010001100101010101100001000000000000100011001010101011000010000000000001000110010101010110000100000000000010001100101010101100001000000000000100011001010101011000010000000000001000110010101010110000100000000000010001100101010101100001000000000000100011001010101011000010000000000001000110010101010110000100000000000010001100101010101100001000000000000100011001010101011000010000000000001000110010101010110000100000000000010001100101010101100001000000000000100011001010101011000010000000000001000110010101010110000100000000000010001100101010101100001000000000000100011001010101011000010000000000001000110010101010110000100000000000010001100101010101100001000000000000100011001010101011000010000000000001000110010101010110000100000000000010001100101010101100001000000000000100011001010101011000010000000000001000110010101010110000100000000000010001100101010101100001000000000000100011001010101011000010000000000001000110000101100110000100000000000001001100101010101100001000000000000010011001010101011000010000000000000100110010101010110000100000000000001001100101010101100001000000000000010011001010101011000010000000000000100110010101010110000100000000000001001100101010101100001000000000000010011001010101011000010000000000000100110010101010110000100000000000001001100101010101100001000000000000010011001010101011000010000000000000100110010101010110000100000000000001001100101010101100001000000000000010011001010101011000010000000000000100110010101010110000100000000000001001100101010101100001000000000000010011001010101011000010000000000000100110010101010110000100000000000001001100101010101100001000000000000010011001010101011000010000000000000100110010101010110000100000000000001001100101010101100001000000000000010011001010101011000010000000000000100110010101010110000100000000000001001100101010101100001000000000000010011001010101011000010000000000000100110010101010110000100000000000001001100101010101100001000000000000010011001010101011000010000000000000100110010101010110000100000000000001001100101010101100001000000000000010011001000000011000010000000000001111111100001001110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001001100111010101011000010000000000000011001110101010110000100000000000000110011101010101100001000000000000001100111010101011000010000000000000011001110101010110000100000000000000110011101010101100001000000000000001100111010101011000010000000000000011001110101010110000100000000000000110011101010101100001000000000000001100111010101011000010000000000000011001110101010110000100000000000000110011101010101100001000000000000001100111010101011000010000000000000011001110101010110000100000000000000110011101010101100001000000000000001100111010101011000010000000000000011001110101010110000100000000000000110011101010101100001000000000000001100111010101011000010000000000000011001110101010110000100000000000000110011101010101100001000000000000001100111010101011000010000000000000011001110101010110000100000000000000110011101010101100001000000000000001100111010101011000010000000000000011001110101010110000100000000000000110011101010101100001000000000000001100111010101011000010000000000000011001110101010110000100000000000000110011101010101100001000000000000001100111010101011000010000000000000011001110101010110000100000000000000110011101010101100001000000000000001100111010101011000010000000000000011001110101010110000100000000000000110011101010101100001000000000000001100111001000011000010000000000001101001110101010110000000000000100011010011101010101100000000000001000110100111010101011000000000000010001101001110101010110000000000000100011010011101010101100000000000001000110100111010101011000000000000010001101001110101010110000000000000100011010011101010101100000000000001000110100111010101011000000000000010001101001110101010110000000000000100011010011101010101100000000000001000110100111010101011000000000000010001101001110101010110000000000000100011010011101010101100000000000001000110100111010101011000000000000010001101001110101010110000000000000100011010011101010101100000000000001000110100111010101011000000000000010001101001110101010110000000000000100011010011101010101100000000000001000110100111010101011000000000000010001101001110101010110000000000000100011010011101010101100000000000001000110100111010101011000000000000010001101001110101010110000000000000100011010011101010101100000000000001000110100111010101011000000000000010001101001110101010110000000000000100011010011101010101100000000000001000110100110010111111000000000000010001100110010101010110000100000000000011001100101010101100001000000000000110011001010101011000010000000000001100110010101010110000100000000000011001100101010101100001000000000000110011001010101011000010000000000001100110010101010110000100000000000011001100101010101100001000000000000110011001010101011000010000000000001100110010101010110000100000000000011001100101010101100001000000000000110011001010101011000010000000000001100110010101010110000100000000000011001100101010101100001000000000000110011001010101011000010000000000001100110010101010110000100000000000011001100101010101100001000000000000110011001010101011000010000000000001100110010101010110000100000000000011001100101010101100001000000000000110011001010101011000010000000000001100110010101010110000100000000000011001100101010101100001000000000000110011001010101011000010000000000001100110010101010110000100000000000011001100101010101100001000000000000110011001010101011000010000000000001100110010101010110000100000000000011001100101010101100001000000000000110011001010101011000010000000000001100110010101010110000100000000000011001100101010101100001000000000000110011001010101011000010000000000001100110000100100110000100000000000000101100101010101100001000000000000001011001010101011000010000000000000010110010101010110000100000000000000101100101010101100001000000000000001011001010101011000010000000000000010110010101010110000100000000000000101100101010101100001000000000000001011001010101011000010000000000000010110010101010110000100000000000000101100101010101100001000000000000001011001010101011000010000000000000010110010101010110000100000000000000101100101010101100001000000000000001011001010101011000010000000000000010110010101010110000100000000000000101100101010101100001000000000000001011001010101011000010000000000000010110010101010110000100000000000000101100101010101100001000000000000001011001010101011000010000000000000010110010101010110000100000000000000101100101010101100001000000000000001011001010101011000010000000000000010110010101010110000100000000000000101100101010101100001000000000000001011001010101011000010000000000000010110010101010110000100000000000000101100101010101100001000000000000001011001010101011000010000000000000010110010101010110000100000000000000101100101010101100001000000000000001011000100000011000010000000000001111111111111111110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011110110010101010110000100000000000011101100101010101100001000000000000111011001010101011000010000000000001110110010101010110000100000000000011101100101010101100001000000000000111011001010101011000010000000000001110110010101010110000100000000000011101100101010101100001000000000000111011001010101011000010000000000001110110010101010110000100000000000011101100101010101100001000000000000111011001010101011000010000000000001110110010101010110000100000000000011101100101010101100001000000000000111011001010101011000010000000000001110110010101010110000100000000000011101100101010101100001000000000000111011001010101011000010000000000001110110010101010110000100000000000011101100101010101100001000000000000111011001010101011000010000000000001110110010101010110000100000000000011101100101010101100001000000000000111011001010101011000010000000000001110110010101010110000100000000000011101100101010101100001000000000000111011001010101011000010000000000001110110010101010110000100000000000011101100101010101100001000000000000111011001010101011000010000000000001110110010101010110000100000000000011101100101010101100001000000000000111011001010101011000010000000000001110110010101010110000100000000000011101100101010101100001000000000000111011001010101011000010000000000001110110001100101110000100000000000000011100101010101100001000000000000000111001010101011000010000000000000001110010101010110000100000000000000011100101010101100001000000000000000111001010101011000010000000000000001110010101010110000100000000000000011100101010101100001000000000000000111001010101011000010000000000000001110010101010110000100000000000000011100101010101100001000000000000000111001010101011000010000000000000001110010101010110000100000000000000011100101010101100001000000000000000111001010101011000010000000000000001110010101010110000100000000000000011100101010101100001000000000000000111001010101011000010000000000000001110010101010110000100000000000000011100101010101100001000000000000000111001010101011000010000000000000001110010101010110000100000000000000011100101010101100001000000000000000111001010101011000010000000000000001110010101010110000100000000000000011100101010101100001000000000000000111001010101011000010000000000000001110010101010110000100000000000000011100101010101100001000000000000000111001010101011000010000000000000001110010101010110000100000000000000011100101010101100001000000000000000111000101010011000010000000000001001110010101010110000100000000000010011100101010101100001000000000000100111001010101011000010000000000001001110010101010110000100000000000010011100101010101100001000000000000100111001010101011000010000000000001001110010101010110000100000000000010011100101010101100001000000000000100111001010101011000010000000000001001110010101010110000100000000000010011100101010101100001000000000000100111001010101011000010000000000001001110010101010110000100000000000010011100101010101100001000000000000100111001010101011000010000000000001001110010101010110000100000000000010011100101010101100001000000000000100111001010101011000010000000000001001110010101010110000100000000000010011100101010101100001000000000000100111001010101011000010000000000001001110010101010110000100000000000010011100101010101100001000000000000100111001010101011000010000000000001001110010101010110000100000000000010011100101010101100001000000000000100111000010000111000010000000000001111111101111001110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001010100011010101011000010000000000000101000110101010110000100000000000001010001101010101100001000000000000010100011010101011000010000000000000101000110101010110000100000000000001010001101010101100001000000000000010100011010101011000010000000000000101000110101010110000100000000000001010001101010101100001000000000000010100011010101011000010000000000000101000110101010110000100000000000001010001101010101100001000000000000010100011010101011000010000000000000101000110101010110000100000000000001010001101010101100001000000000000010100011010101011000010000000000000101000110101010110000100000000000001010001101010101100001000000000000010100011010101011000010000000000000101000110101010110000100000000000001010001101010101100001000000000000010100011010101011000010000000000000101000110101010110000100000000000001010001101010101100001000000000000010100011010101011000010000000000000101000110101010110000100000000000001010001101010101100001000000000000010100011010101011000010000000000000101000110101010110000100000000000001010001101010101100001000000000000010100011010101011000010000000000000101000110101010110000100000000000001010001101010101100001000000000000010100011010101011000010000000000000101000110101010110000100000000000001010001101010101100001000000000000010100010000010011000010000000000001001110010101010110000100000000000010011100101010101100001000000000000100111001010101011000010000000000001001110010101010110000100000000000010011100101010101100001000000000000100111001010101011000010000000000001001110010101010110000100000000000010011100101010101100001000000000000100111001010101011000010000000000001001110010101010110000100000000000010011100101010101100001000000000000100111001010101011000010000000000001001110010101010110000100000000000010011100101010101100001000000000000100111001010101011000010000000000001001110010101010110000100000000000010011100101010101100001000000000000100111001010101011000010000000000001001110010101010110000100000000000010011100101010101100001000000000000100111001010101011000010000000000001001110010101010110000100000000000010011100101010101100001000000000000100111001010101011000010000000000001001110010101010110000100000000000010011100101010101100001000000000000100111001010101011000010000000000001001110010101010110000100000000000010011100101010101100001000000000000100111001010101011000010000000000001001110010101010110000100000000000010011100001000011100001000000000000010111001010101011000010000000000000101110010101010110000100000000000001011100101010101100001000000000000010111001010101011000010000000000000101110010101010110000100000000000001011100101010101100001000000000000010111001010101011000010000000000000101110010101010110000100000000000001011100101010101100001000000000000010111001010101011000010000000000000101110010101010110000100000000000001011100101010101100001000000000000010111001010101011000010000000000000101110010101010110000100000000000001011100101010101100001000000000000010111001010101011000010000000000000101110010101010110000100000000000001011100101010101100001000000000000010111001010101011000010000000000000101110010101010110000100000000000001011100101010101100001000000000000010111001010101011000010000000000000101110010101010110000100000000000001011100101010101100001000000000000010111001010101011000010000000000000101110010101010110000100000000000001011100101010101100001000000000000010111001010101011000010000000000000101110010101010110000100000000000001011100101010101100001000000000000010111001010101011000010000000000000101110011111011110000100000000000011011100101010101100001000000000000110111001010101011000010000000000001101110010101010110000100000000000011011100101010101100001000000000000110111001010101011000010000000000001101110010101010110000100000000000011011100101010101100001000000000000110111001010101011000010000000000001101110010101010110000100000000000011011100101010101100001000000000000110111001010101011000010000000000001101110010101010110000100000000000011011100101010101100001000000000000110111001010101011000010000000000001101110010101010110000100000000000011011100101010101100001000000000000110111001010101011000010000000000001101110010101010110000100000000000011011100101010101100001000000000000110111001010101011000010000000000001101110010101010110000100000000000011011100101010101100001000000000000110111001010101011000010000000000001101110010101010110000100000000000011011100101010101100001000000000000110111001010101011000010000000000001101110011100101110000100000000000000111100101010101100001000000000000001111001010101011000010000000000000011110010101010110000100000000000000111100101010101100001000000000000001111001010101011000010000000000000011110010101010110000100000000000000111100101010101100001000000000000001111001010101011000010000000000000011110010101010110000100000000000000111100101010101100001000000000000001111001010101011000010000000000000011110010101010110000100000000000000111100101010101100001000000000000001111001010101011000010000000000000011110010101010110000100000000000000111100101010101100001000000000000001111001010101011000010000000000000011110010101010110000100000000000000111100101010101100001000000000000001111001010101011000010000000000000011110010101010110000100000000000000111100101010101100001000000000000001111001010101011000010000000000000011110010101010110000100000000000000111100101010101100001000000000000001111001010101011000010000000000000011110010101010110000100000000000000111100101010101100001000000000000001111001010101011000010000000000000011110010101010110000100000000000000111100101010101100001000000000000001111001010101011000010000000000000011110010101010110000100000000000000111100101010101100001000000000000001111001010101011000010000000000000011110010101010110000100000000000000111100010101001100001000000000000101111001010101011000010000000000001011110010101010110000100000000000010111100101010101100001000000000000101111001010101011000010000000000001011110010101010110000100000000000010111100101010101100001000000000000101111001010101011000010000000000001011110010101010110000100000000000010111100101010101100001000000000000101111001010101011000010000000000001011110010101010110000100000000000010111100101010101100001000000000000101111001010101011000010000000000001011110010101010110000100000000000010111100101010101100001000000000000101111001010101011000010000000000001011110010101010110000100000000000010111100101010101100001000000000000101111001010101011000010000000000001011110010101010110000100000000000010111100101010101100001000000000000101111001010101011000010000000000001011110010101010110000100000000000010111100101010101100001000000000000101111001010101011000010000000000001011110010101010110000100000000000010111100111101101100001000000000000111111110000100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000101010001101010101100000000000000000010100011010101011000000000000000000101000110101010110000000000000000001010001101010101100000000000000000010100011010101011000000000000000000101000110101010110000000000000000001010001101010101100000000000000000010100011010101011000000000000000000101000110101010110000000000000000001010001101010101100000000000000000010100011010101011000000000000000000101000110101010110000000000000000001010001101010101100000000000000000010100011010101011000000000000000000101000110101010110000000000000000001010001101010101100000000000000000010100011010101011000000000000000000101000110101010110000000000000000001010001101010101100000000000000000010100011010101011000000000000000000101000110101010110000000000000000001010001101010101100000000000000000010100011010101011000000000000000000101000110101010110000000000000000001010001101010101100000000000000000010100011010101011000000000000000000101000110101010110000000000000000001010001101010101100000000000000000010100011010101011000000000000000000101000110101010110000000000000000001010001101010101100000000000000000010100011010101011000000000000000000101000110101010110000000000000000001010001101010101100000000000000000010100010010001011000000000000000001011110010101010110000100000000000010111100101010101100001000000000000101111001010101011000010000000000001011110010101010110000100000000000010111100101010101100001000000000000101111001010101011000010000000000001011110010101010110000100000000000010111100101010101100001000000000000101111001010101011000010000000000001011110010101010110000100000000000010111100101010101100001000000000000101111001010101011000010000000000001011110010101010110000100000000000010111100101010101100001000000000000101111001010101011000010000000000001011110010101010110000100000000000010111100101010101100001000000000000101111001010101011000010000000000001011110010101010110000100000000000010111100101010101100001000000000000101111001010101011000010000000000001011110010101010110000100000000000010111100101010101100001000000000000101111001010101011000010000000000001011110010101010110000100000000000010111100101010101100001000000000000101111001010101011000010000000000001011110010101010110000100000000000010111100101010101100001000000000000101111001010101011000010000000000001011110010101010110000100000000000010111100101010101100001000000000000101111001010101011000010000000000001011110011110110110000100000000000001111100101010101100001000000000000011111001010101011000010000000000000111110010101010110000100000000000001111100101010101100001000000000000011111001010101011000010000000000000111110010101010110000100000000000001111100101010101100001000000000000011111001010101011000010000000000000111110010101010110000100000000000001111100101010101100001000000000000011111001010101011000010000000000000111110010101010110000100000000000001111100101010101100001000000000000011111001010101011000010000000000000111110010101010110000100000000000001111100101010101100001000000000000011111001010101011000010000000000000111110010101010110000100000000000001111100101010101100001000000000000011111001010101011000010000000000000111110010101010110000100000000000001111100101010101100001000000000000011111001010101011000010000000000000111110010101010110000100000000000001111100101010101100001000000000000011111001010101011000010000000000000111110010101010110000100000000000001111100101010101100001000000000000011111001010101011000010000000000000111110010101010110000100000000000001111100101010101100001000000000000011111000010001011000010000000000001111110010101010110000100000000000011111100101010101100001000000000000111111001010101011000010000000000001111110010101010110000100000000000011111100101010101100001000000000000111111001010101011000010000000000001111110010101010110000100000000000011111100101010101100001000000000000111111001010101011000010000000000001111110010101010110000100000000000011111100101010101100001000000000000111111001010101011000010000000000001111110010101010110000100000000000011111100101010101100001000000000000111111001010101011000010000000000001111110010101010110000100000000000011111100101010101100001000000000000111111001010101011000010000000000001111110010101010110000100000000000011111100101010101100001000000000000111111001010101011000010000000000001111110010101010110000100000000000011111100101010101100001000000000000111111001010101011000010000000000001111110010101010110000100000000000011111100101010101100001000000000000111111000111010111000010000000000001111111111010110110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001001000001010101011000010000000000000010000010101010110000100000000000000100000101010101100001000000000000001000001010101011000010000000000000010000010101010110000100000000000000100000101010101100001000000000000001000001010101011000010000000000000010000010101010110000100000000000000100000101010101100001000000000000001000001010101011000010000000000000010000010101010110000100000000000000100000101010101100001000000000000001000001010101011000010000000000000010000010101010110000100000000000000100000101010101100001000000000000001000001010101011000010000000000000010000010101010110000100000000000000100000101010101100001000000000000001000001010101011000010000000000000010000010101010110000100000000000000100000101010101100001000000000000001000001010101011000010000000000000010000010101010110000100000000000000100000101010101100001000000000000001000001010101011000010000000000000010000010101010110000100000000000000100000101010101100001000000000000001000001010101011000010000000000000010000010101010110000100000000000000100000101010101100001000000000000001000001010101011000010000000000000010000010101010110000100000000000000100000101010101100001000000000000001000001010101011000010000000000000010000010101010110000100000000000000100000101010101100001000000000000001000001100000011000010000000000001111111111111111110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000010010000010101010110000000000000000000100000101010101100000000000000000001000001010101011000000000000000000010000010101010110000000000000000000100000101010101100000000000000000001000001010101011000000000000000000010000010101010110000000000000000000100000101010101100000000000000000001000001010101011000000000000000000010000010101010110000000000000000000100000101010101100000000000000000001000001010101011000000000000000000010000010101010110000000000000000000100000101010101100000000000000000001000001010101011000000000000000000010000010101010110000000000000000000100000101010101100000000000000000001000001010101011000000000000000000010000010101010110000000000000000000100000101010101100000000000000000001000001010101011000000000000000000010000010101010110000000000000000000100000101010101100000000000000000001000001010101011000000000000000000010000010101010110000000000000000000100000101010101100000000000000000001000001010101011000000000000000000010000010101010110000000000000000000100000101010101100000000000000000001000001010101011000000000000000000010000010101010110000000000000000000100000101010101100000000000000000001000001010101011000000000000000000010000010101010110000000000000000000100000000100001100000000000000000111111001010101011000010000000000001111110010101010110000100000000000011111100101010101100001000000000000111111001010101011000010000000000001111110010101010110000100000000000011111100101010101100001000000000000111111001010101011000010000000000001111110010101010110000100000000000011111100101010101100001000000000000111111001010101011000010000000000001111110010101010110000100000000000011111100101010101100001000000000000111111001010101011000010000000000001111110010101010110000100000000000011111100101010101100001000000000000111111001010101011000010000000000001111110010101010110000100000000000011111100101010101100001000000000000111111001010101011000010000000000001111110010101010110000100000000000011111100101010101100001000000000000111111001010101011000010000000000001111110010101010110000100000000000011111100101010101100001000000000000111111001010101011000010000000000001111110010101010110000100000000000011111100101010101100001000000000000111111001010101011000010000000000001111110010101010110000100000000000011111100101010101100001000000000000111111001010101011000010000000000001111110010101010110000100000000000011111100101010101100001000000000000111111000111010111000010000000000000000001010101010110000100000000000000000010101010101100001000000000000000000101010101011000010000000000000000001010101010110000100000000000000000010101010101100001000000000000000000101010101011000010000000000000000001010101010110000100000000000000000010101010101100001000000000000000000101010101011000010000000000000000001010101010110000100000000000000000010101010101100001000000000000000000101010101011000010000000000000000001010101010110000100000000000000000010101010101100001000000000000000000101010101011000010000000000000000001010101010110000100000000000000000010101010101100001000000000000000000101010101011000010000000000000000001010101010110000100000000000000000010101010101100001000000000000000000101010101011000010000000000000000001010101010110000100000000000000000010101010101100001000000000000000000101010101011000010000000000000000001010101010110000100000000000000000010101010101100001000000000000000000101010101011000010000000000000000001010101010110000100000000000000000010101010101100001000000000000000000101010101011000010000000000000000001010101010110000100000000000000000010000101011100001000000000000100000101010101011000010000000000001000001010101010110000100000000000010000010101010101100001000000000000100000101010101011000010000000000001000001010101010110000100000000000010000010101010101100001000000000000100000101010101011000010000000000001000001010101010110000100000000000010000010101010101100001000000000000100000101010101011000010000000000001000001010101010110000100000000000010000010101010101100001000000000000100000101010101011000010000000000001000001010101010110000100000000000010000010101010101100001000000000000100000101010101011000010000000000001000001010101010110000100000000000010000010101010101100001000000000000100000101010101011000010000000000001000001010101010110000100000000000010000010101010101100001000000000000100000101010101011000010000000000001000001010101010110000100000000000010000010101010101100001000000000000100000101010101011000010000000000001000001010101010110000100000000000010000010000011001100001000000000000111111110110011111000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000100001101101010101100001000000000000000011011010101011000010000000000000000110110101010110000100000000000000001101101010101100001000000000000000011011010101011000010000000000000000110110101010110000100000000000000001101101010101100001000000000000000011011010101011000010000000000000000110110101010110000100000000000000001101101010101100001000000000000000011011010101011000010000000000000000110110101010110000100000000000000001101101010101100001000000000000000011011010101011000010000000000000000110110101010110000100000000000000001101101010101100001000000000000000011011010101011000010000000000000000110110101010110000100000000000000001101101010101100001000000000000000011011010101011000010000000000000000110110101010110000100000000000000001101101010101100001000000000000000011011010101011000010000000000000000110110101010110000100000000000000001101101010101100001000000000000000011011010101011000010000000000000000110110101010110000100000000000000001101101010101100001000000000000000011011010101011000010000000000000000110110101010110000100000000000000001101101010101100001000000000000000011011010101011000010000000000000000110110101010110000100000000000000001101101010101100001000000000000000011011010101011000010000000000000000110110101010110000100000000000000001101011100101100001000000000000100011011010101011000010000000000001000110110101010110000100000000000010001101101010101100001000000000000100011011010101011000010000000000001000110110101010110000100000000000010001101101010101100001000000000000100011011010101011000010000000000001000110110101010110000100000000000010001101101010101100001000000000000100011011010101011000010000000000001000110110101010110000100000000000010001101101010101100001000000000000100011011010101011000010000000000001000110110101010110000100000000000010001101101010101100001000000000000100011011010101011000010000000000001000110110101010110000100000000000010001101101010101100001000000000000100011011010101011000010000000000001000110110101010110000100000000000010001101101010101100001000000000000100011011010101011000010000000000001000110110101010110000100000000000010001101101010101100001000000000000100011011010101011000010000000000001000110110101010110000100000000000010001101000000001100001000000000000010000101010101011000010000000000000100001010101010110000100000000000001000010101010101100001000000000000010000101010101011000010000000000000100001010101010110000100000000000001000010101010101100001000000000000010000101010101011000010000000000000100001010101010110000100000000000001000010101010101100001000000000000010000101010101011000010000000000000100001010101010110000100000000000001000010101010101100001000000000000010000101010101011000010000000000000100001010101010110000100000000000001000010101010101100001000000000000010000101010101011000010000000000000100001010101010110000100000000000001000010101010101100001000000000000010000101010101011000010000000000000100001010101010110000100000000000001000010101010101100001000000000000010000101010101011000010000000000000100001010101010110000100000000000001000010101010101100001000000000000010000101010101011000010000000000000100001010101010110000100000000000001000010101010101100001000000000000010000101010101011000010000000000000100001010101010110000100000000000001000010101010101100001000000000000010000101010101011000010000000000000100001010101010110000100000000000001000010101010101100001000000000000010000101010101011000010000000000000100001010101010110000100000000000001000010101010101100001000000000000010000100110010111000010000000000001100001010101010110000100000000000011000010101010101100001000000000000110000101010101011000010000000000001100001010101010110000100000000000011000010101010101100001000000000000110000101010101011000010000000000001100001010101010110000100000000000011000010101010101100001000000000000110000101010101011000010000000000001100001010101010110000100000000000011000010101010101100001000000000000110000101010101011000010000000000001100001010101010110000100000000000011000010101010101100001000000000000110000101010101011000010000000000001100001010101010110000100000000000011000010101010101100001000000000000110000101010101011000010000000000001100001010101010110000100000000000011000010101010101100001000000000000110000101010101011000010000000000001100001010101010110000100000000000011000010101010101100001000000000000110000101010101011000010000000000001100001010101010110000100000000000011000010101010101100001000000000000110000100001000111000010000000000000010001010101010110000100000000000000100010101010101100001000000000000001000101010101011000010000000000000010001010101010110000100000000000000100010101010101100001000000000000001000101010101011000010000000000000010001010101010110000100000000000000100010101010101100001000000000000001000101010101011000010000000000000010001010101010110000100000000000000100010101010101100001000000000000001000101010101011000010000000000000010001010101010110000100000000000000100010101010101100001000000000000001000101010101011000010000000000000010001010101010110000100000000000000100010101010101100001000000000000001000101010101011000010000000000000010001010101010110000100000000000000100010101010101100001000000000000001000101010101011000010000000000000010001010101010110000100000000000000100010101010101100001000000000000001000101010101011000010000000000000010001010101010110000100000000000000100010101010101100001000000000000001000101010101011000010000000000000010001010101010110000100000000000000100010101010101100001000000000000001000101010101011000010000000000000010001010101010110000100000000000000100010101010101100001000000000000001000101010101011000010000000000000010001010101010110000100000000000000100010101010101100001000000000000001000101010101011000010000000000000010001001101000110000100000000000011111111110001011100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000101101000101010101100001000000000000011010001010101011000010000000000000110100010101010110000100000000000001101000101010101100001000000000000011010001010101011000010000000000000110100010101010110000100000000000001101000101010101100001000000000000011010001010101011000010000000000000110100010101010110000100000000000001101000101010101100001000000000000011010001010101011000010000000000000110100010101010110000100000000000001101000101010101100001000000000000011010001010101011000010000000000000110100010101010110000100000000000001101000101010101100001000000000000011010001010101011000010000000000000110100010101010110000100000000000001101000101010101100001000000000000011010001010101011000010000000000000110100010101010110000100000000000001101000101010101100001000000000000011010001010101011000010000000000000110100010101010110000100000000000001101000101010101100001000000000000011010001010101011000010000000000000110100010101010110000100000000000001101000101010101100001000000000000011010001010101011000010000000000000110100010101010110000100000000000001101000101010101100001000000000000011010001010101011000010000000000000110100010101010110000100000000000001101000101010101100001000000000000011010001010101011000010000000000000110100010101010110000100000000000001101000000000011100001000000000000101000101010101011000010000000000001010001010101010110000100000000000010100010101010101100001000000000000101000101010101011000010000000000001010001010101010110000100000000000010100010101010101100001000000000000101000101010101011000010000000000001010001010101010110000100000000000010100010101010101100001000000000000101000101010101011000010000000000001010001010101010110000100000000000010100010101010101100001000000000000101000101010101011000010000000000001010001010101010110000100000000000010100010101010101100001000000000000101000101010101011000010000000000001010001010101010110000100000000000010100010101010101100001000000000000101000101010101011000010000000000001010001010101010110000100000000000010100010101010101100001000000000000101000101010101011000010000000000001010001010101010110000100000000000010100010101010101100001000000000000101000101010101011000010000000000001010001010101010110000100000000000010100010101010101100001000000000000101000101010101011000010000000000001010001010101010110000100000000000010100010101010101100001000000000000101000101010101011000010000000000001010001001111001110000100000000000001100010101010101100001000000000000011000101010101011000010000000000000110001010101010110000100000000000001100010101010101100001000000000000011000101010101011000010000000000000110001010101010110000100000000000001100010101010101100001000000000000011000101010101011000010000000000000110001010101010110000100000000000001100010101010101100001000000000000011000101010101011000010000000000000110001010101010110000100000000000001100010101010101100001000000000000011000101010101011000010000000000000110001010101010110000100000000000001100010101010101100001000000000000011000101010101011000010000000000000110001010101010110000100000000000001100010101010101100001000000000000011000101010101011000010000000000000110001010101010110000100000000000001100010101010101100001000000000000011000101010101011000010000000000000110001010101010110000100000000000001100010101010101100001000000000000011000101010101011000010000000000000110001010101010110000100000000000001100010101010101100001000000000000011000101010101011000010000000000000110001010101010110000100000000000001100010101010101100001000000000000011000100000101011000010000000000001111111100101100110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000010000101010101010110000100000000000000001010101010101100001000000000000000010101010101011000010000000000000000101010101010110000100000000000000001010101010101100001000000000000000010101010101011000010000000000000000101010101010110000100000000000000001010101010101100001000000000000000010101010101011000010000000000000000101010101010110000100000000000000001010101010101100001000000000000000010101010101011000010000000000000000101010101010110000100000000000000001010101010101100001000000000000000010101010101011000010000000000000000101010101010110000100000000000000001010101010101100001000000000000000010101010101011000010000000000000000101010101010110000100000000000000001010101010101100001000000000000000010101010101011000010000000000000000101010101010110000100000000000000001010101010101100001000000000000000010101010101011000010000000000000000101010101010110000100000000000000001010101010101100001000000000000000010101010101011000010000000000000000101010101010110000100000000000000001010101010101100001000000000000000010101010101011000010000000000000000101010101010110000100000000000000001010101010101100001000000000000000010101010101011000010000000000000000101010101010110000100000000000000001010101010101100001000000000000000010101010101011000010000000000000000101011110010110000100000000000010001010101010101100001000000000000100010101010101011000010000000000001000101010101010110000100000000000010001010101010101100001000000000000100010101010101011000010000000000001000101010101010110000100000000000010001010101010101100001000000000000100010101010101011000010000000000001000101010101010110000100000000000010001010101010101100001000000000000100010101010101011000010000000000001000101010101010110000100000000000010001010101010101100001000000000000100010101010101011000010000000000001000101010101010110000100000000000010001010101010101100001000000000000100010101010101011000010000000000001000101010101010110000100000000000010001010101010101100001000000000000100010101010101011000010000000000001000101010101010110000100000000000010001010101010101100001000000000000100010101010101011000010000000000001000101010101010110000100000000000010001010101010101100001000000000000100010101010101011000010000000000001000101000000000110000100000000000011100010101010101100001000000000000111000101010101011000010000000000001110001010101010110000100000000000011100010101010101100001000000000000111000101010101011000010000000000001110001010101010110000100000000000011100010101010101100001000000000000111000101010101011000010000000000001110001010101010110000100000000000011100010101010101100001000000000000111000101010101011000010000000000001110001010101010110000100000000000011100010101010101100001000000000000111000101010101011000010000000000001110001010101010110000100000000000011100010101010101100001000000000000111000101010101011000010000000000001110001010101010110000100000000000011100010101010101100001000000000000111000101010101011000010000000000001110001010101010110000100000000000011100010101010101100001000000000000111000101010101011000010000000000001110001010101010110000100000000000011100010101010101100001000000000000111000101010101011000010000000000001110001010101010110000100000000000011100010101010101100001000000000000111000101010101011000010000000000001110001010101010110000100000000000011100010101010101100001000000000000111000101010101011000010000000000001110001010101010110000100000000000011100010101010101100001000000000000111000101010101011000010000000000001110001010101010110000100000000000011100010111001011100001000000000000000100101010101011000010000000000000001001010101010110000100000000000000010010101010101100001000000000000000100101010101011000010000000000000001001010101010110000100000000000000010010101010101100001000000000000000100101010101011000010000000000000001001010101010110000100000000000000010010101010101100001000000000000000100101010101011000010000000000000001001010101010110000100000000000000010010101010101100001000000000000000100101010101011000010000000000000001001010101010110000100000000000000010010101010101100001000000000000000100101010101011000010000000000000001001010101010110000100000000000000010010101010101100001000000000000000100101010101011000010000000000000001001010101010110000100000000000000010010101010101100001000000000000000100101010101011000010000000000000001001010101010110000100000000000000010010101010101100001000000000000000100101010101011000010000000000000001001010101010110000100000000000000010010101010101100001000000000000000100101010101011000010000000000000001001010101010110000100000000000000010010101010101100001000000000000000100101010101011000010000000000000001001001010000110000100000000000010010010101010101100001000000000000100100101010101011000010000000000001001001010101010110000100000000000010010010101010101100001000000000000100100101010101011000010000000000001001001010101010110000100000000000010010010101010101100001000000000000100100101010101011000010000000000001001001010101010110000100000000000010010010101010101100001000000000000100100101010101011000010000000000001001001010101010110000100000000000010010010101010101100001000000000000100100101010101011000010000000000001001001010101010110000100000000000010010010101010101100001000000000000100100101010101011000010000000000001001001010101010110000100000000000010010010101010101100001000000000000100100101010101011000010000000000001001001010101010110000100000000000010010010101010101100001000000000000100100101010101011000010000000000001001001010101010110000100000000000010010010101010101100001000000000000100100101010101011000010000000000001001001001100101110000100000000000011111111111001111100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000010101000010101010110000000000000100001010000101010101100000000000001000010100001010101011000000000000010000101000010101010110000000000000100001010000101010101100000000000001000010100001010101011000000000000010000101000010101010110000000000000100001010000101010101100000000000001000010100001010101011000000000000010000101000010101010110000000000000100001010000101010101100000000000001000010100001010101011000000000000010000101000010101010110000000000000100001010000101010101100000000000001000010100001010101011000000000000010000101000010101010110000000000000100001010000101010101100000000000001000010100001010101011000000000000010000101000010101010110000000000000100001010000101010101100000000000001000010100001010101011000000000000010000101000010101010110000000000000100001010000101010101100000000000001000010100001010101011000000000000010000101000010101010110000000000000100001010000101010101100000000000001000010100001010101011000000000000010000101000010101010110000000000000100001010000101010101100000000000001000010100001010101011000000000000010000101000010101010110000000000000100001010000101010101100000000000001000010100001010101011000000000000010000101000010101010110000000000000100001010000101010101100000000000001000010100001010101011000000000000010000101000000000100110000000000000100010010010101010101100001000000000000100100101010101011000010000000000001001001010101010110000100000000000010010010101010101100001000000000000100100101010101011000010000000000001001001010101010110000100000000000010010010101010101100001000000000000100100101010101011000010000000000001001001010101010110000100000000000010010010101010101100001000000000000100100101010101011000010000000000001001001010101010110000100000000000010010010101010101100001000000000000100100101010101011000010000000000001001001010101010110000100000000000010010010101010101100001000000000000100100101010101011000010000000000001001001010101010110000100000000000010010010101010101100001000000000000100100101010101011000010000000000001001001010101010110000100000000000010010010101010101100001000000000000100100101010101011000010000000000001001001010101010110000100000000000010010010101010101100001000000000000100100101010101011000010000000000001001001010101010110000100000000000010010010101010101100001000000000000100100101010101011000010000000000001001001010101010110000100000000000010010010101010101100001000000000000100100100110010111000010000000000000101001010101010110000100000000000001010010101010101100001000000000000010100101010101011000010000000000000101001010101010110000100000000000001010010101010101100001000000000000010100101010101011000010000000000000101001010101010110000100000000000001010010101010101100001000000000000010100101010101011000010000000000000101001010101010110000100000000000001010010101010101100001000000000000010100101010101011000010000000000000101001010101010110000100000000000001010010101010101100001000000000000010100101010101011000010000000000000101001010101010110000100000000000001010010101010101100001000000000000010100101010101011000010000000000000101001010101010110000100000000000001010010101010101100001000000000000010100101010101011000010000000000000101001010101010110000100000000000001010010101010101100001000000000000010100101010101011000010000000000000101001010101010110000100000000000001010010101010101100001000000000000010100101010101011000010000000000000101001010101010110000100000000000001010010101010101100001000000000000010100101010101011000010000000000000101001010101010110000100000000000001010010101010101100001000000000000010100101010101011000010000000000000101001000100111110000100000000000011010010101010101100001000000000000110100101010101011000010000000000001101001010101010110000100000000000011010010101010101100001000000000000110100101010101011000010000000000001101001010101010110000100000000000011010010101010101100001000000000000110100101010101011000010000000000001101001010101010110000100000000000011010010101010101100001000000000000110100101010101011000010000000000001101001010101010110000100000000000011010010101010101100001000000000000110100101010101011000010000000000001101001010101010110000100000000000011010010101010101100001000000000000110100101010101011000010000000000001101001010101010110000100000000000011010010101010101100001000000000000110100101010101011000010000000000001101001010101010110000100000000000011010010101010101100001000000000000110100101010101011000010000000000001101001010101010110000100000000000011010010101000011100001000000000000110100111010101011000010000000000001101001110101010110000100000000000011010011101010101100001000000000000110100111010101011000010000000000001101001110101010110000100000000000011010011101010101100001000000000000110100111010101011000010000000000001101001110101010110000100000000000011010011101010101100001000000000000110100111010101011000010000000000001101001110101010110000100000000000011010011101010101100001000000000000110100111010101011000010000000000001101001110101010110000100000000000011010011101010101100001000000000000110100111010101011000010000000000001101001110101010110000100000000000011010011101010101100001000000000000110100111010101011000010000000000001101001110101010110000100000000000011010011101010101100001000000000000110100111010101011000010000000000001101001110101010110000100000000000011010011101010101100001000000000000110100111010101011000010000000000001101001110101010110000100000000000011010011101010101100001000000000000110100111010101011000010000000000001101001110101010110000100000000000011010011101010101100001000000000000110100111010101011000010000000000001101001110101010110000100000000000011010011101010101100001000000000000110100111010101011000010000000000001101001110101010110000100000000000011010011101010101100001000000000000110100110000000111000010000000000001101001010101010110000100000000000011010010101010101100001000000000000110100101010101011000010000000000001101001010101010110000100000000000011010010101010101100001000000000000110100101010101011000010000000000001101001010101010110000100000000000011010010101010101100001000000000000110100101010101011000010000000000001101001010101010110000100000000000011010010101010101100001000000000000110100101010101011000010000000000001101001010101010110000100000000000011010010101010101100001000000000000110100101010101011000010000000000001101001010101010110000100000000000011010010101010101100001000000000000110100101010101011000010000000000001101001010101010110000100000000000011010010101010101100001000000000000110100101010101011000010000000000001101001010101010110000100000000000011010010101010101100001000000000000110100101010101011000010000000000001101001010101010110000100000000000011010010101010101100001000000000000110100101010101011000010000000000001101001010101010110000100000000000011010010101010101100001000000000000110100101010101011000010000000000001101001010101010110000100000000000011010010101010101100001000000000000110100101010101011000010000000000001101001010100001110000100000000000000110010101010101100001000000000000001100101010101011000010000000000000011001010101010110000100000000000000110010101010101100001000000000000001100101010101011000010000000000000011001010101010110000100000000000000110010101010101100001000000000000001100101010101011000010000000000000011001010101010110000100000000000000110010101010101100001000000000000001100101010101011000010000000000000011001010101010110000100000000000000110010101010101100001000000000000001100101010101011000010000000000000011001010101010110000100000000000000110010101010101100001000000000000001100101010101011000010000000000000011001010101010110000100000000000000110010101010101100001000000000000001100101010101011000010000000000000011001010101010110000100000000000000110010101010101100001000000000000001100101010101011000010000000000000011001010101010110000100000000000000110010101010101100001000000000000001100101010101011000010000000000000011001010101010110000100000000000000110010101010101100001000000000000001100101010101011000010000000000000011001010101010110000100000000000000110010100000001100001000000000000101100101010101011000010000000000001011001010101010110000100000000000010110010101010101100001000000000000101100101010101011000010000000000001011001010101010110000100000000000010110010101010101100001000000000000101100101010101011000010000000000001011001010101010110000100000000000010110010101010101100001000000000000101100101010101011000010000000000001011001010101010110000100000000000010110010101010101100001000000000000101100101010101011000010000000000001011001010101010110000100000000000010110010101010101100001000000000000101100101010101011000010000000000001011001010101010110000100000000000010110010101010101100001000000000000101100101010101011000010000000000001011001010101010110000100000000000010110010101010101100001000000000000101100101010101011000010000000000001011001010101010110000100000000000010110010101010101100001000000000000101100101010101011000010000000000001011001001100100110000100000000000001110010101010101100001000000000000011100101010101011000010000000000000111001010101010110000100000000000001110010101010101100001000000000000011100101010101011000010000000000000111001010101010110000100000000000001110010101010101100001000000000000011100101010101011000010000000000000111001010101010110000100000000000001110010101010101100001000000000000011100101010101011000010000000000000111001010101010110000100000000000001110010101010101100001000000000000011100101010101011000010000000000000111001010101010110000100000000000001110010101010101100001000000000000011100101010101011000010000000000000111001010101010110000100000000000001110010101010101100001000000000000011100101010101011000010000000000000111001010101010110000100000000000001110010101010101100001000000000000011100101010101011000010000000000000111001010101010110000100000000000001110010101010101100001000000000000011100101010101011000010000000000000111001010101010110000100000000000001110010101010101100001000000000000011100101010101011000010000000000000111001010101010110000100000000000001110010101010101100001000000000000011100101010101011000010000000000000111001010101010110000100000000000001110010101010101100001000000000000011100101010101011000010000000000000111001010101010110000100000000000001110010101010101100001000000000000011100101010101011000010000000000000111001011110100110000100000000000011111111101101011100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111100101010101011000010000000000001111001010101010110000100000000000011110010101010101100001000000000000111100101010101011000010000000000001111001010101010110000100000000000011110010101010101100001000000000000111100101010101011000010000000000001111001010101010110000100000000000011110010101010101100001000000000000111100101010101011000010000000000001111001010101010110000100000000000011110010101010101100001000000000000111100101010101011000010000000000001111001010101010110000100000000000011110010101010101100001000000000000111100101010101011000010000000000001111001010101010110000100000000000011110010101010101100001000000000000111100101010101011000010000000000001111001010101010110000100000000000011110010101010101100001000000000000111100101010101011000010000000000001111001010101010110000100000000000011110010101010101100001000000000000111100101010101011000010000000000001111001010101010110000100000000000011110010101010101100001000000000000111100101010101011000010000000000001111001010101010110000100000000000011110010101010101100001000000000000111100101010101011000010000000000001111001001100101110000100000000000000001010101010101100001000000000000000010101010101011000010000000000000000101010101010110000100000000000000001010101010101100001000000000000000010101010101011000010000000000000000101010101010110000100000000000000001010101010101100001000000000000000010101010101011000010000000000000000101010101010110000100000000000000001010101010101100001000000000000000010101010101011000010000000000000000101010101010110000100000000000000001010101010101100001000000000000000010101010101011000010000000000000000101010101010110000100000000000000001010101010101100001000000000000000010101010101011000010000000000000000101010101010110000100000000000000001010101010101100001000000000000000010101010101011000010000000000000000101010101010110000100000000000000001010101010101100001000000000000000010101010101011000010000000000000000101010101010110000100000000000000001010101010101100001000000000000000010101010101011000010000000000000000101010101010110000100000000000000001010101010101100001000000000000000010101010101011000010000000000000000101010101010110000100000000000000001010101010101100001000000000000000010101010101011000010000000000000000101010101010110000100000000000000001010101010101100001000000000000000010101010101011000010000000000000000101010101010110000100000000000000001010100001101100001000000000000100010101010101011000010000000000001000101010101010110000100000000000010001010101010101100001000000000000100010101010101011000010000000000001000101010101010110000100000000000010001010101010101100001000000000000100010101010101011000010000000000001000101010101010110000100000000000010001010101010101100001000000000000100010101010101011000010000000000001000101010101010110000100000000000010001010101010101100001000000000000100010101010101011000010000000000001000101010101010110000100000000000010001010101010101100001000000000000100010101010101011000010000000000001000101010101010110000100000000000010001010101010101100001000000000000100010101010101011000010000000000001000101010101010110000100000000000010001010101010101100001000000000000100010101010101011000010000000000001000101010101010110000100000000000010001010101010101100001000000000000100010101010101011000010000000000001000101010101010110000100000000000010001010100000011100001000000000000111111110111111011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000100110011101010101100001000000000000001100111010101011000010000000000000011001110101010110000100000000000000110011101010101100001000000000000001100111010101011000010000000000000011001110101010110000100000000000000110011101010101100001000000000000001100111010101011000010000000000000011001110101010110000100000000000000110011101010101100001000000000000001100111010101011000010000000000000011001110101010110000100000000000000110011101010101100001000000000000001100111010101011000010000000000000011001110101010110000100000000000000110011101010101100001000000000000001100111010101011000010000000000000011001110101010110000100000000000000110011101010101100001000000000000001100111010101011000010000000000000011001110101010110000100000000000000110011101010101100001000000000000001100111010101011000010000000000000011001110101010110000100000000000000110011101010101100001000000000000001100111010101011000010000000000000011001110101010110000100000000000000110011101010101100001000000000000001100111010101011000010000000000000011001110101010110000100000000000000110011101010101100001000000000000001100111010101011000010000000000000011001110101010110000100000000000000110011101010101100001000000000000001100111010101011000010000000000000011001110101010110000100000000000000110011100100001100001000000000000100010101010101011000010000000000001000101010101010110000100000000000010001010101010101100001000000000000100010101010101011000010000000000001000101010101010110000100000000000010001010101010101100001000000000000100010101010101011000010000000000001000101010101010110000100000000000010001010101010101100001000000000000100010101010101011000010000000000001000101010101010110000100000000000010001010101010101100001000000000000100010101010101011000010000000000001000101010101010110000100000000000010001010101010101100001000000000000100010101010101011000010000000000001000101010101010110000100000000000010001010101010101100001000000000000100010101010101011000010000000000001000101010101010110000100000000000010001010101010101100001000000000000100010101010101011000010000000000001000101010101010110000100000000000010001010101010101100001000000000000100010101010101011000010000000000001000101010101010110000100000000000010001010101010101100001000000000000100010101010101011000010000000000001000101010101010110000100000000000010001010101010101100001000000000000100010101010101011000010000000000001000101010000001110000100000000000001001010101010101100001000000000000010010101010101011000010000000000000100101010101010110000100000000000001001010101010101100001000000000000010010101010101011000010000000000000100101010101010110000100000000000001001010101010101100001000000000000010010101010101011000010000000000000100101010101010110000100000000000001001010101010101100001000000000000010010101010101011000010000000000000100101010101010110000100000000000001001010101010101100001000000000000010010101010101011000010000000000000100101010101010110000100000000000001001010101010101100001000000000000010010101010101011000010000000000000100101010101010110000100000000000001001010101010101100001000000000000010010101010101011000010000000000000100101010101010110000100000000000001001010101010101100001000000000000010010101010101011000010000000000000100101010101010110000100000000000001001010101010101100001000000000000010010101010101011000010000000000000100101010101010110000100000000000001001010101010101100001000000000000010010101010101011000010000000000000100101010101010110000100000000000001001010101010101100001000000000000010010100110000011000010000000000001100101010101010110000100000000000011001010101010101100001000000000000110010101010101011000010000000000001100101010101010110000100000000000011001010101010101100001000000000000110010101010101011000010000000000001100101010101010110000100000000000011001010101010101100001000000000000110010101010101011000010000000000001100101010101010110000100000000000011001010101010101100001000000000000110010101010101011000010000000000001100101010101010110000100000000000011001010101010101100001000000000000110010101010101011000010000000000001100101010101010110000100000000000011001010101010101100001000000000000110010101010101011000010000000000001100101010101010110000100000000000011001010101010101100001000000000000110010101010101011000010000000000001100101010101010110000100000000000011001010101010101100001000000000000110010101010101011000010000000000001100101010101010110000100000000000011001010101010101100001000000000000110010100110010011000010000000000000010101010101010110000100000000000000101010101010101100001000000000000001010101010101011000010000000000000010101010101010110000100000000000000101010101010101100001000000000000001010101010101011000010000000000000010101010101010110000100000000000000101010101010101100001000000000000001010101010101011000010000000000000010101010101010110000100000000000000101010101010101100001000000000000001010101010101011000010000000000000010101010101010110000100000000000000101010101010101100001000000000000001010101010101011000010000000000000010101010101010110000100000000000000101010101010101100001000000000000001010101010101011000010000000000000010101010101010110000100000000000000101010101010101100001000000000000001010101010101011000010000000000000010101010101010110000100000000000000101010101010101100001000000000000001010101010101011000010000000000000010101010101010110000100000000000000101010101010101100001000000000000001010101010101011000010000000000000010101010101010110000100000000000000101010101010101100001000000000000001010101010101011000010000000000000010101010101010110000100000000000000101010101010101100001000000000000001010101010101011000010000000000000010101010101010110000100000000000000101010101010101100001000000000000001010101010101011000010000000000000010101010010100110000100000000000011111111010010001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000101111110101010101100001000000000000011111101010101011000010000000000000111111010101010110000100000000000001111110101010101100001000000000000011111101010101011000010000000000000111111010101010110000100000000000001111110101010101100001000000000000011111101010101011000010000000000000111111010101010110000100000000000001111110101010101100001000000000000011111101010101011000010000000000000111111010101010110000100000000000001111110101010101100001000000000000011111101010101011000010000000000000111111010101010110000100000000000001111110101010101100001000000000000011111101010101011000010000000000000111111010101010110000100000000000001111110101010101100001000000000000011111101010101011000010000000000000111111010101010110000100000000000001111110101010101100001000000000000011111101010101011000010000000000000111111010101010110000100000000000001111110101010101100001000000000000011111101010101011000010000000000000111111010101010110000100000000000001111110101010101100001000000000000011111101010101011000010000000000000111111010101010110000100000000000001111110101010101100001000000000000011111101010101011000010000000000000111111010101010110000100000000000001111110101010101100001000000000000011111101010101011000010000000000000111111010101010110000100000000000001111110011001011100001000000000000111111101010101011000010000000000001111111010101010110000100000000000011111110101010101100001000000000000111111101010101011000010000000000001111111010101010110000100000000000011111110101010101100001000000000000111111101010101011000010000000000001111111010101010110000100000000000011111110101010101100001000000000000111111101010101011000010000000000001111111010101010110000100000000000011111110101010101100001000000000000111111101010101011000010000000000001111111010101010110000100000000000011111110101010101100001000000000000111111101010101011000010000000000001111111010101010110000100000000000011111110101010101100001000000000000111111101010101011000010000000000001111111010101010110000100000000000011111110101010101100001000000000000111111101010101011000010000000000001111111010101010110000100000000000011111110101010101100001000000000000111111101010101011000010000000000001111111010101010110000100000000000011111110000100011100001000000000000000000011010101011000010000000000000000000110101010110000100000000000000000001101010101100001000000000000000000011010101011000010000000000000000000110101010110000100000000000000000001101010101100001000000000000000000011010101011000010000000000000000000110101010110000100000000000000000001101010101100001000000000000000000011010101011000010000000000000000000110101010110000100000000000000000001101010101100001000000000000000000011010101011000010000000000000000000110101010110000100000000000000000001101010101100001000000000000000000011010101011000010000000000000000000110101010110000100000000000000000001101010101100001000000000000000000011010101011000010000000000000000000110101010110000100000000000000000001101010101100001000000000000000000011010101011000010000000000000000000110101010110000100000000000000000001101010101100001000000000000000000011010101011000010000000000000000000110101010110000100000000000000000001101010101100001000000000000000000011010101011000010000000000000000000110101010110000100000000000000000001101010101100001000000000000000000011010101011000010000000000000000000110101010110000100000000000000000001101010101100001000000000000000000011010101011000010000000000000000000110101010110000100000000000000000001101010101100001000000000000000000010000100011000010000000000001111111110111101110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000010000100010101010110000100000000000000001000101010101100001000000000000000010001010101011000010000000000000000100010101010110000100000000000000001000101010101100001000000000000000010001010101011000010000000000000000100010101010110000100000000000000001000101010101100001000000000000000010001010101011000010000000000000000100010101010110000100000000000000001000101010101100001000000000000000010001010101011000010000000000000000100010101010110000100000000000000001000101010101100001000000000000000010001010101011000010000000000000000100010101010110000100000000000000001000101010101100001000000000000000010001010101011000010000000000000000100010101010110000100000000000000001000101010101100001000000000000000010001010101011000010000000000000000100010101010110000100000000000000001000101010101100001000000000000000010001010101011000010000000000000000100010101010110000100000000000000001000101010101100001000000000000000010001010101011000010000000000000000100010101010110000100000000000000001000101010101100001000000000000000010001010101011000010000000000000000100010101010110000100000000000000001000101010101100001000000000000000010001010101011000010000000000000000100010101010110000100000000000000001000101010101100001000000000000000010001010101011000010000000000000000100000000000110000100000000000010000001101010101100001000000000000100000011010101011000010000000000001000000110101010110000100000000000010000001101010101100001000000000000100000011010101011000010000000000001000000110101010110000100000000000010000001101010101100001000000000000100000011010101011000010000000000001000000110101010110000100000000000010000001101010101100001000000000000100000011010101011000010000000000001000000110101010110000100000000000010000001101010101100001000000000000100000011010101011000010000000000001000000110101010110000100000000000010000001101010101100001000000000000100000011010101011000010000000000001000000110101010110000100000000000010000001101010101100001000000000000100000011010101011000010000000000001000000110101010110000100000000000010000001101010101100001000000000000100000011010101011000010000000000001000000110101010110000100000000000010000001101010101100001000000000000100000011010101011000010000000000001000000110101010110000100000000000010000001101010101100001000000000000100000011010101011000010000000000001000000110101010110000100000000000010000001101010101100001000000000000100000011110010011000010000000000000100000110101010110000100000000000001000001101010101100001000000000000010000011010101011000010000000000000100000110101010110000100000000000001000001101010101100001000000000000010000011010101011000010000000000000100000110101010110000100000000000001000001101010101100001000000000000010000011010101011000010000000000000100000110101010110000100000000000001000001101010101100001000000000000010000011010101011000010000000000000100000110101010110000100000000000001000001101010101100001000000000000010000011010101011000010000000000000100000110101010110000100000000000001000001101010101100001000000000000010000011010101011000010000000000000100000110101010110000100000000000001000001101010101100001000000000000010000011010101011000010000000000000100000110101010110000100000000000001000001101010101100001000000000000010000011010101011000010000000000000100000110101010110000100000000000001000001101010101100001000000000000010000011010101011000010000000000000100000110101010110000100000000000001000001101010101100001000000000000010000011010101011000010000000000000100000110101010110000100000000000001000001100110001100001000000000000111111111010110011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001001110011010101011000010000000000000011100110101010110000100000000000000111001101010101100001000000000000001110011010101011000010000000000000011100110101010110000100000000000000111001101010101100001000000000000001110011010101011000010000000000000011100110101010110000100000000000000111001101010101100001000000000000001110011010101011000010000000000000011100110101010110000100000000000000111001101010101100001000000000000001110011010101011000010000000000000011100110101010110000100000000000000111001101010101100001000000000000001110011010101011000010000000000000011100110101010110000100000000000000111001101010101100001000000000000001110011010101011000010000000000000011100110101010110000100000000000000111001101010101100001000000000000001110011010101011000010000000000000011100110101010110000100000000000000111001101010101100001000000000000001110011010101011000010000000000000011100110101010110000100000000000000111001101010101100001000000000000001110011010101011000010000000000000011100110101010110000100000000000000111001101010101100001000000000000001110011010101011000010000000000000011100110101010110000100000000000000111001101010101100001000000000000001110011010101011000010000000000000011100110101010110000100000000000000111001101010101100001000000000000001110011010110011000010000000000001011100110101010110000100000000000010111001101010101100001000000000000101110011010101011000010000000000001011100110101010110000100000000000010111001101010101100001000000000000101110011010101011000010000000000001011100110101010110000100000000000010111001101010101100001000000000000101110011010101011000010000000000001011100110101010110000100000000000010111001101010101100001000000000000101110011010101011000010000000000001011100110101010110000100000000000010111001101010101100001000000000000101110011010101011000010000000000001011100110101010110000100000000000010111001101010101100001000000000000101110011010101011000010000000000001011100110101010110000100000000000010111001101010101100001000000000000101110011010101011000010000000000001011100110101010110000100000000000010111001101010101100001000000000000101110011010101011000010000000000001011100110101010110000100000000000010111001101010101100001000000000000101110011110111111000010000000000001111111100101100110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111010011101010101100001000000000000110100111010101011000010000000000001101001110101010110000100000000000011010011101010101100001000000000000110100111010101011000010000000000001101001110101010110000100000000000011010011101010101100001000000000000110100111010101011000010000000000001101001110101010110000100000000000011010011101010101100001000000000000110100111010101011000010000000000001101001110101010110000100000000000011010011101010101100001000000000000110100111010101011000010000000000001101001110101010110000100000000000011010011101010101100001000000000000110100111010101011000010000000000001101001110101010110000100000000000011010011101010101100001000000000000110100111010101011000010000000000001101001110101010110000100000000000011010011101010101100001000000000000110100111010101011000010000000000001101001110101010110000100000000000011010011101010101100001000000000000110100111010101011000010000000000001101001110101010110000100000000000011010011101010101100001000000000000110100111010101011000010000000000001101001110101010110000100000000000011010011101010101100001000000000000110100111010101011000010000000000001101001110101010110000100000000000011010011101010101100001000000000000110100111010101011000010000000000001101001110101010110000100000000000011010011000000011100001000000000000001100111010101011000010000000000000011001110101010110000100000000000000110011101010101100001000000000000001100111010101011000010000000000000011001110101010110000100000000000000110011101010101100001000000000000001100111010101011000010000000000000011001110101010110000100000000000000110011101010101100001000000000000001100111010101011000010000000000000011001110101010110000100000000000000110011101010101100001000000000000001100111010101011000010000000000000011001110101010110000100000000000000110011101010101100001000000000000001100111010101011000010000000000000011001110101010110000100000000000000110011101010101100001000000000000001100111010101011000010000000000000011001110101010110000100000000000000110011101010101100001000000000000001100111010101011000010000000000000011001110101010110000100000000000000110011101010101100001000000000000001100111010101011000010000000000000011001110101010110000100000000000000110011101010101100001000000000000001100111010101011000010000000000000011001110101010110000100000000000000110011101010101100001000000000000001100111010101011000010000000000000011001110010000110000100000000000010110011101010101100001000000000000101100111010101011000010000000000001011001110101010110000100000000000010110011101010101100001000000000000101100111010101011000010000000000001011001110101010110000100000000000010110011101010101100001000000000000101100111010101011000010000000000001011001110101010110000100000000000010110011101010101100001000000000000101100111010101011000010000000000001011001110101010110000100000000000010110011101010101100001000000000000101100111010101011000010000000000001011001110101010110000100000000000010110011101010101100001000000000000101100111010101011000010000000000001011001110101010110000100000000000010110011101010101100001000000000000101100111010101011000010000000000001011001110101010110000100000000000010110011101010101100001000000000000101100111010101011000010000000000001011001110101010110000100000000000010110011101010101100001000000000000101100111010101011000010000000000001011001101001000110000100000000000001110011101010101100001000000000000011100111010101011000010000000000000111001110101010110000100000000000001110011101010101100001000000000000011100111010101011000010000000000000111001110101010110000100000000000001110011101010101100001000000000000011100111010101011000010000000000000111001110101010110000100000000000001110011101010101100001000000000000011100111010101011000010000000000000111001110101010110000100000000000001110011101010101100001000000000000011100111010101011000010000000000000111001110101010110000100000000000001110011101010101100001000000000000011100111010101011000010000000000000111001110101010110000100000000000001110011101010101100001000000000000011100111010101011000010000000000000111001110101010110000100000000000001110011101010101100001000000000000011100111010101011000010000000000000111001110101010110000100000000000001110011101010101100001000000000000011100111010101011000010000000000000111001110101010110000100000000000001110011101010101100001000000000000011100111010101011000010000000000000111001110101010110000100000000000001110011101010101100001000000000000011100111010101011000010000000000000111001110101010110000100000000000001110011101010101100001000000000000011100111010101011000010000000000000111001110101010110000100000000000001110011000010101100001000000000000111100111010101011000010000000000001111001110101010110000100000000000011110011101010101100001000000000000111100111010101011000010000000000001111001110101010110000100000000000011110011101010101100001000000000000111100111010101011000010000000000001111001110101010110000100000000000011110011101010101100001000000000000111100111010101011000010000000000001111001110101010110000100000000000011110011101010101100001000000000000111100111010101011000010000000000001111001110101010110000100000000000011110011101010101100001000000000000111100111010101011000010000000000001111001110101010110000100000000000011110011101010101100001000000000000111100111010101011000010000000000001111001110101010110000100000000000011110011101010101100001000000000000111100111010101011000010000000000001111001110101010110000100000000000011110011101010101100001000000000000111100111010101011000010000000000001111001110101010110000100000000000011110011001011111100001000000000000000010111010101011000010000000000000000101110101010110000100000000000000001011101010101100001000000000000000010111010101011000010000000000000000101110101010110000100000000000000001011101010101100001000000000000000010111010101011000010000000000000000101110101010110000100000000000000001011101010101100001000000000000000010111010101011000010000000000000000101110101010110000100000000000000001011101010101100001000000000000000010111010101011000010000000000000000101110101010110000100000000000000001011101010101100001000000000000000010111010101011000010000000000000000101110101010110000100000000000000001011101010101100001000000000000000010111010101011000010000000000000000101110101010110000100000000000000001011101010101100001000000000000000010111010101011000010000000000000000101110101010110000100000000000000001011101010101100001000000000000000010111010101011000010000000000000000101110101010110000100000000000000001011101010101100001000000000000000010111010101011000010000000000000000101110101010110000100000000000000001011101010101100001000000000000000010111010101011000010000000000000000101110101010110000100000000000000001011101010101100001000000000000000010111010101011000010000000000000000101110101010110000100000000000000001011101010101100001000000000000000010111011101011000010000000000001000101110101010110000100000000000010001011101010101100001000000000000100010111010101011000010000000000001000101110101010110000100000000000010001011101010101100001000000000000100010111010101011000010000000000001000101110101010110000100000000000010001011101010101100001000000000000100010111010101011000010000000000001000101110101010110000100000000000010001011101010101100001000000000000100010111010101011000010000000000001000101110101010110000100000000000010001011101010101100001000000000000100010111010101011000010000000000001000101110101010110000100000000000010001011101010101100001000000000000100010111010101011000010000000000001000101110101010110000100000000000010001011101010101100001000000000000100010111010101011000010000000000001000101110101010110000100000000000010001011101010101100001000000000000100010111010101011000010000000000001000101110101010110000100000000000010001011101010101100001000000000000100010110000000111000010000000000000100101110101010110000100000000000001001011101010101100001000000000000010010111010101011000010000000000000100101110101010110000100000000000001001011101010101100001000000000000010010111010101011000010000000000000100101110101010110000100000000000001001011101010101100001000000000000010010111010101011000010000000000000100101110101010110000100000000000001001011101010101100001000000000000010010111010101011000010000000000000100101110101010110000100000000000001001011101010101100001000000000000010010111010101011000010000000000000100101110101010110000100000000000001001011101010101100001000000000000010010111010101011000010000000000000100101110101010110000100000000000001001011101010101100001000000000000010010111010101011000010000000000000100101110101010110000100000000000001001011101010101100001000000000000010010111010101011000010000000000000100101110101010110000100000000000001001011101010101100001000000000000010010111010101011000010000000000000100101110101010110000100000000000001001011101010101100001000000000000010010111010101011000010000000000000100101110101010110000100000000000001001011101010101100001000000000000010010111010101011000010000000000000100101110101010110000100000000000001001011101010101100001000000000000010010111010101011000010000000000000100101101110010110000100000000000011001011101010101100001000000000000110010111010101011000010000000000001100101110101010110000100000000000011001011101010101100001000000000000110010111010101011000010000000000001100101110101010110000100000000000011001011101010101100001000000000000110010111010101011000010000000000001100101110101010110000100000000000011001011101010101100001000000000000110010111010101011000010000000000001100101110101010110000100000000000011001011101010101100001000000000000110010111010101011000010000000000001100101110101010110000100000000000011001011101010101100001000000000000110010111010101011000010000000000001100101110101010110000100000000000011001011101010101100001000000000000110010111010101011000010000000000001100101110101010110000100000000000011001011101010101100001000000000000110010111010101011000010000000000001100101110101010110000100000000000011001011101010101100001000000000000110010111010101011000010000000000001100101100000000110000100000000000000101011101010101100001000000000000001010111010101011000010000000000000010101110101010110000100000000000000101011101010101100001000000000000001010111010101011000010000000000000010101110101010110000100000000000000101011101010101100001000000000000001010111010101011000010000000000000010101110101010110000100000000000000101011101010101100001000000000000001010111010101011000010000000000000010101110101010110000100000000000000101011101010101100001000000000000001010111010101011000010000000000000010101110101010110000100000000000000101011101010101100001000000000000001010111010101011000010000000000000010101110101010110000100000000000000101011101010101100001000000000000001010111010101011000010000000000000010101110101010110000100000000000000101011101010101100001000000000000001010111010101011000010000000000000010101110101010110000100000000000000101011101010101100001000000000000001010111010101011000010000000000000010101110101010110000100000000000000101011101010101100001000000000000001010111010101011000010000000000000010101110101010110000100000000000000101011101010101100001000000000000001010111010101011000010000000000000010101110101010110000100000000000000101011101010101100001000000000000001010111010101011000010000000000000010101110101010110000100000000000000101011010000011100001000000000000101010111010101011000010000000000001010101110101010110000100000000000010101011101010101100001000000000000101010111010101011000010000000000001010101110101010110000100000000000010101011101010101100001000000000000101010111010101011000010000000000001010101110101010110000100000000000010101011101010101100001000000000000101010111010101011000010000000000001010101110101010110000100000000000010101011101010101100001000000000000101010111010101011000010000000000001010101110101010110000100000000000010101011101010101100001000000000000101010111010101011000010000000000001010101110101010110000100000000000010101011101010101100001000000000000101010111010101011000010000000000001010101110101010110000100000000000010101011101010101100001000000000000101010111010101011000010000000000001010101110101010110000100000000000010101011101010101100001000000000000101010111010101011000010000000000001010101110101010110000100000000000010101011100111101100001000000000000011010111010101011000010000000000000110101110101010110000100000000000001101011101010101100001000000000000011010111010101011000010000000000000110101110101010110000100000000000001101011101010101100001000000000000011010111010101011000010000000000000110101110101010110000100000000000001101011101010101100001000000000000011010111010101011000010000000000000110101110101010110000100000000000001101011101010101100001000000000000011010111010101011000010000000000000110101110101010110000100000000000001101011101010101100001000000000000011010111010101011000010000000000000110101110101010110000100000000000001101011101010101100001000000000000011010111010101011000010000000000000110101110101010110000100000000000001101011101010101100001000000000000011010111010101011000010000000000000110101110101010110000100000000000001101011101010101100001000000000000011010111010101011000010000000000000110101110101010110000100000000000001101011101010101100001000000000000011010111010101011000010000000000000110101110101010110000100000000000001101011101010101100001000000000000011010111010101011000010000000000000110101110101010110000100000000000001101011101010101100001000000000000011010111010101011000010000000000000110101110101010110000100000000000001101011101010101100001000000000000011010110000101011000010000000000001001111010101010110000100000000000010011110101010101100001000000000000100111101010101011000010000000000001001111010101010110000100000000000010011110101010101100001000000000000100111101010101011000010000000000001001111010101010110000100000000000010011110101010101100001000000000000100111101010101011000010000000000001001111010101010110000100000000000010011110101010101100001000000000000100111101010101011000010000000000001001111010101010110000100000000000010011110101010101100001000000000000100111101010101011000010000000000001001111010101010110000100000000000010011110101010101100001000000000000100111101010101011000010000000000001001111010101010110000100000000000010011110101010101100001000000000000100111101010101011000010000000000001001111010101010110000100000000000010011110101010101100001000000000000100111101010101011000010000000000001001111010101010110000100000000000010011110101010101100001000000000000100111101010101011000010000000000001001111010101010110000100000000000010011110101010101100001000000000000100111101010101011000010000000000001001111010101010110000100000000000010011110101011001100001000000000000010111101010101011000010000000000000101111010101010110000100000000000001011110101010101100001000000000000010111101010101011000010000000000000101111010101010110000100000000000001011110101010101100001000000000000010111101010101011000010000000000000101111010101010110000100000000000001011110101010101100001000000000000010111101010101011000010000000000000101111010101010110000100000000000001011110101010101100001000000000000010111101010101011000010000000000000101111010101010110000100000000000001011110101010101100001000000000000010111101010101011000010000000000000101111010101010110000100000000000001011110101010101100001000000000000010111101010101011000010000000000000101111010101010110000100000000000001011110101010101100001000000000000010111101010101011000010000000000000101111010101010110000100000000000001011110101010101100001000000000000010111101010101011000010000000000000101111010101010110000100000000000001011110101010101100001000000000000010111101010101011000010000000000000101111010101010110000100000000000001011110101010101100001000000000000010111101010101011000010000000000000101111001001000110000100000000000011111111001000001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000010110101110101010110000100000000000001101011101010101100001000000000000011010111010101011000010000000000000110101110101010110000100000000000001101011101010101100001000000000000011010111010101011000010000000000000110101110101010110000100000000000001101011101010101100001000000000000011010111010101011000010000000000000110101110101010110000100000000000001101011101010101100001000000000000011010111010101011000010000000000000110101110101010110000100000000000001101011101010101100001000000000000011010111010101011000010000000000000110101110101010110000100000000000001101011101010101100001000000000000011010111010101011000010000000000000110101110101010110000100000000000001101011101010101100001000000000000011010111010101011000010000000000000110101110101010110000100000000000001101011101010101100001000000000000011010111010101011000010000000000000110101110101010110000100000000000001101011101010101100001000000000000011010111010101011000010000000000000110101110101010110000100000000000001101011101010101100001000000000000011010111010101011000010000000000000110101110101010110000100000000000001101011101010101100001000000000000011010111010101011000010000000000000110101110101010110000100000000000001101011101010101100001000000000000011010111010101011000010000000000000110101100001010110000100000000000011101011101010101100001000000000000111010111010101011000010000000000001110101110101010110000100000000000011101011101010101100001000000000000111010111010101011000010000000000001110101110101010110000100000000000011101011101010101100001000000000000111010111010101011000010000000000001110101110101010110000100000000000011101011101010101100001000000000000111010111010101011000010000000000001110101110101010110000100000000000011101011101010101100001000000000000111010111010101011000010000000000001110101110101010110000100000000000011101011101010101100001000000000000111010111010101011000010000000000001110101110101010110000100000000000011101011101010101100001000000000000111010111010101011000010000000000001110101110101010110000100000000000011101011101010101100001000000000000111010111010101011000010000000000001110101110101010110000100000000000011101011101010101100001000000000000111010111010101011000010000000000001110101100001010110000100000000000000011011101010101100001000000000000000110111010101011000010000000000000001101110101010110000100000000000000011011101010101100001000000000000000110111010101011000010000000000000001101110101010110000100000000000000011011101010101100001000000000000000110111010101011000010000000000000001101110101010110000100000000000000011011101010101100001000000000000000110111010101011000010000000000000001101110101010110000100000000000000011011101010101100001000000000000000110111010101011000010000000000000001101110101010110000100000000000000011011101010101100001000000000000000110111010101011000010000000000000001101110101010110000100000000000000011011101010101100001000000000000000110111010101011000010000000000000001101110101010110000100000000000000011011101010101100001000000000000000110111010101011000010000000000000001101110101010110000100000000000000011011101010101100001000000000000000110111010101011000010000000000000001101110101010110000100000000000000011011101010101100001000000000000000110111010101011000010000000000000001101110101010110000100000000000000011011101010101100001000000000000000110111010101011000010000000000000001101110101010110000100000000000000011011101010101100001000000000000000110111010101011000010000000000000001101110101010110000100000000000000011011001011111100001000000000000100110111010101011000010000000000001001101110101010110000100000000000010011011101010101100001000000000000100110111010101011000010000000000001001101110101010110000100000000000010011011101010101100001000000000000100110111010101011000010000000000001001101110101010110000100000000000010011011101010101100001000000000000100110111010101011000010000000000001001101110101010110000100000000000010011011101010101100001000000000000100110111010101011000010000000000001001101110101010110000100000000000010011011101010101100001000000000000100110111010101011000010000000000001001101110101010110000100000000000010011011101010101100001000000000000100110111010101011000010000000000001001101110101010110000100000000000010011011101010101100001000000000000100110111010101011000010000000000001001101110101010110000100000000000010011011101010101100001000000000000100110111010101011000010000000000001001101110101010110000100000000000010011011001111101100001000000000000110111101010101011000010000000000001101111010101010110000100000000000011011110101010101100001000000000000110111101010101011000010000000000001101111010101010110000100000000000011011110101010101100001000000000000110111101010101011000010000000000001101111010101010110000100000000000011011110101010101100001000000000000110111101010101011000010000000000001101111010101010110000100000000000011011110101010101100001000000000000110111101010101011000010000000000001101111010101010110000100000000000011011110101010101100001000000000000110111101010101011000010000000000001101111010101010110000100000000000011011110101010101100001000000000000110111101010101011000010000000000001101111010101010110000100000000000011011110101010101100001000000000000110111101010101011000010000000000001101111010101010110000100000000000011011110101010101100001000000000000110111101010101011000010000000000001101111010101010110000100000000000011011110101010101100001000000000000110111101010101011000010000000000001101111010101010110000100000000000011011110101010101100001000000000000110111101010101011000010000000000001101111010101010110000100000000000011011110101010101100001000000000000110111101010101011000010000000000001101111010101010110000100000000000011011110101010101100001000000000000110111101110010111000010000000000000011111010101010110000100000000000000111110101010101100001000000000000001111101010101011000010000000000000011111010101010110000100000000000000111110101010101100001000000000000001111101010101011000010000000000000011111010101010110000100000000000000111110101010101100001000000000000001111101010101011000010000000000000011111010101010110000100000000000000111110101010101100001000000000000001111101010101011000010000000000000011111010101010110000100000000000000111110101010101100001000000000000001111101010101011000010000000000000011111010101010110000100000000000000111110101010101100001000000000000001111101010101011000010000000000000011111010101010110000100000000000000111110101010101100001000000000000001111101010101011000010000000000000011111010101010110000100000000000000111110101010101100001000000000000001111101010101011000010000000000000011111010101010110000100000000000000111110101010101100001000000000000001111101010101011000010000000000000011111010101010110000100000000000000111110101010101100001000000000000001111101010101011000010000000000000011111010101010110000100000000000000111110010000001100001000000000000101111101010101011000010000000000001011111010101010110000100000000000010111110101010101100001000000000000101111101010101011000010000000000001011111010101010110000100000000000010111110101010101100001000000000000101111101010101011000010000000000001011111010101010110000100000000000010111110101010101100001000000000000101111101010101011000010000000000001011111010101010110000100000000000010111110101010101100001000000000000101111101010101011000010000000000001011111010101010110000100000000000010111110101010101100001000000000000101111101010101011000010000000000001011111010101010110000100000000000010111110101010101100001000000000000101111101010101011000010000000000001011111010101010110000100000000000010111110101010101100001000000000000101111101010101011000010000000000001011111010101010110000100000000000010111110101010101100001000000000000101111101010101011000010000000000001011111010101010110000100000000000010111110001001001100001000000000000111111111000001111000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000101101111101010101100000000001010000011011111010101011000000000010100000110111110101010110000000000101000001101111101010101100000000001010000011011111010101011000000000010100000110111110101010110000000000101000001101111101010101100000000001010000011011111010101011000000000010100000110111110101010110000000000101000001101111101010101100000000001010000011011111010101011000000000010100000110111110101010110000000000101000001101111101010101100000000001010000011011111010101011000000000010100000110111110101010110000000000101000001101111101010101100000000001010000011011111010101011000000000010100000110111110101010110000000000101000001101111101010101100000000001010000011011111010101011000000000010100000110111110101010110000000000101000001101111101010101100000000001010000011011111010101011000000000010100000110111110101010110000000000101000001101111101010101100000000001010000011011111010101011000000000010100000110111110101010110000000000101000001101111101010101100000000001010000011011111010101011000000000010100000110111110101010110000000000101000001101111101010101100000000001010000011011111010101011000000000010100000110111110101010110000000000101000001101111101010101100000000001010000011011110010000011000000000010100001011111010101010110000100000000000010111110101010101100001000000000000101111101010101011000010000000000001011111010101010110000100000000000010111110101010101100001000000000000101111101010101011000010000000000001011111010101010110000100000000000010111110101010101100001000000000000101111101010101011000010000000000001011111010101010110000100000000000010111110101010101100001000000000000101111101010101011000010000000000001011111010101010110000100000000000010111110101010101100001000000000000101111101010101011000010000000000001011111010101010110000100000000000010111110101010101100001000000000000101111101010101011000010000000000001011111010101010110000100000000000010111110101010101100001000000000000101111101010101011000010000000000001011111010101010110000100000000000010111110101010101100001000000000000101111101010101011000010000000000001011111010101010110000100000000000010111110101010101100001000000000000101111101010101011000010000000000001011111010101010110000100000000000010111110101010101100001000000000000101111101010101011000010000000000001011111010101010110000100000000000010111110101010101100001000000000000101111101010101011000010000000000001011111000100100110000100000000000001111110101010101100001000000000000011111101010101011000010000000000000111111010101010110000100000000000001111110101010101100001000000000000011111101010101011000010000000000000111111010101010110000100000000000001111110101010101100001000000000000011111101010101011000010000000000000111111010101010110000100000000000001111110101010101100001000000000000011111101010101011000010000000000000111111010101010110000100000000000001111110101010101100001000000000000011111101010101011000010000000000000111111010101010110000100000000000001111110101010101100001000000000000011111101010101011000010000000000000111111010101010110000100000000000001111110101010101100001000000000000011111101010101011000010000000000000111111010101010110000100000000000001111110101010101100001000000000000011111101010101011000010000000000000111111010101010110000100000000000001111110101010101100001000000000000011111101010101011000010000000000000111111010101010110000100000000000001111110101010101100001000000000000011111101010101011000010000000000000111111010101010110000100000000000001111110101010101100001000000000000011111100010000011000010000000000001111111110111111110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011100000110101010110000100000000000011000001101010101100001000000000000110000011010101011000010000000000001100000110101010110000100000000000011000001101010101100001000000000000110000011010101011000010000000000001100000110101010110000100000000000011000001101010101100001000000000000110000011010101011000010000000000001100000110101010110000100000000000011000001101010101100001000000000000110000011010101011000010000000000001100000110101010110000100000000000011000001101010101100001000000000000110000011010101011000010000000000001100000110101010110000100000000000011000001101010101100001000000000000110000011010101011000010000000000001100000110101010110000100000000000011000001101010101100001000000000000110000011010101011000010000000000001100000110101010110000100000000000011000001101010101100001000000000000110000011010101011000010000000000001100000110101010110000100000000000011000001101010101100001000000000000110000011010101011000010000000000001100000110101010110000100000000000011000001101010101100001000000000000110000011010101011000010000000000001100000110101010110000100000000000011000001101010101100001000000000000110000011010101011000010000000000001100000110101010110000100000000000011000001101010101100001000000000000110000011010101011000010000000000001100000101110101110000100000000000000100001101010101100001000000000000001000011010101011000010000000000000010000110101010110000100000000000000100001101010101100001000000000000001000011010101011000010000000000000010000110101010110000100000000000000100001101010101100001000000000000001000011010101011000010000000000000010000110101010110000100000000000000100001101010101100001000000000000001000011010101011000010000000000000010000110101010110000100000000000000100001101010101100001000000000000001000011010101011000010000000000000010000110101010110000100000000000000100001101010101100001000000000000001000011010101011000010000000000000010000110101010110000100000000000000100001101010101100001000000000000001000011010101011000010000000000000010000110101010110000100000000000000100001101010101100001000000000000001000011010101011000010000000000000010000110101010110000100000000000000100001101010101100001000000000000001000011010101011000010000000000000010000110101010110000100000000000000100001101010101100001000000000000001000011010101011000010000000000000010000110101010110000100000000000000100001101010101100001000000000000001000010110010011000010000000000001010000110101010110000100000000000010100001101010101100001000000000000101000011010101011000010000000000001010000110101010110000100000000000010100001101010101100001000000000000101000011010101011000010000000000001010000110101010110000100000000000010100001101010101100001000000000000101000011010101011000010000000000001010000110101010110000100000000000010100001101010101100001000000000000101000011010101011000010000000000001010000110101010110000100000000000010100001101010101100001000000000000101000011010101011000010000000000001010000110101010110000100000000000010100001101010101100001000000000000101000011010101011000010000000000001010000110101010110000100000000000010100001101010101100001000000000000101000011010101011000010000000000001010000110101010110000100000000000010100001101010101100001000000000000101000011010101011000010000000000001010000110101010110000100000000000010100001101010101100001000000000000101000010111010111000010000000000001111111110011100110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001011000011010101011000010000000000000110000110101010110000100000000000001100001101010101100001000000000000011000011010101011000010000000000000110000110101010110000100000000000001100001101010101100001000000000000011000011010101011000010000000000000110000110101010110000100000000000001100001101010101100001000000000000011000011010101011000010000000000000110000110101010110000100000000000001100001101010101100001000000000000011000011010101011000010000000000000110000110101010110000100000000000001100001101010101100001000000000000011000011010101011000010000000000000110000110101010110000100000000000001100001101010101100001000000000000011000011010101011000010000000000000110000110101010110000100000000000001100001101010101100001000000000000011000011010101011000010000000000000110000110101010110000100000000000001100001101010101100001000000000000011000011010101011000010000000000000110000110101010110000100000000000001100001101010101100001000000000000011000011010101011000010000000000000110000110101010110000100000000000001100001101010101100001000000000000011000011010101011000010000000000000110000110101010110000100000000000001100001101010101100001000000000000011000011010101011000010000000000000110000110101010110000100000000000001100001101010101100001000000000000011000010000101011000010000000000001110000110101010110000100000000000011100001101010101100001000000000000111000011010101011000010000000000001110000110101010110000100000000000011100001101010101100001000000000000111000011010101011000010000000000001110000110101010110000100000000000011100001101010101100001000000000000111000011010101011000010000000000001110000110101010110000100000000000011100001101010101100001000000000000111000011010101011000010000000000001110000110101010110000100000000000011100001101010101100001000000000000111000011010101011000010000000000001110000110101010110000100000000000011100001101010101100001000000000000111000011010101011000010000000000001110000110101010110000100000000000011100001101010101100001000000000000111000011010101011000010000000000001110000110101010110000100000000000011100001101010101100001000000000000111000011010101011000010000000000001110000110101010110000100000000000011100001101010101100001000000000000111000010010111111000010000000000001010000110101010110000100000000000010100001101010101100001000000000000101000011010101011000010000000000001010000110101010110000100000000000010100001101010101100001000000000000101000011010101011000010000000000001010000110101010110000100000000000010100001101010101100001000000000000101000011010101011000010000000000001010000110101010110000100000000000010100001101010101100001000000000000101000011010101011000010000000000001010000110101010110000100000000000010100001101010101100001000000000000101000011010101011000010000000000001010000110101010110000100000000000010100001101010101100001000000000000101000011010101011000010000000000001010000110101010110000100000000000010100001101010101100001000000000000101000011010101011000010000000000001010000110101010110000100000000000010100001101010101100001000000000000101000011010101011000010000000000001010000110101010110000100000000000010100001101010101100001000000000000101000011010101011000010000000000001010000110101010110000100000000000010100001101010101100001000000000000101000011010101011000010000000000001010000110101010110000100000000000010100001101010101100001000000000000101000011010101011000010000000000001010000110101010110000100000000000010100001101010101100001000000000000101000011010101011000010000000000001010000101110101110000100000000000001100001101010101100001000000000000011000011010101011000010000000000000110000110101010110000100000000000001100001101010101100001000000000000011000011010101011000010000000000000110000110101010110000100000000000001100001101010101100001000000000000011000011010101011000010000000000000110000110101010110000100000000000001100001101010101100001000000000000011000011010101011000010000000000000110000110101010110000100000000000001100001101010101100001000000000000011000011010101011000010000000000000110000110101010110000100000000000001100001101010101100001000000000000011000011010101011000010000000000000110000110101010110000100000000000001100001101010101100001000000000000011000011010101011000010000000000000110000110101010110000100000000000001100001101010101100001000000000000011000011010101011000010000000000000110000110101010110000100000000000001100001101010101100001000000000000011000011010101011000010000000000000110000110101010110000100000000000001100001101010101100001000000000000011000011010101011000010000000000000110000110101010110000100000000000001100001101010101100001000000000000011000010010000011000010000000000001110000110101010110000100000000000011100001101010101100001000000000000111000011010101011000010000000000001110000110101010110000100000000000011100001101010101100001000000000000111000011010101011000010000000000001110000110101010110000100000000000011100001101010101100001000000000000111000011010101011000010000000000001110000110101010110000100000000000011100001101010101100001000000000000111000011010101011000010000000000001110000110101010110000100000000000011100001101010101100001000000000000111000011010101011000010000000000001110000110101010110000100000000000011100001101010101100001000000000000111000011010101011000010000000000001110000110101010110000100000000000011100001101010101100001000000000000111000011010101011000010000000000001110000110101010110000100000000000011100001101010101100001000000000000111000011010101011000010000000000001110000110101010110000100000000000011100001101010101100001000000000000111000010010110011000010000000000001111111111110110110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001000111111010101011000010000000000000001111110101010110000100000000000000011111101010101100001000000000000000111111010101011000010000000000000001111110101010110000100000000000000011111101010101100001000000000000000111111010101011000010000000000000001111110101010110000100000000000000011111101010101100001000000000000000111111010101011000010000000000000001111110101010110000100000000000000011111101010101100001000000000000000111111010101011000010000000000000001111110101010110000100000000000000011111101010101100001000000000000000111111010101011000010000000000000001111110101010110000100000000000000011111101010101100001000000000000000111111010101011000010000000000000001111110101010110000100000000000000011111101010101100001000000000000000111111010101011000010000000000000001111110101010110000100000000000000011111101010101100001000000000000000111111010101011000010000000000000001111110101010110000100000000000000011111101010101100001000000000000000111111010101011000010000000000000001111110101010110000100000000000000011111101010101100001000000000000000111111010101011000010000000000000001111110101010110000100000000000000011111101010101100001000000000000000111111010101011000010000000000000001111110101010110000100000000000000011111101010101100001000000000000000111111111011111000010000000000001001111110101010110000100000000000010011111101010101100001000000000000100111111010101011000010000000000001001111110101010110000100000000000010011111101010101100001000000000000100111111010101011000010000000000001001111110101010110000100000000000010011111101010101100001000000000000100111111010101011000010000000000001001111110101010110000100000000000010011111101010101100001000000000000100111111010101011000010000000000001001111110101010110000100000000000010011111101010101100001000000000000100111111010101011000010000000000001001111110101010110000100000000000010011111101010101100001000000000000100111111010101011000010000000000001001111110101010110000100000000000010011111101010101100001000000000000100111111010101011000010000000000001001111110101010110000100000000000010011111101010101100001000000000000100111111010101011000010000000000001001111110101010110000100000000000010011111101010101100001000000000000100111110000101011000010000000000001110000110101010110000100000000000011100001101010101100001000000000000111000011010101011000010000000000001110000110101010110000100000000000011100001101010101100001000000000000111000011010101011000010000000000001110000110101010110000100000000000011100001101010101100001000000000000111000011010101011000010000000000001110000110101010110000100000000000011100001101010101100001000000000000111000011010101011000010000000000001110000110101010110000100000000000011100001101010101100001000000000000111000011010101011000010000000000001110000110101010110000100000000000011100001101010101100001000000000000111000011010101011000010000000000001110000110101010110000100000000000011100001101010101100001000000000000111000011010101011000010000000000001110000110101010110000100000000000011100001101010101100001000000000000111000011010101011000010000000000001110000110101010110000100000000000011100001101010101100001000000000000111000011010101011000010000000000001110000110101010110000100000000000011100001101010101100001000000000000111000011010101011000010000000000001110000110101010110000100000000000011100001101010101100001000000000000111000011010101011000010000000000001110000110101010110000100000000000011100001101010101100001000000000000111000011010101011000010000000000001110000100101100110000100000000000000010001101010101100001000000000000000100011010101011000010000000000000001000110101010110000100000000000000010001101010101100001000000000000000100011010101011000010000000000000001000110101010110000100000000000000010001101010101100001000000000000000100011010101011000010000000000000001000110101010110000100000000000000010001101010101100001000000000000000100011010101011000010000000000000001000110101010110000100000000000000010001101010101100001000000000000000100011010101011000010000000000000001000110101010110000100000000000000010001101010101100001000000000000000100011010101011000010000000000000001000110101010110000100000000000000010001101010101100001000000000000000100011010101011000010000000000000001000110101010110000100000000000000010001101010101100001000000000000000100011010101011000010000000000000001000110101010110000100000000000000010001101010101100001000000000000000100011010101011000010000000000000001000110101010110000100000000000000010001101010101100001000000000000000100011010101011000010000000000000001000110101010110000100000000000000010001101010101100001000000000000000100010000111011000010000000000001111111100110010110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001100110111010101011000010000000000001001101110101010110000100000000000010011011101010101100001000000000000100110111010101011000010000000000001001101110101010110000100000000000010011011101010101100001000000000000100110111010101011000010000000000001001101110101010110000100000000000010011011101010101100001000000000000100110111010101011000010000000000001001101110101010110000100000000000010011011101010101100001000000000000100110111010101011000010000000000001001101110101010110000100000000000010011011101010101100001000000000000100110111010101011000010000000000001001101110101010110000100000000000010011011101010101100001000000000000100110111010101011000010000000000001001101110101010110000100000000000010011011101010101100001000000000000100110111010101011000010000000000001001101110101010110000100000000000010011011101010101100001000000000000100110111010101011000010000000000001001101110101010110000100000000000010011011101010101100001000000000000100110111010101011000010000000000001001101110101010110000100000000000010011011101010101100001000000000000100110111010101011000010000000000001001101110101010110000100000000000010011011101010101100001000000000000100110111010101011000010000000000001001101110101010110000100000000000010011011101010101100001000000000000100110110011111011000010000000000000001101110101010110000000000000000000011011101010101100000000000000000000110111010101011000000000000000000001101110101010110000000000000000000011011101010101100000000000000000000110111010101011000000000000000000001101110101010110000000000000000000011011101010101100000000000000000000110111010101011000000000000000000001101110101010110000000000000000000011011101010101100000000000000000000110111010101011000000000000000000001101110101010110000000000000000000011011101010101100000000000000000000110111010101011000000000000000000001101110101010110000000000000000000011011101010101100000000000000000000110111010101011000000000000000000001101110101010110000000000000000000011011101010101100000000000000000000110111010101011000000000000000000001101110101010110000000000000000000011011101010101100000000000000000000110111010101011000000000000000000001101110101010110000000000000000000011011101010101100000000000000000000110111010101011000000000000000000001101110101010110000000000000000000011011101010101100000000000000000000110111001100011000000000000000001110101110101010110000000111001000011101011101010101100000001110010000111010111010101011000000011100100001110101110101010110000000111001000011101011101010101100000001110010000111010111010101011000000011100100001110101110101010110000000111001000011101011101010101100000001110010000111010111010101011000000011100100001110101110101010110000000111001000011101011101010101100000001110010000111010111010101011000000011100100001110101110101010110000000111001000011101011101010101100000001110010000111010111010101011000000011100100001110101110101010110000000111001000011101011101010101100000001110010000111010111010101011000000011100100001110101110101010110000000111001000011101011101010101100000001110010000111010111010101011000000011100100001110101110101010110000000111001000011101011101010101100000001110010000111010111010101011000000011100100001110101110101010110000000111001000011101011101010101100000001110010000111010111010101011000000011100100001110101110101010110000000111001000011101011101010101100000001110010000111010111010101011000000011100100001110101110101010110000000111001000011101011000000001100000001110010000011010111010101011000000000000010000110101110101010110000000000000100001101011101010101100000000000001000011010111010101011000000000000010000110101110101010110000000000000100001101011101010101100000000000001000011010111010101011000000000000010000110101110101010110000000000000100001101011101010101100000000000001000011010111010101011000000000000010000110101110101010110000000000000100001101011101010101100000000000001000011010111010101011000000000000010000110101110101010110000000000000100001101011101010101100000000000001000011010111010101011000000000000010000110101110101010110000000000000100001101011101010101100000000000001000011010111010101011000000000000010000110101110101010110000000000000100001101011101010101100000000000001000011010111010101011000000000000010000110101110101010110000000000000100001101011101010101100000000000001000011010111010101011000000000000010000110101110101010110000000000000100001101011101010101100000000000001000011010111010101011000000000000010000110101110101010110000000000000100001101011101010101100000000000001000011010111010101011000000000000010000110101101110010110000000000000100010101011101010101100000010111010000101010111010101011000000101110100001010101110101010110000001011101000010101011101010101100000010111010000101010111010101011000000101110100001010101110101010110000001011101000010101011101010101100000010111010000101010111010101011000000101110100001010101110101010110000001011101000010101011101010101100000010111010000101010111010101011000000101110100001010101110101010110000001011101000010101011101010101100000010111010000101010111010101011000000101110100001010101110101010110000001011101000010101011101010101100000010111010000101010111010101011000000101110100001010101110101010110000001011101000010101011101010101100000010111010000101010111010101011000000101110100001010101110101010110000001011101000010101011101010101100000010111010000101010111010101011000000101110100001010101110101010110000001011101000010101011101010101100000010111010000101010111010101011000000101110100001010101110101010110000001011101000010101011101010101100000010111010000101010111010101011000000101110100001010101110101010110000001011101000010101011101010101100000010111010000101010110000000111000000101110100000010101110101010110000000000101000000101011101010101100000000001010000001010111010101011000000000010100000010101110101010110000000000101000000101011101010101100000000001010000001010111010101011000000000010100000010101110101010110000000000101000000101011101010101100000000001010000001010111010101011000000000010100000010101110101010110000000000101000000101011101010101100000000001010000001010111010101011000000000010100000010101110101010110000000000101000000101011101010101100000000001010000001010111010101011000000000010100000010101110101010110000000000101000000101011101010101100000000001010000001010111010101011000000000010100000010101110101010110000000000101000000101011101010101100000000001010000001010111010101011000000000010100000010101110101010110000000000101000000101011101010101100000000001010000001010111010101011000000000010100000010101110101010110000000000101000000101011101010101100000000001010000001010111010101011000000000010100000010101110101010110000000000101000000101011101010101100000000001010000001010111010101011000000000010100000010101110101010110000000000101000000101011101110101100000000001010000110010111010101011000000111101110001100101110101010110000001111011100011001011101010101100000011110111000110010111010101011000000111101110001100101110101010110000001111011100011001011101010101100000011110111000110010111010101011000000111101110001100101110101010110000001111011100011001011101010101100000011110111000110010111010101011000000111101110001100101110101010110000001111011100011001011101010101100000011110111000110010111010101011000000111101110001100101110101010110000001111011100011001011101010101100000011110111000110010111010101011000000111101110001100101110101010110000001111011100011001011101010101100000011110111000110010111010101011000000111101110001100101110101010110000001111011100011001011101010101100000011110111000110010111010101011000000111101110001100101110101010110000001111011100011001011101010101100000011110111000110010111010101011000000111101110001100101110101010110000001111011100011001011101010101100000011110111000110010111010101011000000111101110001100101110101010110000001111011100011001011101010101100000011110111000110010111010101011000000111101110001100101100001010110000001111011100010010001101010101100001000000000000100100011010101011000010000000000001001000110101010110000100000000000010010001101010101100001000000000000100100011010101011000010000000000001001000110101010110000100000000000010010001101010101100001000000000000100100011010101011000010000000000001001000110101010110000100000000000010010001101010101100001000000000000100100011010101011000010000000000001001000110101010110000100000000000010010001101010101100001000000000000100100011010101011000010000000000001001000110101010110000100000000000010010001101010101100001000000000000100100011010101011000010000000000001001000110101010110000100000000000010010001101010101100001000000000000100100011010101011000010000000000001001000110101010110000100000000000010010001101010101100001000000000000100100011010101011000010000000000001001000110101010110000100000000000010010001101010101100001000000000000100100011010101011000010000000000001001000110101010110000100000000000010010001101010101100001000000000000100100011010101011000010000000000001001000110101010110000100000000000010010001101010101100001000000000000100100011010101011000010000000000001001000110101010110000100000000000010010001010011001100001000000000000010100011010101011000010000000000000101000110101010110000100000000000001010001101010101100001000000000000010100011010101011000010000000000000101000110101010110000100000000000001010001101010101100001000000000000010100011010101011000010000000000000101000110101010110000100000000000001010001101010101100001000000000000010100011010101011000010000000000000101000110101010110000100000000000001010001101010101100001000000000000010100011010101011000010000000000000101000110101010110000100000000000001010001101010101100001000000000000010100011010101011000010000000000000101000110101010110000100000000000001010001101010101100001000000000000010100011010101011000010000000000000101000110101010110000100000000000001010001101010101100001000000000000010100011010101011000010000000000000101000110101010110000100000000000001010001101010101100001000000000000010100011010101011000010000000000000101000110101010110000100000000000001010001101010101100001000000000000010100011010101011000010000000000000101000110101010110000100000000000001010001101010101100001000000000000010100011010101011000010000000000000101000100111110110000100000000000011010001101010101100001000000000000110100011010101011000010000000000001101000110101010110000100000000000011010001101010101100001000000000000110100011010101011000010000000000001101000110101010110000100000000000011010001101010101100001000000000000110100011010101011000010000000000001101000110101010110000100000000000011010001101010101100001000000000000110100011010101011000010000000000001101000110101010110000100000000000011010001101010101100001000000000000110100011010101011000010000000000001101000110101010110000100000000000011010001101010101100001000000000000110100011010101011000010000000000001101000110101010110000100000000000011010001101010101100001000000000000110100011010101011000010000000000001101000110101010110000100000000000011010001101010101100001000000000000110100011010101011000010000000000001101000110101010110000100000000000011010001101010101100001000000000000110100011010101011000010000000000001101000111110010110000100000000000011111111011010011100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001110100011010101011000010000000000001101000110101010110000100000000000011010001101010101100001000000000000110100011010101011000010000000000001101000110101010110000100000000000011010001101010101100001000000000000110100011010101011000010000000000001101000110101010110000100000000000011010001101010101100001000000000000110100011010101011000010000000000001101000110101010110000100000000000011010001101010101100001000000000000110100011010101011000010000000000001101000110101010110000100000000000011010001101010101100001000000000000110100011010101011000010000000000001101000110101010110000100000000000011010001101010101100001000000000000110100011010101011000010000000000001101000110101010110000100000000000011010001101010101100001000000000000110100011010101011000010000000000001101000110101010110000100000000000011010001101010101100001000000000000110100011010101011000010000000000001101000110101010110000100000000000011010001101010101100001000000000000110100011010101011000010000000000001101000110101010110000100000000000011010001101010101100001000000000000110100011010101011000010000000000001101000111110010110000100000000000000110001101010101100001000000000000001100011010101011000010000000000000011000110101010110000100000000000000110001101010101100001000000000000001100011010101011000010000000000000011000110101010110000100000000000000110001101010101100001000000000000001100011010101011000010000000000000011000110101010110000100000000000000110001101010101100001000000000000001100011010101011000010000000000000011000110101010110000100000000000000110001101010101100001000000000000001100011010101011000010000000000000011000110101010110000100000000000000110001101010101100001000000000000001100011010101011000010000000000000011000110101010110000100000000000000110001101010101100001000000000000001100011010101011000010000000000000011000110101010110000100000000000000110001101010101100001000000000000001100011010101011000010000000000000011000110101010110000100000000000000110001101010101100001000000000000001100011010101011000010000000000000011000110101010110000100000000000000110001101010101100001000000000000001100011010101011000010000000000000011000110101010110000100000000000000110001101010101100001000000000000001100011010101011000010000000000000011000110101010110000100000000000000110001101010101100001000000000000001100011010101011000010000000000000011000110101010110000100000000000000110001111110101100001000000000000001100011010101011000010000000000000011000110101010110000100000000000000110001101010101100001000000000000001100011010101011000010000000000000011000110101010110000100000000000000110001101010101100001000000000000001100011010101011000010000000000000011000110101010110000100000000000000110001101010101100001000000000000001100011010101011000010000000000000011000110101010110000100000000000000110001101010101100001000000000000001100011010101011000010000000000000011000110101010110000100000000000000110001101010101100001000000000000001100011010101011000010000000000000011000110101010110000100000000000000110001101010101100001000000000000001100011010101011000010000000000000011000110101010110000100000000000000110001101010101100001000000000000001100011010101011000010000000000000011000110101010110000100000000000000110001101010101100001000000000000001100011010101011000010000000000000011000110101010110000100000000000000110001111110101100001000000000000101100011010101011000010000000000001011000110101010110000100000000000010110001101010101100001000000000000101100011010101011000010000000000001011000110101010110000100000000000010110001101010101100001000000000000101100011010101011000010000000000001011000110101010110000100000000000010110001101010101100001000000000000101100011010101011000010000000000001011000110101010110000100000000000010110001101010101100001000000000000101100011010101011000010000000000001011000110101010110000100000000000010110001101010101100001000000000000101100011010101011000010000000000001011000110101010110000100000000000010110001101010101100001000000000000101100011010101011000010000000000001011000110101010110000100000000000010110001101010101100001000000000000101100011010101011000010000000000001011000110101010110000100000000000010110001101010101100001000000000000101100011010101011000010000000000001011000110101010110000100000000000010110001101010101100001000000000000101100011010101011000010000000000001011000110101010110000100000000000010110001101010101100001000000000000101100011010101011000010000000000001011000111100101110000100000000000010110001101010101100001000000000000101100011010101011000010000000000001011000110101010110000100000000000010110001101010101100001000000000000101100011010101011000010000000000001011000110101010110000100000000000010110001101010101100001000000000000101100011010101011000010000000000001011000110101010110000100000000000010110001101010101100001000000000000101100011010101011000010000000000001011000110101010110000100000000000010110001101010101100001000000000000101100011010101011000010000000000001011000110101010110000100000000000010110001101010101100001000000000000101100011010101011000010000000000001011000110101010110000100000000000010110001101010101100001000000000000101100011010101011000010000000000001011000110101010110000100000000000010110001101010101100001000000000000101100011010101011000010000000000001011000110101010110000100000000000010110001101010101100001000000000000101100011010101011000010000000000001011000110101010110000100000000000010110001101010101100001000000000000101100011010101011000010000000000001011000110101010110000100000000000010110001101010101100001000000000000101100011110010111000010000000000000111000110101010110000100000000000001110001101010101100001000000000000011100011010101011000010000000000000111000110101010110000100000000000001110001101010101100001000000000000011100011010101011000010000000000000111000110101010110000100000000000001110001101010101100001000000000000011100011010101011000010000000000000111000110101010110000100000000000001110001101010101100001000000000000011100011010101011000010000000000000111000110101010110000100000000000001110001101010101100001000000000000011100011010101011000010000000000000111000110101010110000100000000000001110001101010101100001000000000000011100011010101011000010000000000000111000110101010110000100000000000001110001101010101100001000000000000011100011010101011000010000000000000111000110101010110000100000000000001110001101010101100001000000000000011100011010101011000010000000000000111000110101010110000100000000000001110001101010101100001000000000000011100011010101011000010000000000000111000110101010110000100000000000001110001101010101100001000000000000011100011010101011000010000000000000111000110101010110000100000000000001110001101010101100001000000000000011100011010101011000010000000000000111000110101010110000100000000000001110001101010101100001000000000000011100011010101011000010000000000000111000100010101110000100000000000011110001101010101100001000000000000111100011010101011000010000000000001111000110101010110000100000000000011110001101010101100001000000000000111100011010101011000010000000000001111000110101010110000100000000000011110001101010101100001000000000000111100011010101011000010000000000001111000110101010110000100000000000011110001101010101100001000000000000111100011010101011000010000000000001111000110101010110000100000000000011110001101010101100001000000000000111100011010101011000010000000000001111000110101010110000100000000000011110001101010101100001000000000000111100011010101011000010000000000001111000110101010110000100000000000011110001101010101100001000000000000111100011010101011000010000000000001111000110101010110000100000000000011110001101010101100001000000000000111100011010101011000010000000000001111000110101010110000100000000000011110001101010101100001000000000000111100011010101011000010000000000001111000100101100110000100000000000011111111011001001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000010010110110101010110000000000000000000101101101010101100000000000000000001011011010101011000000000000000000010110110101010110000000000000000000101101101010101100000000000000000001011011010101011000000000000000000010110110101010110000000000000000000101101101010101100000000000000000001011011010101011000000000000000000010110110101010110000000000000000000101101101010101100000000000000000001011011010101011000000000000000000010110110101010110000000000000000000101101101010101100000000000000000001011011010101011000000000000000000010110110101010110000000000000000000101101101010101100000000000000000001011011010101011000000000000000000010110110101010110000000000000000000101101101010101100000000000000000001011011010101011000000000000000000010110110101010110000000000000000000101101101010101100000000000000000001011011010101011000000000000000000010110110101010110000000000000000000101101101010101100000000000000000001011011010101011000000000000000000010110110101010110000000000000000000101101101010101100000000000000000001011011010101011000000000000000000010110110101010110000000000000000000101101101010101100000000000000000001011011010101011000000000000000000010110110101010110000000000000000000101101111110101100000000000000000000010011010101011000010000000000000000100110101010110000100000000000000001001101010101100001000000000000000010011010101011000010000000000000000100110101010110000100000000000000001001101010101100001000000000000000010011010101011000010000000000000000100110101010110000100000000000000001001101010101100001000000000000000010011010101011000010000000000000000100110101010110000100000000000000001001101010101100001000000000000000010011010101011000010000000000000000100110101010110000100000000000000001001101010101100001000000000000000010011010101011000010000000000000000100110101010110000100000000000000001001101010101100001000000000000000010011010101011000010000000000000000100110101010110000100000000000000001001101010101100001000000000000000010011010101011000010000000000000000100110101010110000100000000000000001001101010101100001000000000000000010011010101011000010000000000000000100110101010110000100000000000000001001101010101100001000000000000000010011010101011000010000000000000000100110101010110000100000000000000001001101010101100001000000000000000010011010101011000010000000000000000100110101010110000100000000000000001001101010101100001000000000000000010011011011111000010000000000001000100110101010110000100000000000010001001101010101100001000000000000100010011010101011000010000000000001000100110101010110000100000000000010001001101010101100001000000000000100010011010101011000010000000000001000100110101010110000100000000000010001001101010101100001000000000000100010011010101011000010000000000001000100110101010110000100000000000010001001101010101100001000000000000100010011010101011000010000000000001000100110101010110000100000000000010001001101010101100001000000000000100010011010101011000010000000000001000100110101010110000100000000000010001001101010101100001000000000000100010011010101011000010000000000001000100110101010110000100000000000010001001101010101100001000000000000100010011010101011000010000000000001000100110101010110000100000000000010001001101010101100001000000000000100010011010101011000010000000000001000100110101010110000100000000000010001001101010101100001000000000000100010010001010111000010000000000000100100110101010110000100000000000001001001101010101100001000000000000010010011010101011000010000000000000100100110101010110000100000000000001001001101010101100001000000000000010010011010101011000010000000000000100100110101010110000100000000000001001001101010101100001000000000000010010011010101011000010000000000000100100110101010110000100000000000001001001101010101100001000000000000010010011010101011000010000000000000100100110101010110000100000000000001001001101010101100001000000000000010010011010101011000010000000000000100100110101010110000100000000000001001001101010101100001000000000000010010011010101011000010000000000000100100110101010110000100000000000001001001101010101100001000000000000010010011010101011000010000000000000100100110101010110000100000000000001001001101010101100001000000000000010010011010101011000010000000000000100100110101010110000100000000000001001001101010101100001000000000000010010011010101011000010000000000000100100110101010110000100000000000001001001101010101100001000000000000010010011010101011000010000000000000100100110101010110000100000000000001001001101010101100001000000000000010010011010101011000010000000000000100100110101010110000100000000000001001001101010101100001000000000000010010011010101011000010000000000000100100110101100110000100000000000011111111100111101100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000110101101101010101100000000000000000101011011010101011000000000000000001010110110101010110000000000000000010101101101010101100000000000000000101011011010101011000000000000000001010110110101010110000000000000000010101101101010101100000000000000000101011011010101011000000000000000001010110110101010110000000000000000010101101101010101100000000000000000101011011010101011000000000000000001010110110101010110000000000000000010101101101010101100000000000000000101011011010101011000000000000000001010110110101010110000000000000000010101101101010101100000000000000000101011011010101011000000000000000001010110110101010110000000000000000010101101101010101100000000000000000101011011010101011000000000000000001010110110101010110000000000000000010101101101010101100000000000000000101011011010101011000000000000000001010110110101010110000000000000000010101101101010101100000000000000000101011011010101011000000000000000001010110110101010110000000000000000010101101101010101100000000000000000101011011010101011000000000000000001010110110101010110000000000000000010101101101010101100000000000000000101011011010101011000000000000000001010110110101010110000000000000000010101101101010101100000000000000000101011010001010111000000000000000000110110110101010110000000000000000001101101101010101100000000000000000011011011010101011000000000000000000110110110101010110000000000000000001101101101010101100000000000000000011011011010101011000000000000000000110110110101010110000000000000000001101101101010101100000000000000000011011011010101011000000000000000000110110110101010110000000000000000001101101101010101100000000000000000011011011010101011000000000000000000110110110101010110000000000000000001101101101010101100000000000000000011011011010101011000000000000000000110110110101010110000000000000000001101101101010101100000000000000000011011011010101011000000000000000000110110110101010110000000000000000001101101101010101100000000000000000011011011010101011000000000000000000110110110101010110000000000000000001101101101010101100000000000000000011011011010101011000000000000000000110110110101010110000000000000000001101101101010101100000000000000000011011011010101011000000000000000000110110110101010110000000000000000001101101101010101100000000000000000011011011010101011000000000000000000110110110101010110000000000000000001101101000000001100000000000000000110010011010101011000010000000000001100100110101010110000100000000000011001001101010101100001000000000000110010011010101011000010000000000001100100110101010110000100000000000011001001101010101100001000000000000110010011010101011000010000000000001100100110101010110000100000000000011001001101010101100001000000000000110010011010101011000010000000000001100100110101010110000100000000000011001001101010101100001000000000000110010011010101011000010000000000001100100110101010110000100000000000011001001101010101100001000000000000110010011010101011000010000000000001100100110101010110000100000000000011001001101010101100001000000000000110010011010101011000010000000000001100100110101010110000100000000000011001001101010101100001000000000000110010011010101011000010000000000001100100110101010110000100000000000011001001101010101100001000000000000110010011010101011000010000000000001100100110101010110000100000000000011001001101010101100001000000000000110010011010101011000010000000000001100100110101010110000100000000000011001001101010101100001000000000000110010011010101011000010000000000001100100110101010110000100000000000011001001101010101100001000000000000110010011011011111000010000000000000010100110101010110000100000000000000101001101010101100001000000000000001010011010101011000010000000000000010100110101010110000100000000000000101001101010101100001000000000000001010011010101011000010000000000000010100110101010110000100000000000000101001101010101100001000000000000001010011010101011000010000000000000010100110101010110000100000000000000101001101010101100001000000000000001010011010101011000010000000000000010100110101010110000100000000000000101001101010101100001000000000000001010011010101011000010000000000000010100110101010110000100000000000000101001101010101100001000000000000001010011010101011000010000000000000010100110101010110000100000000000000101001101010101100001000000000000001010011010101011000010000000000000010100110101010110000100000000000000101001101010101100001000000000000001010011010101011000010000000000000010100110101010110000100000000000000101001101010101100001000000000000001010011010101011000010000000000000010100110101010110000100000000000000101001101010101100001000000000000001010011010101011000010000000000000010100110101010110000100000000000000101001000101011100001000000000000101010011010101011000010000000000001010100110101010110000100000000000010101001101010101100001000000000000101010011010101011000010000000000001010100110101010110000100000000000010101001101010101100001000000000000101010011010101011000010000000000001010100110101010110000100000000000010101001101010101100001000000000000101010011010101011000010000000000001010100110101010110000100000000000010101001101010101100001000000000000101010011010101011000010000000000001010100110101010110000100000000000010101001101010101100001000000000000101010011010101011000010000000000001010100110101010110000100000000000010101001101010101100001000000000000101010011010101011000010000000000001010100110101010110000100000000000010101001101010101100001000000000000101010011010101011000010000000000001010100110101010110000100000000000010101001101010101100001000000000000101010011010101011000010000000000001010100110101010110000100000000000010101001001110001100001000000000000111111111111000011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000100111001101010101100000000000000000001110011010101011000000000000000000011100110101010110000000000000000000111001101010101100000000000000000001110011010101011000000000000000000011100110101010110000000000000000000111001101010101100000000000000000001110011010101011000000000000000000011100110101010110000000000000000000111001101010101100000000000000000001110011010101011000000000000000000011100110101010110000000000000000000111001101010101100000000000000000001110011010101011000000000000000000011100110101010110000000000000000000111001101010101100000000000000000001110011010101011000000000000000000011100110101010110000000000000000000111001101010101100000000000000000001110011010101011000000000000000000011100110101010110000000000000000000111001101010101100000000000000000001110011010101011000000000000000000011100110101010110000000000000000000111001101010101100000000000000000001110011010101011000000000000000000011100110101010110000000000000000000111001101010101100000000000000000001110011010101011000000000000000000011100110101010110000000000000000000111001101010101100000000000000000001110011010101011000000000000000000011100110101010110000000000000000000111001101010101100000000000000000001110011110100011000000000000000001011100110101010110000000000000000010111001101010101100000000000000000101110011010101011000000000000000001011100110101010110000000000000000010111001101010101100000000000000000101110011010101011000000000000000001011100110101010110000000000000000010111001101010101100000000000000000101110011010101011000000000000000001011100110101010110000000000000000010111001101010101100000000000000000101110011010101011000000000000000001011100110101010110000000000000000010111001101010101100000000000000000101110011010101011000000000000000001011100110101010110000000000000000010111001101010101100000000000000000101110011010101011000000000000000001011100110101010110000000000000000010111001101010101100000000000000000101110011010101011000000000000000001011100110101010110000000000000000010111001101010101100000000000000000101110011010101011000000000000000001011100110101010110000000000000000010111001101010101100000000000000000101110011010101011000000000000000001011100110101010110000000000000000010111001101010101100000000000000000101110011010101011000000000000000001011100110101010110000000000000000010111001000000001100000000000000000011010011010101011000010000000000000110100110101010110000100000000000001101001101010101100001000000000000011010011010101011000010000000000000110100110101010110000100000000000001101001101010101100001000000000000011010011010101011000010000000000000110100110101010110000100000000000001101001101010101100001000000000000011010011010101011000010000000000000110100110101010110000100000000000001101001101010101100001000000000000011010011010101011000010000000000000110100110101010110000100000000000001101001101010101100001000000000000011010011010101011000010000000000000110100110101010110000100000000000001101001101010101100001000000000000011010011010101011000010000000000000110100110101010110000100000000000001101001101010101100001000000000000011010011010101011000010000000000000110100110101010110000100000000000001101001101010101100001000000000000011010011010101011000010000000000000110100110101010110000100000000000001101001101010101100001000000000000011010011010101011000010000000000000110100110101010110000100000000000001101001101010101100001000000000000011010011010101011000010000000000000110100110101010110000100000000000001101001101010101100001000000000000011010011110100011000010000000000001110100110101010110000100000000000011101001101010101100001000000000000111010011010101011000010000000000001110100110101010110000100000000000011101001101010101100001000000000000111010011010101011000010000000000001110100110101010110000100000000000011101001101010101100001000000000000111010011010101011000010000000000001110100110101010110000100000000000011101001101010101100001000000000000111010011010101011000010000000000001110100110101010110000100000000000011101001101010101100001000000000000111010011010101011000010000000000001110100110101010110000100000000000011101001101010101100001000000000000111010011010101011000010000000000001110100110101010110000100000000000011101001101010101100001000000000000111010011010101011000010000000000001110100110101010110000100000000000011101001101010101100001000000000000111010011010101011000010000000000001110100110101010110000100000000000011101001101010101100001000000000000111010011000000011000010000000000000001100110101010110000100000000000000011001101010101100001000000000000000110011010101011000010000000000000001100110101010110000100000000000000011001101010101100001000000000000000110011010101011000010000000000000001100110101010110000100000000000000011001101010101100001000000000000000110011010101011000010000000000000001100110101010110000100000000000000011001101010101100001000000000000000110011010101011000010000000000000001100110101010110000100000000000000011001101010101100001000000000000000110011010101011000010000000000000001100110101010110000100000000000000011001101010101100001000000000000000110011010101011000010000000000000001100110101010110000100000000000000011001101010101100001000000000000000110011010101011000010000000000000001100110101010110000100000000000000011001101010101100001000000000000000110011010101011000010000000000000001100110101010110000100000000000000011001101010101100001000000000000000110011010101011000010000000000000001100110101010110000100000000000000011001101010101100001000000000000000110011010101011000010000000000000001100110101010110000100000000000000011001101010101100001000000000000000110011010101011000010000000000000001100110101010110000100000000000000011001101010101100001000000000000000110011010101011000010000000000000001100100011001110000100000000000011111111010001101100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011000110010101010110000100000000000010001100101010101100001000000000000100011001010101011000010000000000001000110010101010110000100000000000010001100101010101100001000000000000100011001010101011000010000000000001000110010101010110000100000000000010001100101010101100001000000000000100011001010101011000010000000000001000110010101010110000100000000000010001100101010101100001000000000000100011001010101011000010000000000001000110010101010110000100000000000010001100101010101100001000000000000100011001010101011000010000000000001000110010101010110000100000000000010001100101010101100001000000000000100011001010101011000010000000000001000110010101010110000100000000000010001100101010101100001000000000000100011001010101011000010000000000001000110010101010110000100000000000010001100101010101100001000000000000100011001010101011000010000000000001000110010101010110000100000000000010001100101010101100001000000000000100011001010101011000010000000000001000110010101010110000100000000000010001100101010101100001000000000000100011001010101011000010000000000001000110010101010110000100000000000010001100101010101100001000000000000100011001010101011000010000000000001000110010101010110000100000000000010001100101010101100001000000000000100011001010101011000010000000000001000110010101010110000100000000000010001100001011001100001000000000000111111110000010011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000101110011101010101100000010011001000011100111010101011000000100110010000111001110101010110000001001100100001110011101010101100000010011001000011100111010101011000000100110010000111001110101010110000001001100100001110011101010101100000010011001000011100111010101011000000100110010000111001110101010110000001001100100001110011101010101100000010011001000011100111010101011000000100110010000111001110101010110000001001100100001110011101010101100000010011001000011100111010101011000000100110010000111001110101010110000001001100100001110011101010101100000010011001000011100111010101011000000100110010000111001110101010110000001001100100001110011101010101100000010011001000011100111010101011000000100110010000111001110101010110000001001100100001110011101010101100000010011001000011100111010101011000000100110010000111001110101010110000001001100100001110011101010101100000010011001000011100111010101011000000100110010000111001110101010110000001001100100001110011101010101100000010011001000011100111010101011000000100110010000111001110101010110000001001100100001110011101010101100000010011001000011100111010101011000000100110010000111001110101010110000001001100100001110011101010101100000010011001000011100111010101011000000100110010000111001110101010110000001001100100001110011101010101100000010011001000011100110000010011000000100110010001011001110101010110000000100000100010110011101010101100000001000001000101100111010101011000000010000010001011001110101010110000000100000100010110011101010101100000001000001000101100111010101011000000010000010001011001110101010110000000100000100010110011101010101100000001000001000101100111010101011000000010000010001011001110101010110000000100000100010110011101010101100000001000001000101100111010101011000000010000010001011001110101010110000000100000100010110011101010101100000001000001000101100111010101011000000010000010001011001110101010110000000100000100010110011101010101100000001000001000101100111010101011000000010000010001011001110101010110000000100000100010110011101010101100000001000001000101100111010101011000000010000010001011001110101010110000000100000100010110011101010101100000001000001000101100111010101011000000010000010001011001110101010110000000100000100010110011101010101100000001000001000101100111010101011000000010000010001011001110101010110000000100000100010110011101010101100000001000001000101100111010101011000000010000010001011001110000000110000000100000100010001100101010101100001000000000000100011001010101011000010000000000001000110010101010110000100000000000010001100101010101100001000000000000100011001010101011000010000000000001000110010101010110000100000000000010001100101010101100001000000000000100011001010101011000010000000000001000110010101010110000100000000000010001100101010101100001000000000000100011001010101011000010000000000001000110010101010110000100000000000010001100101010101100001000000000000100011001010101011000010000000000001000110010101010110000100000000000010001100101010101100001000000000000100011001010101011000010000000000001000110010101010110000100000000000010001100101010101100001000000000000100011001010101011000010000000000001000110010101010110000100000000000010001100101010101100001000000000000100011001010101011000010000000000001000110010101010110000100000000000010001100101010101100001000000000000100011001010101011000010000000000001000110010101010110000100000000000010001100101010101100001000000000000100011001010101011000010000000000001000110010101010110000100000000000010001100101010101100001000000000000100011001010101011000010000000000001000110000101100110000100000000000001001100101010101100001000000000000010011001010101011000010000000000000100110010101010110000100000000000001001100101010101100001000000000000010011001010101011000010000000000000100110010101010110000100000000000001001100101010101100001000000000000010011001010101011000010000000000000100110010101010110000100000000000001001100101010101100001000000000000010011001010101011000010000000000000100110010101010110000100000000000001001100101010101100001000000000000010011001010101011000010000000000000100110010101010110000100000000000001001100101010101100001000000000000010011001010101011000010000000000000100110010101010110000100000000000001001100101010101100001000000000000010011001010101011000010000000000000100110010101010110000100000000000001001100101010101100001000000000000010011001010101011000010000000000000100110010101010110000100000000000001001100101010101100001000000000000010011001010101011000010000000000000100110010101010110000100000000000001001100101010101100001000000000000010011001010101011000010000000000000100110010101010110000100000000000001001100101010101100001000000000000010011001010101011000010000000000000100110010101010110000100000000000001001100001010101100001000000000000111111110000000111000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000110110011101010101100001000000000000101100111010101011000010000000000001011001110101010110000100000000000010110011101010101100001000000000000101100111010101011000010000000000001011001110101010110000100000000000010110011101010101100001000000000000101100111010101011000010000000000001011001110101010110000100000000000010110011101010101100001000000000000101100111010101011000010000000000001011001110101010110000100000000000010110011101010101100001000000000000101100111010101011000010000000000001011001110101010110000100000000000010110011101010101100001000000000000101100111010101011000010000000000001011001110101010110000100000000000010110011101010101100001000000000000101100111010101011000010000000000001011001110101010110000100000000000010110011101010101100001000000000000101100111010101011000010000000000001011001110101010110000100000000000010110011101010101100001000000000000101100111010101011000010000000000001011001110101010110000100000000000010110011101010101100001000000000000101100111010101011000010000000000001011001110101010110000100000000000010110011101010101100001000000000000101100111010101011000010000000000001011001110101010110000100000000000010110011101010101100001000000000000101100111010101011000010000000000001011001110101010110000100000000000010110011010000011100001000000000000001100111010101011000000000000000000011001110101010110000000000000000000110011101010101100000000000000000001100111010101011000000000000000000011001110101010110000000000000000000110011101010101100000000000000000001100111010101011000000000000000000011001110101010110000000000000000000110011101010101100000000000000000001100111010101011000000000000000000011001110101010110000000000000000000110011101010101100000000000000000001100111010101011000000000000000000011001110101010110000000000000000000110011101010101100000000000000000001100111010101011000000000000000000011001110101010110000000000000000000110011101010101100000000000000000001100111010101011000000000000000000011001110101010110000000000000000000110011101010101100000000000000000001100111010101011000000000000000000011001110101010110000000000000000000110011101010101100000000000000000001100111010101011000000000000000000011001110101010110000000000000000000110011101010101100000000000000000001100111010101011000000000000000000011001110101010110000000000000000000110011000001001100000000000000000110100111010101011000000011100100001101001110101010110000000111001000011010011101010101100000001110010000110100111010101011000000011100100001101001110101010110000000111001000011010011101010101100000001110010000110100111010101011000000011100100001101001110101010110000000111001000011010011101010101100000001110010000110100111010101011000000011100100001101001110101010110000000111001000011010011101010101100000001110010000110100111010101011000000011100100001101001110101010110000000111001000011010011101010101100000001110010000110100111010101011000000011100100001101001110101010110000000111001000011010011101010101100000001110010000110100111010101011000000011100100001101001110101010110000000111001000011010011101010101100000001110010000110100111010101011000000011100100001101001110101010110000000111001000011010011101010101100000001110010000110100111010101011000000011100100001101001110101010110000000111001000011010011101010101100000001110010000110100111010101011000000011100100001101001110101010110000000111001000011010011101010101100000001110010000110100111010101011000000011100100001101001100000000110000000111001000001010011101010101100000000001010000010100111010101011000000000010100000101001110101010110000000000101000001010011101010101100000000001010000010100111010101011000000000010100000101001110101010110000000000101000001010011101010101100000000001010000010100111010101011000000000010100000101001110101010110000000000101000001010011101010101100000000001010000010100111010101011000000000010100000101001110101010110000000000101000001010011101010101100000000001010000010100111010101011000000000010100000101001110101010110000000000101000001010011101010101100000000001010000010100111010101011000000000010100000101001110101010110000000000101000001010011101010101100000000001010000010100111010101011000000000010100000101001110101010110000000000101000001010011101010101100000000001010000010100111010101011000000000010100000101001110101010110000000000101000001010011101010101100000000001010000010100111010101011000000000010100000101001110101010110000000000101000001010011101010101100000000001010000010100111010101011000000000010100000101001110101010110000000000101000001010011101010101100000000001010000010100110111001011000000000010100001001001110101010110000001111011100010010011101010101100000011110111000100100111010101011000000111101110001001001110101010110000001111011100010010011101010101100000011110111000100100111010101011000000111101110001001001110101010110000001111011100010010011101010101100000011110111000100100111010101011000000111101110001001001110101010110000001111011100010010011101010101100000011110111000100100111010101011000000111101110001001001110101010110000001111011100010010011101010101100000011110111000100100111010101011000000111101110001001001110101010110000001111011100010010011101010101100000011110111000100100111010101011000000111101110001001001110101010110000001111011100010010011101010101100000011110111000100100111010101011000000111101110001001001110101010110000001111011100010010011101010101100000011110111000100100111010101011000000111101110001001001110101010110000001111011100010010011101010101100000011110111000100100111010101011000000111101110001001001110101010110000001111011100010010011101010101100000011110111000100100111010101011000000111101110001001001110101010110000001111011100010010011000010101100000011110111000000100111010101011000000000000000000001001110101010110000000000000000000010011101010101100000000000000000000100111010101011000000000000000000001001110101010110000000000000000000010011101010101100000000000000000000100111010101011000000000000000000001001110101010110000000000000000000010011101010101100000000000000000000100111010101011000000000000000000001001110101010110000000000000000000010011101010101100000000000000000000100111010101011000000000000000000001001110101010110000000000000000000010011101010101100000000000000000000100111010101011000000000000000000001001110101010110000000000000000000010011101010101100000000000000000000100111010101011000000000000000000001001110101010110000000000000000000010011101010101100000000000000000000100111010101011000000000000000000001001110101010110000000000000000000010011101010101100000000000000000000100111010101011000000000000000000001001110101010110000000000000000000010011101010101100000000000000000000100111010101011000000000000000000001001110101010110000000000000000000010011101010101100000000000000000000100111010101011000000000000000000001001111110111110000000000000000011001100101010101100001000000000000110011001010101011000010000000000001100110010101010110000100000000000011001100101010101100001000000000000110011001010101011000010000000000001100110010101010110000100000000000011001100101010101100001000000000000110011001010101011000010000000000001100110010101010110000100000000000011001100101010101100001000000000000110011001010101011000010000000000001100110010101010110000100000000000011001100101010101100001000000000000110011001010101011000010000000000001100110010101010110000100000000000011001100101010101100001000000000000110011001010101011000010000000000001100110010101010110000100000000000011001100101010101100001000000000000110011001010101011000010000000000001100110010101010110000100000000000011001100101010101100001000000000000110011001010101011000010000000000001100110010101010110000100000000000011001100101010101100001000000000000110011001010101011000010000000000001100110010101010110000100000000000011001100101010101100001000000000000110011001010101011000010000000000001100110010101010110000100000000000011001100101010101100001000000000000110011001010101011000010000000000001100110010101010110000100000000000011001100011110111100001000000000000001011001010101011000010000000000000010110010101010110000100000000000000101100101010101100001000000000000001011001010101011000010000000000000010110010101010110000100000000000000101100101010101100001000000000000001011001010101011000010000000000000010110010101010110000100000000000000101100101010101100001000000000000001011001010101011000010000000000000010110010101010110000100000000000000101100101010101100001000000000000001011001010101011000010000000000000010110010101010110000100000000000000101100101010101100001000000000000001011001010101011000010000000000000010110010101010110000100000000000000101100101010101100001000000000000001011001010101011000010000000000000010110010101010110000100000000000000101100101010101100001000000000000001011001010101011000010000000000000010110010101010110000100000000000000101100101010101100001000000000000001011001010101011000010000000000000010110010101010110000100000000000000101100101010101100001000000000000001011001010101011000010000000000000010110010101010110000100000000000000101100101010101100001000000000000001011001010101011000010000000000000010110000001010110000100000000000011111111001000001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000100001010101010101100001000000000000000010101010101011000010000000000000000101010101010110000100000000000000001010101010101100001000000000000000010101010101011000010000000000000000101010101010110000100000000000000001010101010101100001000000000000000010101010101011000010000000000000000101010101010110000100000000000000001010101010101100001000000000000000010101010101011000010000000000000000101010101010110000100000000000000001010101010101100001000000000000000010101010101011000010000000000000000101010101010110000100000000000000001010101010101100001000000000000000010101010101011000010000000000000000101010101010110000100000000000000001010101010101100001000000000000000010101010101011000010000000000000000101010101010110000100000000000000001010101010101100001000000000000000010101010101011000010000000000000000101010101010110000100000000000000001010101010101100001000000000000000010101010101011000010000000000000000101010101010110000100000000000000001010101010101100001000000000000000010101010101011000010000000000000000101010101010110000100000000000000001010101010101100001000000000000000010101010101011000010000000000000000101010101010110000100000000000000001010101010101100001000000000000000010101010101011000010000000000000000101010101010110000100000000000000001010111100101100001000000000000100010101010101011000010000000000001000101010101010110000100000000000010001010101010101100001000000000000100010101010101011000010000000000001000101010101010110000100000000000010001010101010101100001000000000000100010101010101011000010000000000001000101010101010110000100000000000010001010101010101100001000000000000100010101010101011000010000000000001000101010101010110000100000000000010001010101010101100001000000000000100010101010101011000010000000000001000101010101010110000100000000000010001010101010101100001000000000000100010101010101011000010000000000001000101010101010110000100000000000010001010101010101100001000000000000100010101010101011000010000000000001000101010101010110000100000000000010001010101010101100001000000000000100010101010101011000010000000000001000101010101010110000100000000000010001010101010101100001000000000000100010101010101011000010000000000001000101010101010110000100000000000010001010000000001100001000000000000101011001010101011000010000000000001010110010101010110000100000000000010101100101010101100001000000000000101011001010101011000010000000000001010110010101010110000100000000000010101100101010101100001000000000000101011001010101011000010000000000001010110010101010110000100000000000010101100101010101100001000000000000101011001010101011000010000000000001010110010101010110000100000000000010101100101010101100001000000000000101011001010101011000010000000000001010110010101010110000100000000000010101100101010101100001000000000000101011001010101011000010000000000001010110010101010110000100000000000010101100101010101100001000000000000101011001010101011000010000000000001010110010101010110000100000000000010101100101010101100001000000000000101011001010101011000010000000000001010110010101010110000100000000000010101100101010101100001000000000000101011001010101011000010000000000001010110010101010110000100000000000010101100101010101100001000000000000101011001010101011000010000000000001010110010101010110000100000000000010101100101010101100001000000000000101011001010101011000010000000000001010110010101010110000100000000000010101100101010101100001000000000000101011001010101011000010000000000001010110010101010110000100000000000010101100101010101100001000000000000101011000110011111000010000000000000110110010101010110000100000000000001101100101010101100001000000000000011011001010101011000010000000000000110110010101010110000100000000000001101100101010101100001000000000000011011001010101011000010000000000000110110010101010110000100000000000001101100101010101100001000000000000011011001010101011000010000000000000110110010101010110000100000000000001101100101010101100001000000000000011011001010101011000010000000000000110110010101010110000100000000000001101100101010101100001000000000000011011001010101011000010000000000000110110010101010110000100000000000001101100101010101100001000000000000011011001010101011000010000000000000110110010101010110000100000000000001101100101010101100001000000000000011011001010101011000010000000000000110110010101010110000100000000000001101100101010101100001000000000000011011001010101011000010000000000000110110010101010110000100000000000001101100101010101100001000000000000011011001010101011000010000000000000110110010101010110000100000000000001101100101010101100001000000000000011011001010101011000010000000000000110110010101010110000100000000000001101100011000101100001000000000000111011001010101011000010000000000001110110010101010110000100000000000011101100101010101100001000000000000111011001010101011000010000000000001110110010101010110000100000000000011101100101010101100001000000000000111011001010101011000010000000000001110110010101010110000100000000000011101100101010101100001000000000000111011001010101011000010000000000001110110010101010110000100000000000011101100101010101100001000000000000111011001010101011000010000000000001110110010101010110000100000000000011101100101010101100001000000000000111011001010101011000010000000000001110110010101010110000100000000000011101100101010101100001000000000000111011001010101011000010000000000001110110010101010110000100000000000011101100101010101100001000000000000111011001010101011000010000000000001110110010101010110000100000000000011101100101010101100001000000000000111011001010101011000010000000000001110110010101010110000100000000000011101100000010001100001000000000000111111111000000111000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000101100000101010101100001000000000000011000001010101011000010000000000000110000010101010110000100000000000001100000101010101100001000000000000011000001010101011000010000000000000110000010101010110000100000000000001100000101010101100001000000000000011000001010101011000010000000000000110000010101010110000100000000000001100000101010101100001000000000000011000001010101011000010000000000000110000010101010110000100000000000001100000101010101100001000000000000011000001010101011000010000000000000110000010101010110000100000000000001100000101010101100001000000000000011000001010101011000010000000000000110000010101010110000100000000000001100000101010101100001000000000000011000001010101011000010000000000000110000010101010110000100000000000001100000101010101100001000000000000011000001010101011000010000000000000110000010101010110000100000000000001100000101010101100001000000000000011000001010101011000010000000000000110000010101010110000100000000000001100000101010101100001000000000000011000001010101011000010000000000000110000010101010110000100000000000001100000101010101100001000000000000011000001010101011000010000000000000110000010101010110000100000000000001100000101010101100001000000000000011000001010101011000010000000000000110000010101010110000100000000000001100000010000001100001000000000000111011001010101011000010000000000001110110010101010110000100000000000011101100101010101100001000000000000111011001010101011000010000000000001110110010101010110000100000000000011101100101010101100001000000000000111011001010101011000010000000000001110110010101010110000100000000000011101100101010101100001000000000000111011001010101011000010000000000001110110010101010110000100000000000011101100101010101100001000000000000111011001010101011000010000000000001110110010101010110000100000000000011101100101010101100001000000000000111011001010101011000010000000000001110110010101010110000100000000000011101100101010101100001000000000000111011001010101011000010000000000001110110010101010110000100000000000011101100101010101100001000000000000111011001010101011000010000000000001110110010101010110000100000000000011101100101010101100001000000000000111011001010101011000010000000000001110110010101010110000100000000000011101100101010101100001000000000000111011001010101011000010000000000001110110010101010110000100000000000011101100101010101100001000000000000111011001010101011000010000000000001110110000001000110000100000000000000011100101010101100001000000000000000111001010101011000010000000000000001110010101010110000100000000000000011100101010101100001000000000000000111001010101011000010000000000000001110010101010110000100000000000000011100101010101100001000000000000000111001010101011000010000000000000001110010101010110000100000000000000011100101010101100001000000000000000111001010101011000010000000000000001110010101010110000100000000000000011100101010101100001000000000000000111001010101011000010000000000000001110010101010110000100000000000000011100101010101100001000000000000000111001010101011000010000000000000001110010101010110000100000000000000011100101010101100001000000000000000111001010101011000010000000000000001110010101010110000100000000000000011100101010101100001000000000000000111001010101011000010000000000000001110010101010110000100000000000000011100101010101100001000000000000000111001010101011000010000000000000001110010101010110000100000000000000011100101010101100001000000000000000111001010101011000010000000000000001110010101010110000100000000000000011100101010101100001000000000000000111001111110011000010000000000001001110010101010110000100000000000010011100101010101100001000000000000100111001010101011000010000000000001001110010101010110000100000000000010011100101010101100001000000000000100111001010101011000010000000000001001110010101010110000100000000000010011100101010101100001000000000000100111001010101011000010000000000001001110010101010110000100000000000010011100101010101100001000000000000100111001010101011000010000000000001001110010101010110000100000000000010011100101010101100001000000000000100111001010101011000010000000000001001110010101010110000100000000000010011100101010101100001000000000000100111001010101011000010000000000001001110010101010110000100000000000010011100101010101100001000000000000100111001010101011000010000000000001001110010101010110000100000000000010011100101010101100001000000000000100111001010101011000010000000000001001110010101010110000100000000000010011100101010101100001000000000000100111001001001011000010000000000001001110010101010110000100000000000010011100101010101100001000000000000100111001010101011000010000000000001001110010101010110000100000000000010011100101010101100001000000000000100111001010101011000010000000000001001110010101010110000100000000000010011100101010101100001000000000000100111001010101011000010000000000001001110010101010110000100000000000010011100101010101100001000000000000100111001010101011000010000000000001001110010101010110000100000000000010011100101010101100001000000000000100111001010101011000010000000000001001110010101010110000100000000000010011100101010101100001000000000000100111001010101011000010000000000001001110010101010110000100000000000010011100101010101100001000000000000100111001010101011000010000000000001001110010101010110000100000000000010011100101010101100001000000000000100111001010101011000010000000000001001110010101010110000100000000000010011100101010101100001000000000000100111001010101011000010000000000001001110010101010110000100000000000010011100101010101100001000000000000100111001010101011000010000000000001001110010101010110000100000000000010011100100100101100001000000000000111111110010000011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111111111110110001100001000000000001111111111101100011000010000000000011111111111011000110000100000000000111100011101010101100000010011100000111000111010101011000000100111000001110001110101010110000001001110000011100011101010101100000010011100000111000111010101011000000100111000001110001110101010110000001001110000011100011101010101100000010011100000111000111010101011000000100111000001110001110101010110000001001110000011100011101010101100000010011100000111000111010101011000000100111000001110001110101010110000001001110000011100011101010101100000010011100000111000111010101011000000100111000001110001110101010110000001001110000011100011101010101100000010011100000111000111010101011000000100111000001110001110101010110000001001110000011100011101010101100000010011100000111000111010101011000000100111000001110001110101010110000001001110000011100011101010101100000010011100000111000111010101011000000100111000001110001110101010110000001001110000011100011101010101100000010011100000111000111010101011000000100111000001110001110101010110000001001110000011100011101010101100000010011100000111000111010101011000000100111000001110001110101010110000001001110000011100011101010101100000010011100000111000111010101011000000100111000001110001110101010110000001001110000011100011101010101100000010011100000111000110010101111000000100111000000110001110101010110000000010000100001100011101010101100000000100001000011000111010101011000000001000010000110001110101010110000000010000100 + 11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111T1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 + + + + + + + + + + + + + + + + + + + + diff --git a/Vsync.stp b/Vsync.stp index f1acb6a..cbf2169 100644 --- a/Vsync.stp +++ b/Vsync.stp @@ -1,148 +1,112 @@ - + - + - + + + + + + + + + + + + + - - - - - - - - - - - - - - - + + + + + + + + - - - - - - - - - - - - - - - + + + + + + + + - - - - - - - - - - - - - - - + + + + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + - + - 'emu:emu|coco3fpga:coco3|COCO3VIDEO:MISTER_COCOVID|VSYNC_N' == low && 'emu:emu|coco3fpga:coco3|RST_FF02_N' == rising edge + 'emu:emu|coco3fpga:coco3|hold' == rising edge - + - 111111111111111 - 111111111111111 + 11111111 + 11111111 @@ -160,23 +124,8 @@ trigger;]]> - - 011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111011000001011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111000000000011111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000001111100000000000111100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000110100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000100100000000000001100000000000001100000000000001100000000000001100000000000001100000000000001100000000000001100000000000001100000000000001100000000000001100000000000001100000000000001100000000000001100000000000001100000000000001100000000000001100000000000001100000000000001100000000000001100000000000001100000000000001100000000000001100000000000001100000000000001100000000000001100000000000001100000000000001100000000000001100000000000001100000000000001100000000000001100000000000001100000000000001100000000000001100000000000001100000000000001100000000000001100000000000001100000000000001100000000000001100000000000001100000000000001100000000000001100000000000001100000000000001100000000000001100000000000001100000000000001100000000000001100000000000001100000000000001100000000000001100000000000001100000000000001100000000000001100000000000001100000000000001100000000000001100000000000001100000000000001100000000000001100000000000001100000000000001100000000000001100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000101100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111100000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111010000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111110000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111001000000000111 - 11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111T1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 - - - - - - - - - - - - @@ -189,7 +138,8 @@ trigger;]]> - + + diff --git a/docs/CoCo3FPGA.docx b/docs/CoCo3FPGA.docx index 186ff4f..62c5ed0 100644 Binary files a/docs/CoCo3FPGA.docx and b/docs/CoCo3FPGA.docx differ diff --git a/docs/CoCo3FPGA.pdf b/docs/CoCo3FPGA.pdf index 4177f5a..a8d502d 100644 Binary files a/docs/CoCo3FPGA.pdf and b/docs/CoCo3FPGA.pdf differ diff --git a/files.qip b/files.qip index 1288d5b..3e75154 100644 --- a/files.qip +++ b/files.qip @@ -10,6 +10,7 @@ set_global_assignment -name VERILOG_FILE rtl/UART_6551/uart_6551.v set_global_assignment -name VERILOG_FILE rtl/UART_6551/6551tx.v set_global_assignment -name VERILOG_FILE rtl/UART_6551/6551rx.v set_global_assignment -name VHDL_FILE rtl/CPU09/cpu09l_128a.vhd +set_global_assignment -name VERILOG_FILE rtl/mc6809glb/mc6809glb.v set_global_assignment -name SYSTEMVERILOG_FILE rtl/coco3fpga.sv #set_global_assignment -name QIP_FILE CoCo3FPGA_Common/PH2_CLK.qip set_global_assignment -name VERILOG_FILE rtl/pll.v diff --git a/rtl/Mister_Video.v b/rtl/Mister_Video.v index 6bba46d..787f73b 100644 --- a/rtl/Mister_Video.v +++ b/rtl/Mister_Video.v @@ -191,13 +191,13 @@ assign OFFSET = ({HVEN,COCO1,VID_CONT[3],V[0]} == 4'b0111) ? ROW_ADD + 11'd16: // WHEN V[0]=1 16 BYTES V[0]=0 32 BYTES // HR Text -({HVEN,COCO1,BP,HRES[3:2],CRES[0],HRES[0]} == 6'b0000001) ? ROW_ADD + 11'd40: // HR TEXT with no Attributes -({HVEN,COCO1,BP,HRES[3:2],CRES[0],HRES[0]} == 6'b0000010) ? ROW_ADD + 11'd64: -({HVEN,COCO1,BP,HRES[3:2],CRES[0],HRES[0]} == 6'b0000011) ? ROW_ADD + 11'd80: -({HVEN,COCO1,BP,HRES[3:2],CRES[0],HRES[0]} == 6'b0000100) ? ROW_ADD + 11'd64: -({HVEN,COCO1,BP,HRES[3:2],CRES[0],HRES[0]} == 6'b0000101) ? ROW_ADD + 11'd80: -({HVEN,COCO1,BP,HRES[3:2],CRES[0],HRES[0]} == 6'b0000110) ? ROW_ADD + 11'd128: -({HVEN,COCO1,BP,HRES[3:2],CRES[0],HRES[0]} == 6'b0000111) ? ROW_ADD + 11'd160: +({HVEN,COCO1,BP,HRES[3:2],CRES[0],HRES[0]} == 7'b0000001) ? ROW_ADD + 11'd40: // HR TEXT with no Attributes +({HVEN,COCO1,BP,HRES[3:2],CRES[0],HRES[0]} == 7'b0000010) ? ROW_ADD + 11'd64: +({HVEN,COCO1,BP,HRES[3:2],CRES[0],HRES[0]} == 7'b0000011) ? ROW_ADD + 11'd80: +({HVEN,COCO1,BP,HRES[3:2],CRES[0],HRES[0]} == 7'b0000100) ? ROW_ADD + 11'd64: +({HVEN,COCO1,BP,HRES[3:2],CRES[0],HRES[0]} == 7'b0000101) ? ROW_ADD + 11'd80: +({HVEN,COCO1,BP,HRES[3:2],CRES[0],HRES[0]} == 7'b0000110) ? ROW_ADD + 11'd128: +({HVEN,COCO1,BP,HRES[3:2],CRES[0],HRES[0]} == 7'b0000111) ? ROW_ADD + 11'd160: // HR Graphics ({HVEN,COCO1,BP,HRES} == 7'b0010000) ? ROW_ADD + 11'd16: diff --git a/rtl/coco3fpga.sv b/rtl/coco3fpga.sv index 07e6b5e..d38bc87 100644 --- a/rtl/coco3fpga.sv +++ b/rtl/coco3fpga.sv @@ -6,7 +6,7 @@ // //////////////////////////////////////////////////////////////////////////////// // -// CPU section copyrighted by John Kent +// CPU section copyrighted by John Kent or Greg Miller dependant on selection // //////////////////////////////////////////////////////////////////////////////// // @@ -212,7 +212,7 @@ assign cas_relay = CAS_MTR; //Version 5 bits Major and 4 bits Minor -parameter Version_Hi = 8'h50; +parameter Version_Hi = 8'h51; parameter Version_Lo = 8'h20; // MiSTer @@ -254,7 +254,7 @@ reg RESET_N; reg [6:0] CPU_RESET_SM; reg CPU_RESET; wire RESET_INS; -reg MUGS; +reg MUGS = 0; wire RESET; wire RESET_P; wire [15:0] ADDRESS; @@ -724,37 +724,37 @@ assign BLOCK_ADDRESS = ({MMU_EN, MMU_TR, ADDRESS[15:13]} == 5'b1 ({VEC_PAG_RAM, MMU_EN, MMU_TR, ADDRESS[15:8]} ==11'b01111111110) ? SAM17: // 011 1111 1110 FE00-FEFF RAM Vector page {9'h007, ADDRESS[15:13]}; -assign RAM_CS = (ADDRESS[15:0]== 16'hFFE8) ? 1'b1: // GART 1 - (ADDRESS[15:0]== 16'hFFE9) ? 1'b1: // GART 2 - ({ADDRESS[15:8]}== 8'hFF) ? 1'b0: // Hardware (FF00-FFFF) always Excluded - (ADDRESS[15:8] == 8'b11111110) ? 1'b1: // Always enabled in FEXX Secondary Vectors - ROM_SEL ? 1'b0: // Internal ROM -// FLASH_CE_S ? 1'b0: // Cart ROM - CART_SEL ? 1'b0: // Cart ROM - 1'b1; +assign RAM_CS = (ADDRESS[15:0]== 16'hFFE8) ? 1'b1: // GART 1 + (ADDRESS[15:0]== 16'hFFE9) ? 1'b1: // GART 2 + ({ADDRESS[15:8]}== 8'hFF) ? 1'b0: // Hardware (FF00-FFFF) always Excluded + ({VEC_PAG_RAM, ADDRESS[15:8]} == 9'b111111110) ? 1'b1: // If VEC_PAG_RAM then include FEXX Secondary Vectors + ROM_SEL ? 1'b0: // Internal ROM + CART_SEL ? 1'b0: // Cart ROM + 1'b1; /***************************************************************************** * ROM signals ******************************************************************************/ -// ROM_SEL is 1 when the system is accessing any cartridge "ROM" meaning the +// ROM_SEL is 1 when the system is accessing the internal "ROM" +// CART_SEL is 1 when the system is accessing any cartridge "ROM" meaning the // 4 slots of the MPI, this is: -// Slot 1 Orchestra-90C -// Slot 2 Alternate Disk Controller ROM +// Slot 1 Not Used +// Slot 2 Disk Controller ROM // Slot 3 Cart slot // Slot 4 Disk Controller ROM -assign ROM_SEL = (ADDRESS[15:4] == 12'b111111111111) ? 1'b1: // Enable for Vectors - (ADDRESS[15:9] == 7'b1111111) ? 1'b0: // Disabled for FE00 - FFFF - ({ROM[1], RAM, BLOCK_ADDRESS[11:2], ADDRESS[14]} == 13'b0000000011110) ? 1'b1: // Enabled Read, 16K Int, Page 7, x1 - ({ROM, RAM, BLOCK_ADDRESS[11:2]} == 13'b1000000001111) ? 1'b1: // Enabled 32K int, Page 7, x +assign ROM_SEL = (ADDRESS[15:4] == 12'b111111111111) ? 1'b1: // Enable for Vectors + (ADDRESS[15:9] == 7'b1111111) ? 1'b0: // Disabled for FE00 - FFFF + ({ROM[1], RAM, BLOCK_ADDRESS[11:2], ADDRESS[14]} == 13'b0000000011110) ? 1'b1: // Enabled Read, 16K Int, Page 7, x1 $78000-$7BFFF + ({ROM, RAM, BLOCK_ADDRESS[11:2]} == 13'b1000000001111) ? 1'b1: // Enabled 32K int, Page 7, x $78000-$7FFFF 1'b0; -assign CART_SEL = (ADDRESS[15:9] == 7'b1111111) ? 1'b0: // Disabled for FE00 - FFFF - ({ROM[1], RAM, BLOCK_ADDRESS[11:2], ADDRESS[14]} == 13'b0000000011111) ? 1'b1: // Enabled Read, 16K Cart, Page 7, x1 - ({ROM, RAM, BLOCK_ADDRESS[11:2]} == 13'b1100000001111) ? 1'b1: // Enabled 32K Cart, Page 7, x1 - 1'b0; +assign CART_SEL = (ADDRESS[15:8] == 8'b11111111) ? 1'b0: // Disabled for FF00 - FFFF + ({ROM[1], RAM, BLOCK_ADDRESS[11:2], ADDRESS[14]} == 13'b0000000011111) ? 1'b1: // Enabled Read, 16K Cart, Page 7, x1 $7C000-$7FEFF + ({ROM, RAM, BLOCK_ADDRESS[11:2]} == 13'b1100000001111) ? 1'b1: // Enabled 32K Cart, Page 7, x1 $78000-$7FEFF + 1'b0; //ROM //00 16 Internal + 16 External @@ -765,11 +765,9 @@ assign CART_SEL = (ADDRESS[15:9] == 7'b1 assign FLASH_ADDRESS = ENA_DSK ? {9'b000000100, ADDRESS[12:0]}: //8K Disk BASIC 8K Slot 4 ENA_DISK2 ? {9'b000000100, ADDRESS[12:0]}: //[maps to same disk rom] - ENA_ORCC ? {9'b000000101, ADDRESS[12:0]}: //8K Orchestra 8K 90CC Slot 1 ({ENA_PAK, ROM[1]} == 2'b10) ? {5'b00000,ROM_BANK, ADDRESS[13:0]}: //16K External R CART ROM ({ENA_PAK, ROM} == 3'b111) ? {4'b0000,ROM_BANK, ~ADDRESS[14], ADDRESS[13:0]}: //32K External R CART ROM -// ROM_SEL - {7'b0000000,ADDRESS[14:0]}; + {7'b0000000,ADDRESS[14:0]}; //32K Internal COCO3 ROM //ROM @@ -835,24 +833,44 @@ COCO_ROM_CART CC3_ROM_CART( wire SDC_EN_CS; -assign ENA_ORCC = ({CART_SEL, MPI_CTS} == 3'b100) ? 1'b1: // Orchestra-90CC C000-DFFF Slot 1 - 1'b0; -assign ENA_DISK2 = ({CART_SEL, MPI_CTS} == 3'b101) ? 1'b1: // Alternative Disk controller ROM up to 32K - 1'b0; -assign ENA_PAK = ({CART_SEL, MPI_CTS} == 3'b110) ? 1'b1: // ROM SLOT 3 - 1'b0; -assign ENA_DSK = ({CART_SEL, MPI_CTS} == 3'b111) ? 1'b1: // Disk C000-DFFF Slot 4 - 1'b0; -assign HDD_EN = ({MPI_SCS, ADDRESS[15:4]} == 14'b11111111110100) ? 1'b1: // FF40-FF4F with MPI switch = 4 - 1'b0; -assign SDC_EN_CS = ({MPI_SCS, ADDRESS[15:4]} == 14'b01111111110100) ? 1'b1: // FF40-FF4F with MPI switch = 2 - 1'b0; -assign RS232_EN = (ADDRESS[15:2] == 14'b11111111011010) ? 1'b1: //FF68-FF6B - 1'b0; -assign SLOT3_HW = ({MPI_SCS, ADDRESS[15:5]} == 13'b1011111111010) ? 1'b1: // FF40-FF5F - 1'b0; -assign VDAC_EN = ({RW_N,ADDRESS[15:0]} == 17'H0FF7E) ? 1'b1: // FF7E - 1'b0; +assign ENA_ORCC = ({CART_SEL, MPI_CTS} == 3'b100) ? 1'b1: // Orchestra-90CC C000-DFFF Slot 1 + 1'b0; + +assign ENA_DISK2 = ({CART_SEL, MPI_CTS} == 3'b101) ? 1'b1: // Alternative Disk controller ROM up to 32K + 1'b0; + +assign ENA_PAK = ({CART_SEL, MPI_CTS} == 3'b110) ? 1'b1: // ROM SLOT 3 + 1'b0; + +assign ENA_DSK = ({CART_SEL, MPI_CTS} == 3'b111) ? 1'b1: // Disk C000-DFFF Slot 4 + 1'b0; +`ifdef CoCo3_sdc_fix_os9_driver +assign HDD_EN = ({ext_response, MPI_SCS, ADDRESS[15:5]} == 15'b01111111111010) ? 1'b1: // FF40-FF5F with MPI switch = 4 + 1'b0; + +assign SDC_EN_CS = (({MPI_SCS, ADDRESS[15:5]} == 13'b0111111111010) | + ((ADDRESS[15:5] == 11'b11111111010) & ext_response)) ? 1'b1: // FF40-FF5F with MPI switch = 2 + 1'b0; +`else +assign HDD_EN = ({MPI_SCS, ADDRESS[15:5]} == 13'b1111111111010) ? 1'b1: // FF40-FF5F with MPI switch = 4 + 1'b0; +assign SDC_EN_CS = ({MPI_SCS, ADDRESS[15:5]} == 13'b0111111111010) ? 1'b1: // FF40-FF5F with MPI switch = 2 + 1'b0; +`endif + +assign RS232_EN = ({MPI_SCS, ADDRESS[15:2]} == 16'b0011111111011010) ? 1'b1: //FF68-FF6B - Now in slot 1 + 1'b0; + +assign SLOT3_HW = ({SWITCH[2:1], ADDRESS[15:5]} == 13'b1011111111010) ? 1'b1: // FF40-FF5F Ensure this only appears in slot 3 PHYSICALLY + 1'b0; + +assign VDAC_EN = ({RW_N,ADDRESS[15:0]} == 17'H0FF7E) ? 1'b1: // FF7E + 1'b0; + +/* +$FF40 - This is the bank latch. The same latch that is used by the Super Program Paks to bank 16K of the Pak ROM +at a time. This latch is set to $00 on reset or power up (same as the super program paks). +*/ always @(negedge clk_sys or negedge RESET_N) begin @@ -872,55 +890,19 @@ begin end end -/* -$FF40 - This is the bank latch. The same latch that is used by the Super Program Paks to bank 16K of the Pak ROM -at a time. The initial design simply used 32K banks - this would allow the Super Program Paks to function, but -wastes 16K per Bank. This was done so the banks could house any of the 32K CoCo 3 Program PAKs as well. This latch -is set to $00 on reset or power up (same as the super program paks). - -$FF41 - the CTS* WRITE data latch. This was incorporated because the CTS* line is read only. I could have just -derived a new CTS* that is active on both reads and writes, however, some PAKs utilize a copy protection scheme -whereas they write to the PAK area. As long as the PAK was in ROM, nothing happened, but if trying to run from a -R/W* RAMPAK, or from disk (wheras the CoCo is placed in the allram mode and the PAK transferred there and executed), -then the PAK code would be corrupted and a crash would occur. This behavior could be patched out of the PAK but I -wanted to be able to execute the PAK code verbatim. Thus this latch at $FF41. A byte of data is written to $FF41. -It is latched and a flip-flop is triggered (this flip-flop starts up un-triggered - either at power on or reset). -Once the flip-flop is triggered, it indicates a valid byte has been stored at $FF41 and then any READ of the CTS* -area will WRITE the byte from $FF41 into the SRAM at the memory location that was READ, the flip-flop is also -reset by this action. This allows writing to the CTS* area while still providing the Read Only protection offered -by the CTS* signal. -$FF42 - BANK 0 latch - this was incorporated because Aaron wanted to be able to start up with his operating code in -bank $00, however, the super program PAKs must start at bank $00. So, whatever is written into this latch will -be the bank that is accessed as BANK 0. This is reset to $00 only at power on (Not reset). So, whatever is written -here will be the bank accessed as bank 00 from that point forward, until it is changed again. Reset will not change it. -$FF43 - Bank Size latch. Only two bits used.: - Bit 0 = 0 = 32K BANK SIZE, =1=16K Banks Size - Bit 1 = 0 = Use lower 16K of each 32K bank - Bit 1 = 1 = Use upper 16K of each 32K bank -Bit 1 is only effective if bank size is set to 16K by bit 0. This register is set to $00 at power on or reset, -and was added to reduce wasted memory. Under proper program control this allows two 16K or less program paks to -exist in each 32K bank. - -$FF44-$FF4A = bank 1 through bank 7 latches. The largest super program pak that I am aware of was RoboCop, -consuming 8 banks of 16K for 128K total. These work just like the latch at $FF42 EXCEPT they affect banks 1-7. -They are also set to $01-$07 (respectively) on power up (but not reset). This allows a Super Program Pak to reside -in any banks in any order, by simply writing the proper data into these latches. -*/ - -// If W_PROT[1] = 1 then ROM_RW is 0, else ROM_RW = !RW_N - `ifdef Config_Debug - wire Config_FLAG = `Config_Debug_FLAG; - wire Config_Debug_Value = `Config_Debug_Value; + wire [7:0] Config_FLAG = `Config_Debug_FLAG; + wire [7:0] Config_Debug_Value = `Config_Debug_Value; `endif + assign DATA_IN = (sdram_BE_0) ? hold_data_L[7:0]: (sdram_BE_1) ? hold_data_L[15:8]: FLASH_CE_S ? FLASH_DATA: + SDC_EN_CS ? DATA_SDC: // needs priority due to nitros9 llcocosdc ddriver bug HDD_EN ? DATA_HDD: - SDC_EN_CS ? DATA_SDC: RS232_EN ? DATA_RS232: SLOT3_HW ? {5'b00000, ROM_BANK}: // FF00, FF04, FF08, FF0C @@ -974,7 +956,7 @@ assign DATA_IN = // (ADDRESS == 16'hFF88) ? BUFF_DATA[7:0]: (ADDRESS == 16'hFF8E) ? GPIO_DIR: - (ADDRESS == 16'hFF8F) ? {GPIO[7:0]}: + (ADDRESS == 16'hFF8F) ? GPIO: (ADDRESS == 16'hFF90) ? {COCO1, MMU_EN, GIME_IRQ, GIME_FIRQ, VEC_PAG_RAM, ST_SCS, ROM}: (ADDRESS == 16'hFF91) ? {2'b00, TIMER_INS, 4'b0000, MMU_TR}: @@ -1074,8 +1056,8 @@ assign DATA_REG3 = !DDR3 ? DD_REG3: // A 0 in the DDR makes that pin an input assign BIT3 = !DD_REG4[3] ? 1'b0: - CSS; -assign DATA_REG4 = !DDR4 ? DD_REG4: + CSS; +assign DATA_REG4 = !DDR4 ? DD_REG4: {VDG_CONTROL, BIT3, KEY_COLUMN[6], SBS, 1'b1}; /******************************************************************************** * GPIO @@ -1169,10 +1151,13 @@ assign assigned_turbo_speed = (!(turbo_speed == 3'b000)) ? turbo_speed: wire cache_hit /* synthesis preserve */; assign cache_hit = (sdram_cpu_addr[24:1] == sdram_cpu_addr_L[24:1]); -//assign cache_hit = 1'b0; -//BANKS -// CPU clock / SRAM Signals for old SRAM + +// Master timing loop + +// This sig is only used for the cycle accurate 09 +reg cpu_cycle_ena; + always @(negedge clk_sys or negedge RESET_N) begin if(!RESET_N) @@ -1195,12 +1180,14 @@ begin GART_WR <= 1'b0; GART_RD <= 1'b0; AMW_WR <= 1'b0; + cpu_cycle_ena <= 1'b0; end else begin clear_data_ready <= 1'b0; sdram_BE_0 <= 1'b0; sdram_BE_1 <= 1'b0; + cpu_cycle_ena <= 1'b0; // This is only a single clock per cpu cycle // If we are in hold were done @ data_ready. if (hold) @@ -1210,6 +1197,7 @@ begin // Hold states are done - kill hold and set end hold to drive data hold <= 1'b0; end_hold <= 1'b1; + cpu_cycle_ena <= 1'b1; // Cycle at the end of a memory transaction clear_data_ready <= 1'b1; hold_data_L <= hold_data; sdram_BE_0 <= RAM0_BE0_L; @@ -1244,10 +1232,14 @@ begin begin cpu_ena <= 1'b1; + cpu_cycle_ena <= 1'b1; // Default cycle + if (AMW_EN) // Automated Memory Write ? begin AMW_WR <= 1'b1; cpu_ena <= 1'b0; // Kill cpu enable + cpu_cycle_ena <= 1'b0; // Kill (defer) cycle based on memory transaction + // Start AMW cycle RAM0_BE0_L <= !AMW_Adrs[0]; @@ -1260,6 +1252,9 @@ begin else if (VMA & RAM_CS) // FFE8 / FFE9 is now in RAM_CS begin // sdram memory cycle + `ifdef CoCo3_disable_GART_in_GIMEX + if (0); + `else if ((ADDRESS[15:0] == 16'hFFE8) | (ADDRESS[15:0] == 16'hFFE9)) // GART begin if (~RW_N) @@ -1275,11 +1270,14 @@ begin GART_RD <= 1'b1; end hold <= 1'b1; + cpu_cycle_ena <= 1'b0; // Kill (defer) cycle based on memory transaction sdram_cpu_req <= 1'b1; sdram_cpu_rnw <= RW_N; last_write <= 1'b1; // Kill cache hit on any access after GART end + `endif else // Normal CPU cycle + begin // get which byte RAM0_BE0_L <= !ADDRESS[0]; RAM0_BE1_L <= ADDRESS[0]; @@ -1289,11 +1287,13 @@ begin end_hold <= 1'b1; // If so then end the cpu_ena cycle with the updated byte enable sdram_BE_0 <= !ADDRESS[0]; sdram_BE_1 <= ADDRESS[0]; + // Allow cpu_cycke_ena previously set based upon cache tansaction end else begin sdram_cpu_addr_L <= sdram_cpu_addr; // Else set hold and start a sdram cycle hold <= 1'b1; + cpu_cycle_ena <= 1'b0; // Kill (defer) cycle based on memory transaction sdram_cpu_req <= 1'b1; sdram_cpu_rnw <= RW_N; last_write <= ~RW_N; @@ -1301,7 +1301,7 @@ begin end end end - + end 6'h01: begin PH_2_RAW <= 1'b0; @@ -1365,8 +1365,6 @@ assign RESET_P = !BUTTON_N[3] // Button | RESET; // CTRL-ALT-DEL or CTRL-ALT-INS // Make sure all resets are enabled for a long enough time to allow voltages to settle - - always @ (posedge clk_sys) begin if (RESET) @@ -1403,6 +1401,53 @@ begin end end +//////////////////////////////////////////////////////////////////// +// +// CPU Selection +// +//////////////////////////////////////////////////////////////////// + +`ifdef CoCo3_CYC_ACC_6809 + +// Create VMA out of AVMA +wire AVMA; + +always @(negedge clk_sys or negedge RESET_N) +begin + if(!RESET_N) + begin + VMA <= 1'b0; + end + else + begin + if (cpu_cycle_ena) + begin + VMA <= AVMA; + end + end +end + +// Cycle Accurate CPU section copyrighted by Greg Miller + +mc6809x GLBCPU09( + .D(DATA_IN), + .DOut(DATA_OUT), + .ADDR(ADDRESS), + .RnW(RW_N), + .MASTER(clk_sys), + .E(cpu_cycle_ena), + .Q(cpu_cycle_ena), + .nIRQ(CPU_IRQ_N), + .nFIRQ(CPU_FIRQ_N), + .nNMI(!NMI_09), + .AVMA(AVMA), + .nHALT(~HALT), + .nRESET(~CPU_RESET), + .nDMABREQ(1'b1) +); + +`else + // CPU section copyrighted by John Kent cpu09 GLBCPU09( .clk(clk_sys), @@ -1420,6 +1465,8 @@ cpu09 GLBCPU09( .nmi(NMI_09) ); +`endif + wire [8:0] BUFF_ADD_W; wire [8:0] BUFF_ADD; wire [15:0] BUFF_DATA_O; @@ -1474,26 +1521,28 @@ wire HALT_sdc, HALT_fdc; wire NMI_09_sdc, NMI_09_fdc; wire SDC_REG_W_ENA, SDC_REG_READ; +wire ext_response; -assign FF40_ENA = ({PH_2, RW_N, HDD_EN, ADDRESS[3:0]} == 7'B1010000) ? 1'b1: - 1'b0; +assign FF40_ENA = ({cpu_cycle_ena, RW_N, HDD_EN, ADDRESS[3:0]} == 7'B1010000) ? 1'b1: + 1'b0; -assign wd1793_data_read = (HDD_EN && ADDRESS[3]); +assign wd1793_data_read = (RW_N && HDD_EN && ADDRESS[3]); assign wd1793_read = (RW_N && HDD_EN && ADDRESS[3]); -assign wd1793_write = (~RW_N && HDD_EN && ADDRESS[3]); +assign wd1793_write = (cpu_cycle_ena && ~RW_N && HDD_EN && ADDRESS[3]); -assign sdc_FF40_ENA = ({PH_2, RW_N, SDC_EN_CS, ADDRESS[3:0]} == 7'B1010000) ? 1'b1: - 1'b0; +assign sdc_FF40_ENA = ({cpu_cycle_ena, RW_N, SDC_EN_CS, ADDRESS[3:0]} == 7'B1010000) ? 1'b1: + 1'b0; -assign sdc_wd1793_data_read = (SDC_EN_CS && ADDRESS[3]); + +assign sdc_wd1793_data_read = (RW_N && SDC_EN_CS && ADDRESS[3]); assign sdc_wd1793_read = (RW_N && SDC_EN_CS && ADDRESS[3]); assign sdc_wd1793_write = (~RW_N && SDC_EN_CS && ADDRESS[3]); -assign SDC_REG_W_ENA = ({PH_2, RW_N, SDC_EN_CS} == 3'B101) ? 1'b1: // This is for the FF40/4F SDC detect - 1'b0; -assign SDC_REG_READ = SDC_EN_CS & RW_N; // This is for the FF40/4F SDC detect +assign SDC_REG_W_ENA = ({RW_N, SDC_EN_CS} == 2'B01) ? 1'b1: // This is for the FF40/5F SDC detect + 1'b0; +assign SDC_REG_READ = SDC_EN_CS & RW_N; // This is for the FF40/5F SDC detect assign HALT = HALT_fdc | HALT_sdc; assign NMI_09 = NMI_09_fdc | NMI_09_sdc; @@ -1502,7 +1551,7 @@ assign NMI_09 = NMI_09_fdc | NMI_09_sdc; fdc coco_fdc( .CLK(clk_sys), // clock - .RESET_N(RESET_N), // async reset + .RESET_N(RESET_N), // async reset .ADDRESS(ADDRESS[3:0]), // i/o port addr for wd1793 & FF48+ .CLK_EN(PH_2), .DATA_IN(DATA_OUT), // data in @@ -1536,7 +1585,6 @@ fdc coco_fdc( .sd_buff_dout(sd_buff_dout), .sd_buff_din(sd_buff_din[0:3]), .sd_buff_wr(sd_buff_wr) - ); // Slot 2 sdc @@ -1545,7 +1593,11 @@ sdc_top coco_sdc_top( .CLK(clk_sys), // clock .RESET_N(RESET_N), // async reset .ADDRESS(ADDRESS[3:0]), // i/o port addr for wd1793 & FF48+ +`ifdef CoCo3_CYC_ACC_6809 + .CLK_EN(cpu_cycle_ena), +`else .CLK_EN(PH_2), +`endif .DATA_IN(DATA_OUT), // data in .DATA_HDD(DATA_SDC), // data out .HALT(HALT_sdc), // DMA request @@ -1565,6 +1617,8 @@ sdc_top coco_sdc_top( .SDC_REG_W_ENA(SDC_REG_W_ENA), .SDC_REG_READ(SDC_REG_READ), + .ext_response(ext_response), + // SD block level interface .img_mounted(img_mounted[5:4]), // signaling that new image has been mounted .img_readonly(img_readonly), // mounted as read only. valid only for active bit in img_mounted @@ -1616,7 +1670,7 @@ end //*********************************************************************** // Interrupt Sources //*********************************************************************** -// Interrupt source for CART signal +// Org FPGA code always @(negedge clk_sys or negedge RESET_N) begin if(!RESET_N) @@ -1630,26 +1684,21 @@ begin 2'b00: CART_INT_IN_N <= (!CART_INT_IN_N ) &(SER_IRQ); -// CART_INT_IN_N <= (!CART_INT_IN_N | SWITCH[4]) -// &(SER_IRQ); 2'b01: CART_INT_IN_N <= (SER_IRQ); 2'b10: CART_INT_IN_N <= (!CART_INT_IN_N | cart_firq_enable) &(SER_IRQ); -// CART_INT_IN_N <= (!CART_INT_IN_N | SWITCH[4]) -// &(SER_IRQ); 2'b11: CART_INT_IN_N <= (SER_IRQ); endcase end end -//assign HSYNC_INT_N = (H_SYNC_N | !H_FLAG); - +assign CART_INT_N = CART_INT_IN_N; `ifdef CoCo3_Horz_INT_FIX wire HBORDER_INT; - assign HSYNC_INT_N = HBORDER_INT; + assign HSYNC_INT_N = !HBORDER_INT; `else assign HSYNC_INT_N = H_SYNC_N; `endif @@ -1661,47 +1710,21 @@ end assign VSYNC_INT_N = V_SYNC_N; `endif - - -assign CART_INT_N = CART_INT_IN_N; assign KEY_INT_N = (KEYBOARD_IN == 8'hFF); //*********************************************************************** // Interrupt Latch RESETs //*********************************************************************** - -reg RST_FF93T_N; -reg RST_FF93H_N; -reg RST_FF93V_N; -reg RST_FF93C_N; -reg RST_FF93K_N; -reg RST_FF92V_N; -reg RST_FF92H_N; -reg RST_FF92C_N; -reg RST_FF92K_N; -reg RST_FF92T_N; - always @(negedge clk_sys or negedge RESET_N) begin if(!RESET_N) begin RST_FF00_N <= 1'b1; RST_FF02_N <= 1'b1; +// RST_FF20_N <= 1'b1; RST_FF22_N <= 1'b1; - RST_FF92_N <= 1'b1; - RST_FF92H_N <= 1'b1; - RST_FF92V_N <= 1'b1; - RST_FF92C_N <= 1'b1; - RST_FF92K_N <= 1'b1; - RST_FF92T_N <= 1'b1; - RST_FF93_N <= 1'b1; - RST_FF93T_N <= 1'b1; - RST_FF93H_N <= 1'b1; - RST_FF93V_N <= 1'b1; - RST_FF93C_N <= 1'b1; - RST_FF93K_N <= 1'b1; TMR_RST_N <= 1'b1; end else @@ -1709,30 +1732,53 @@ begin if (PH_2) case({RW_N,ADDRESS}) 17'h1FF00: - if (!HSYNC1_CLK_N) - RST_FF00_N <= 1'b0; + RST_FF00_N <= 1'b0; 17'h1FF04: - if (!HSYNC1_CLK_N) - RST_FF00_N <= 1'b0; + RST_FF00_N <= 1'b0; 17'h1FF08: - if (!HSYNC1_CLK_N) - RST_FF00_N <= 1'b0; + RST_FF00_N <= 1'b0; 17'h1FF0C: - if (!HSYNC1_CLK_N) - RST_FF00_N <= 1'b0; + RST_FF00_N <= 1'b0; + 17'h1FF10: + RST_FF00_N <= 1'b0; + 17'h1FF14: + RST_FF00_N <= 1'b0; + 17'h1FF18: + RST_FF00_N <= 1'b0; + 17'h1FF1C: + RST_FF00_N <= 1'b0; 17'h1FF02: - if (!VSYNC1_IRQ_N) - RST_FF02_N <= 1'b0; + RST_FF02_N <= 1'b0; 17'h1FF06: - if (!VSYNC1_IRQ_N) - RST_FF02_N <= 1'b0; + RST_FF02_N <= 1'b0; 17'h1FF0A: - if (!VSYNC1_IRQ_N) - RST_FF02_N <= 1'b0; + RST_FF02_N <= 1'b0; 17'h1FF0E: - if (!VSYNC1_IRQ_N) - RST_FF02_N <= 1'b0; - + RST_FF02_N <= 1'b0; + 17'h1FF12: + RST_FF02_N <= 1'b0; + 17'h1FF16: + RST_FF02_N <= 1'b0; + 17'h1FF1A: + RST_FF02_N <= 1'b0; + 17'h1FF1E: + RST_FF02_N <= 1'b0; +/* 17'h1FF20: + RST_FF20_N <= 1'b0; + 17'h1FF24: + RST_FF20_N <= 1'b0; + 17'h1FF28: + RST_FF20_N <= 1'b0; + 17'h1FF2C: + RST_FF20_N <= 1'b0; + 17'h1FF30: + RST_FF20_N <= 1'b0; + 17'h1FF34: + RST_FF20_N <= 1'b0; + 17'h1FF38: + RST_FF20_N <= 1'b0; + 17'h1FF3C: + RST_FF20_N <= 1'b0; */ 17'h1FF22: RST_FF22_N <= 1'b0; 17'h1FF26: @@ -1741,7 +1787,14 @@ begin RST_FF22_N <= 1'b0; 17'h1FF2E: RST_FF22_N <= 1'b0; - + 17'h1FF32: + RST_FF22_N <= 1'b0; + 17'h1FF36: + RST_FF22_N <= 1'b0; + 17'h1FF3A: + RST_FF22_N <= 1'b0; + 17'h1FF3E: + RST_FF22_N <= 1'b0; 17'h0FF22: RST_FF22_N <= 1'b0; 17'h0FF26: @@ -1750,36 +1803,18 @@ begin RST_FF22_N <= 1'b0; 17'h0FF2E: RST_FF22_N <= 1'b0; - + 17'h0FF32: + RST_FF22_N <= 1'b0; + 17'h0FF36: + RST_FF22_N <= 1'b0; + 17'h0FF3A: + RST_FF22_N <= 1'b0; + 17'h0FF3E: + RST_FF22_N <= 1'b0; 17'h1FF92: - begin RST_FF92_N <= 1'b0; - if (!VSYNC_INT_N) - RST_FF92V_N <= 1'b0; - if (!HSYNC_INT_N) - RST_FF92H_N <= 1'b0; - if (!CART_INT_N) - RST_FF92C_N <= 1'b0; - if (!KEY_INT_N) - RST_FF92K_N <= 1'b0; - if (!TIMER_INT_N) - RST_FF92T_N <= 1'b0; - end - 17'h1FF93: - begin RST_FF93_N <= 1'b0; - if (!TIMER3_FIRQ_N) - RST_FF93T_N <= 1'b0; - if (!HSYNC_INT_N) - RST_FF93H_N <= 1'b0; - if (!VSYNC_INT_N) - RST_FF93V_N <= 1'b0; - if (!CART_INT_N) - RST_FF93C_N <= 1'b0; - if (!KEY_INT_N) - RST_FF93K_N <= 1'b0; - end 17'h0FF94: TMR_RST_N <= 1'b0; 17'h0FF95: @@ -1788,19 +1823,10 @@ begin begin RST_FF00_N <= 1'b1; RST_FF02_N <= 1'b1; +// RST_FF20_N <= 1'b1; RST_FF22_N <= 1'b1; RST_FF92_N <= 1'b1; - RST_FF92H_N <= 1'b1; - RST_FF92V_N <= 1'b1; - RST_FF92C_N <= 1'b1; - RST_FF92K_N <= 1'b1; - RST_FF92T_N <= 1'b1; RST_FF93_N <= 1'b1; - RST_FF93T_N <= 1'b1; - RST_FF93H_N <= 1'b1; - RST_FF93V_N <= 1'b1; - RST_FF93C_N <= 1'b1; - RST_FF93K_N <= 1'b1; TMR_RST_N <= 1'b1; end endcase @@ -1986,9 +2012,9 @@ begin end end -always @ (negedge clk_sys or negedge RST_FF93H_N) +always @ (negedge clk_sys or negedge RST_FF93_N) begin - if(!RST_FF93H_N) + if(!RST_FF93_N) begin HSYNC3_FIRQ_STAT_N <= 1'b1; // no int end @@ -2026,9 +2052,9 @@ begin end end -always @ (negedge clk_sys or negedge RST_FF93V_N) +always @ (negedge clk_sys or negedge RST_FF93_N) begin - if(!RST_FF93V_N) + if(!RST_FF93_N) begin VSYNC3_FIRQ_STAT_N <= 1'b1; // no int end @@ -2066,9 +2092,9 @@ begin end end -always @ (negedge clk_sys or negedge RST_FF93C_N) +always @ (negedge clk_sys or negedge RST_FF93_N) begin - if(!RST_FF93C_N) + if(!RST_FF93_N) begin CART3_FIRQ_STAT_N <= 1'b1; // no int end @@ -2106,9 +2132,9 @@ begin end end -always @ (negedge clk_sys or negedge RST_FF93K_N) +always @ (negedge clk_sys or negedge RST_FF93_N) begin - if(!RST_FF93K_N) + if(!RST_FF93_N) begin KEY3_FIRQ_STAT_N <= 1'b1; // no int end @@ -2146,9 +2172,9 @@ begin end end -always @ (negedge clk_sys or negedge RST_FF93T_N) +always @ (negedge clk_sys or negedge RST_FF93_N) begin - if(!RST_FF93T_N) + if(!RST_FF93_N) begin TIMER3_FIRQ_STAT_N <= 1'b1; // no int end @@ -2187,9 +2213,9 @@ begin end end -always @ (negedge clk_sys or negedge RST_FF92H_N) +always @ (negedge clk_sys or negedge RST_FF92_N) begin - if(!RST_FF92H_N) + if(!RST_FF92_N) begin HSYNC3_IRQ_STAT_N <= 1'b1; // no int end @@ -2225,9 +2251,9 @@ begin end end -always @ (negedge clk_sys or negedge RST_FF92V_N) +always @ (negedge clk_sys or negedge RST_FF92_N) begin - if(!RST_FF92V_N) + if(!RST_FF92_N) begin VSYNC3_IRQ_STAT_N <= 1'b1; // no int end @@ -2339,9 +2365,9 @@ begin end end -always @ (negedge clk_sys or negedge RST_FF92T_N) +always @ (negedge clk_sys or negedge RST_FF92_N) begin - if(!RST_FF92T_N) + if(!RST_FF92_N) begin TIMER3_IRQ_STAT_N <= 1'b1; // no int end @@ -2352,6 +2378,7 @@ begin end end + assign CPU_IRQ_N = ( GIME_IRQ | (HSYNC1_IRQ_N & VSYNC1_IRQ_N)) & (!GIME_IRQ | (TIMER3_IRQ_N & HSYNC3_IRQ_N & VSYNC3_IRQ_N & KEY3_IRQ_N & CART3_IRQ_N)); assign CPU_FIRQ_N = ( GIME_FIRQ | (CART1_FIRQ_N)) @@ -2941,7 +2968,9 @@ begin 16'hFF8E: GPIO_DIR <= DATA_OUT; 16'hFF8F: + begin GPIO_OUT <= DATA_OUT; + end 16'hFF90: begin ROM <= DATA_OUT[1:0]; @@ -3484,28 +3513,28 @@ begin dac_joya2[7:0] <= 8'd128; if (joy1[0]) // right - dac_joya1[15:8] <= 8'd240; + dac_joya1[15:8] <= 8'd255; if (joy1[1]) // left - dac_joya1[15:8] <= 8'd16; + dac_joya1[15:8] <= 8'd0; if (joy1[2]) // down - dac_joya1[7:0] <= 8'd240; + dac_joya1[7:0] <= 8'd255; if (joy1[3]) // up - dac_joya1[7:0] <= 8'd16; + dac_joya1[7:0] <= 8'd0; if (joy2[0]) // right - dac_joya2[15:8] <= 8'd240; + dac_joya2[15:8] <= 8'd255; if (joy2[1]) // left - dac_joya2[15:8] <= 8'd16; + dac_joya2[15:8] <= 8'd0; if (joy2[2]) // down - dac_joya2[7:0] <= 8'd240; + dac_joya2[7:0] <= 8'd255; if (joy2[3]) // upimg_mounted - dac_joya2[7:0] <= 8'd16; + dac_joya2[7:0] <= 8'd0; end else begin @@ -3721,7 +3750,6 @@ end * Video ******************************************************************************/ -// SRH DE2-115 DAC lower video bits = '0000' amd transfomation RGB[7:4] ,= RGB[3:0] assign PIX_CLK = CLK_14; wire PIX_CLK_D; @@ -4012,10 +4040,6 @@ COCO3VIDEO MISTER_COCOVID( .HBORDER(HBORDER), .VBORDER(VBORDER) - -//HBORDER_INT, -//VBORDER_INT - ); @@ -4137,8 +4161,6 @@ coco3_Char_ROM coco3_Char_ROM( reg [4:0] CLK_6551; -// 14.31818 -// 50 MHz / 27 = 1.852 MHz // Targeting 1.8432 Mhz. // 57.272727 Mhz / 31 = 1.8475 Mhz reg CLK_6551_EN; diff --git a/rtl/config.v b/rtl/config.v index 655cdca..bef6eda 100644 --- a/rtl/config.v +++ b/rtl/config.v @@ -61,65 +61,22 @@ // This file is a configuration definition file. The CoCo3FPGA for MiSTer source files // can be built into multiple objects which have mutually exclusive features. -// The debug value holds upto 8 feature settings [1 per bit] - when Config_Debug is set this appears at FFF1 -`define Config_Debug -`define Config_Debug_Value (`config_value_1 + `config_value_2 + `config_value_3 + `config_value_4 + `config_value_5 + `config_value_6 + `config_value_7 + `config_value_8) -`define Config_Debug_FLAG 8'h55 -// Feature list - note the support area below needs editing for debug support... +`include "..\RTL\config_inc.v" + +// If defined the Config_Debug sets the FEATURE MASKS all OR'd together which appears on COCO space at FFF1 & (FFF0 = 0x55 as a debug flag) +//`define Config_Debug + +// Feature list - note only FEATURE_1 - FEATURE_8 are supported /////////////////////////////////////////////////////////////////////////////////////////////////////////// -`define CoCo3_Horz_INT_FIX 8'h01 // Connection of the horz int to the Mister CoCo3 V5 rasterizer +`set_feature(CoCo3_Horz_INT_FIX, FEATURE_1) // Connection of the horz int to the Mister CoCo3 V5 rasterizer -`define CoCo3_Vert_INT_FIX 8'h02 // Connection of the vert int to the Mister CoCo3 V5 rasterizer +//`set_feature(CoCo3_Vert_INT_FIX, FEATURE_2) // Connection of the vert int to the Mister CoCo3 V5 rasterizer +`set_feature(CoCo3_CYC_ACC_6809, FEATURE_3) // Use cycle accurate 6809 +`set_feature(CoCo3_sdc_override_size, FEATURE_4) // Define static size value -/////////////////////////////////////////////////////////////////////////////////////////////////////////// -// This is support info to create the Config_Debug_Value referenced above -`ifdef CoCo3_Horz_INT_FIX - `define config_value_1 `CoCo3_Horz_INT_FIX -`else - `define config_value_1 8'h00 -`endif +`set_feature(CoCo3_sdc_fix_os9_driver, FEATURE_5) // fix sdc query disk size issue in llcocosdc driver in multipak enviroment -`ifdef CoCo3_Vert_INT_FIX - `define config_value_2 `CoCo3_Vert_INT_FIX -`else - `define config_value_2 8'h00 -`endif - -`ifdef NOT_DEFINED_YET - `define config_value_3 `NOT_DEFINED_YET -`else - `define config_value_3 8'h00 -`endif - -`ifdef NOT_DEFINED_YET - `define config_value_4 `NOT_DEFINED_YET -`else - `define config_value_4 8'h00 -`endif - -`ifdef NOT_DEFINED_YET - `define config_value_5 `NOT_DEFINED_YET -`else - `define config_value_5 8'h00 -`endif - -`ifdef NOT_DEFINED_YET - `define config_value_6 `NOT_DEFINED_YET -`else - `define config_value_6 8'h00 -`endif - -`ifdef NOT_DEFINED_YET - `define config_value_7 `NOT_DEFINED_YET -`else - `define config_value_7 8'h00 -`endif - -`ifdef NOT_DEFINED_YET - `define config_value_8 `NOT_DEFINED_YET -`else - `define config_value_8 8'h00 -`endif +`set_feature(CoCo3_disable_GART_in_GIMEX, FEATURE_6)// Disable GIMEX ram transfers [GIMEX detection in OS( EOU] diff --git a/rtl/config_inc.v b/rtl/config_inc.v new file mode 100644 index 0000000..3daf7f6 --- /dev/null +++ b/rtl/config_inc.v @@ -0,0 +1,123 @@ +//////////////////////////////////////////////////////////////////////////////// +// Project Name: CoCo3FPGA Version 5.x.x +// File Name: config_inc.v +// +// CoCo3 in an FPGA +// +//////////////////////////////////////////////////////////////////////////////// +// +// CPU section copyrighted by John Kent +// +//////////////////////////////////////////////////////////////////////////////// +// +// Color Computer 3 compatible system on a chip +// +// Version : 5.x +// +// Copyright (c) 2008 Gary Becker (gary_l_becker@yahoo.com) +// +// All rights reserved +// +// Redistribution and use in source and synthezised forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// Redistributions in synthesized form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// Neither the name of the author nor the names of other contributors may +// be used to endorse or promote products derived from this software without +// specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// +// Please report bugs to the author, but before you do so, please +// make sure that this is not a derivative work and that +// you have the latest version of this file. +// +//////////////////////////////////////////////////////////////////////////////// +// Gary Becker +// gary_L_becker@yahoo.com +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +// MISTer Conversion by Stan Hodge and Alan Steremberg (& Gary Becker) +// stan.pda@gmail.com +// +//////////////////////////////////////////////////////////////////////////////// + +// This file is a configuration definition include file. The CoCo3FPGA for MiSTer source files +// can be built into multiple objects which have mutually exclusive features. + +`define Config_Debug_Value (`config_num_1 | `config_num_2 | `config_num_3 | `config_num_4 | `config_num_5 | `config_num_6 | `config_num_7 | `config_num_8) +`define Config_Debug_FLAG 8'h55 +`define FEATURE_1 8'h01 +`define FEATURE_2 8'h02 +`define FEATURE_3 8'h04 +`define FEATURE_4 8'h08 +`define FEATURE_5 8'h10 +`define FEATURE_6 8'h20 +`define FEATURE_7 8'h40 +`define FEATURE_8 8'h80 +`define config_num_1 8'h00 +`define config_num_2 8'h00 +`define config_num_3 8'h00 +`define config_num_4 8'h00 +`define config_num_5 8'h00 +`define config_num_6 8'h00 +`define config_num_7 8'h00 +`define config_num_8 8'h00 + +`define set_feature(Feat_Name, Feat_Mask) \ +`define Feat_Name \ +`ifndef config_value_1 \ + `define config_value_1 Feat_Mask \ + `define config_num_1 Feat_Mask \ +`else \ + `ifndef config_value_2 \ + `define config_value_2 Feat_Mask \ + `define config_num_2 Feat_Mask \ + `else \ + `ifndef config_value_3 \ + `define config_value_3 Feat_Mask \ + `define config_num_3 Feat_Mask \ + `else \ + `ifndef config_value_4 \ + `define config_value_4 Feat_Mask \ + `define config_num_4 Feat_Mask \ + `else \ + `ifndef config_value_5 \ + `define config_value_5 Feat_Mask \ + `define config_num_5 Feat_Mask \ + `else \ + `ifndef config_value_6 \ + `define config_value_6 Feat_Mask \ + `define config_num_6 Feat_Mask \ + `else \ + `ifndef config_value_7 \ + `define config_value_7 Feat_Mask \ + `define config_num_7 Feat_Mask \ + `else \ + `ifndef config_value_8 \ + `define config_value_8 Feat_Mask \ + `define config_num_8 Feat_Mask \ + `endif \ + `endif \ + `endif \ + `endif \ + `endif \ + `endif \ + `endif \ +`endif diff --git a/rtl/fdc.sv b/rtl/fdc.sv index 5d16a28..4a9b8a0 100644 --- a/rtl/fdc.sv +++ b/rtl/fdc.sv @@ -44,6 +44,8 @@ // make sure that this is not a derivative work and that // you have the latest version of this file. // +// Ver 2.0 Reduced 1793 instances +// //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// @@ -88,7 +90,6 @@ module fdc( input [7:0] sd_buff_dout, output [7:0] sd_buff_din[4], input sd_buff_wr - ); wire [7:0] DRIVE_SEL_EXT; @@ -128,19 +129,12 @@ assign DATA_HDD = (FF40_RD) ? FF40_READ_VALUE: (WD1793_RD) ? DATA_1793: //(1793[s]) 8'h00; - - - // $ff40 control register [part 1] wire [3:0] DRIVE_SEL_EXT_PRE = {DATA_IN[6], DATA_IN[2:0]}; reg [2:0] drive_index; // SD blk system is a array of 4 systems - one for each drive. -// To keep disk track memory, we created 4 wd1793's to match the sd block interfaces -// For the interface back to the coco - we need to isolate the wd1793 the computer is talking -// to and route those feedback signals back to the coco. This is accomplished via the drive -// select. 'drive_index' identifies which controller is addressd. always @(negedge FF40_CLK or negedge RESET_N) @@ -151,39 +145,40 @@ begin MOTOR <= 1'b0; WRT_PREC <= 1'b0; DENSITY <= 1'b0; - drive_index <= 3'd0; + drive_index <= 3'd0; // no drive (illegal) end else begin if (FF40_ENA) begin DRIVE_SEL_EXT <= {4'b0000, - DATA_IN[6], // Drive Select [3] / Side Select - DATA_IN[2:0]}; // Drive Select [2:0] - MOTOR <= DATA_IN[3]; // Turn on motor, not used here just checked, 0=MotorOff 1=MotorOn - WRT_PREC <= DATA_IN[4]; // Write Precompensation, not used here - DENSITY <= DATA_IN[5]; // Density, not used here just checked + DRIVE_SEL_EXT_PRE}; + MOTOR <= DATA_IN[3]; // Turn on motor, not used here just checked, 0=MotorOff 1=MotorOn + WRT_PREC <= DATA_IN[4]; // Write Precompensation, not used here + DENSITY <= DATA_IN[5]; // Density, not used here just checked case(DRIVE_SEL_EXT_PRE) 4'b1000: - drive_index <= 3'd3; + drive_index <= 3'd4; 4'b0100: - drive_index <= 3'd2; + drive_index <= 3'd3; 4'b0010: - drive_index <= 3'd1; - - 4'b0001: - drive_index <= 3'd0; - - 4'b1100: drive_index <= 3'd2; - 4'b1010: + 4'b0001: drive_index <= 3'd1; + 4'b1100: + drive_index <= 3'd3; + + 4'b1010: + drive_index <= 3'd2; + 4'b1001: - drive_index <= 3'd0; + drive_index <= 3'd1; + default: + drive_index <= 3'd0; // Illegal endcase end end @@ -213,13 +208,12 @@ wire DRQ[4]; wire selected_DRQ; wire selected_INTRQ; -wire WR[4]; -wire RD[4]; -wire RD_E[4]; +wire WR; +wire RD; +wire RD_E; //wire CE; wire HALT_EN_RST; wire [7:0] DATA_1793; -wire [7:0] dout[4]; reg read; reg write; reg read_d; @@ -231,10 +225,7 @@ reg read1; reg write1; reg [1:0] ADDRESS_L; -assign RD[0] = (read || RD_E[0]) && (drive_index == 3'd0); -assign RD[1] = (read || RD_E[1]) && (drive_index == 3'd1); -assign RD[2] = (read || RD_E[2]) && (drive_index == 3'd2); -assign RD[3] = (read || RD_E[3]) && (drive_index == 3'd3); +assign RD = read || RD_E; // The idea here is to "stretch" the CPU read and write signals to ensure we catch a 8 mhz enable. // For writes we will buffer the data out to ensure it does not go away. @@ -253,14 +244,8 @@ begin write_d <= 1'b0; r_w_active <= 1'b0; clk_8Mhz_enable_found <= 1'b0; - WR[0] <= 1'b0; - WR[1] <= 1'b0; - WR[2] <= 1'b0; - WR[3] <= 1'b0; - RD_E[0] <= 1'b0; - RD_E[1] <= 1'b0; - RD_E[2] <= 1'b0; - RD_E[3] <= 1'b0; + WR <= 1'b0; + RD_E <= 1'b0; read1 <= 1'b0; write1 <= 1'b0; read <= 1'b0; @@ -280,7 +265,8 @@ begin read_d <= read; write_d <= write; - if ((read1 & ~read) | (write1 & ~write)) +// if ((read1 & ~read) | (write1 & ~write)) + if ((read1 & ~read) | WD1793_WR_CTRL) begin // Latch Address & Data ADDRESS_L <= ADDRESS[1:0]; @@ -292,32 +278,14 @@ begin begin // Set Writes r_w_active <= 1'b1; - case (drive_index) - 3'd0: - WR[0] <= 1'b1; - 3'd1: - WR[1] <= 1'b1; - 3'd2: - WR[2] <= 1'b1; - 3'd3: - WR[3] <= 1'b1; - endcase + WR <= 1'b1; end // Synchronus rising edge of read if ((read == 1'b1) && (read_d == 1'b0)) begin r_w_active <= 1'b1; - case (drive_index) - 3'd0: - RD_E[0] <= 1'b1; - 3'd1: - RD_E[1] <= 1'b1; - 3'd2: - RD_E[2] <= 1'b1; - 3'd3: - RD_E[3] <= 1'b1; - endcase + RD_E <= 1'b1; end // Clears @@ -330,48 +298,55 @@ begin clk_8Mhz_enable_found <= 1'b0; r_w_active <= 1'b0; - WR[0] <= 1'b0; - WR[1] <= 1'b0; - WR[2] <= 1'b0; - WR[3] <= 1'b0; + WR <= 1'b0; - RD_E[0] <= 1'b0; - RD_E[1] <= 1'b0; - RD_E[2] <= 1'b0; - RD_E[3] <= 1'b0; + RD_E <= 1'b0; end end end -// NMI from disk controller -// Selected INTRQ -assign selected_INTRQ = (drive_index == 3'd0) ? INTRQ[0]: - (drive_index == 3'd1) ? INTRQ[1]: - (drive_index == 3'd2) ? INTRQ[2]: - (drive_index == 3'd3) ? INTRQ[3]: - 1'b0; assign NMI_09 = DENSITY & selected_INTRQ; // Send NMI if Double Density (Halt Mode) -// HALT from disk controller -// Selected DRQ -assign selected_DRQ = (drive_index == 3'd0) ? DRQ[0]: - (drive_index == 3'd1) ? DRQ[1]: - (drive_index == 3'd2) ? DRQ[2]: - (drive_index == 3'd3) ? DRQ[3]: - 1'b1; - assign HALT = (HALT_EN & ~selected_DRQ); assign HALT_EN_RST = RESET_N & ~selected_INTRQ; // From controller schematic -// Data bus selection -assign DATA_1793 = (drive_index == 3'd0) ? dout[0]: - (drive_index == 3'd1) ? dout[1]: - (drive_index == 3'd2) ? dout[2]: - (drive_index == 3'd3) ? dout[3]: - 8'd0; +assign sd_lba[0] = wd1793_sd_lba; +assign sd_lba[1] = wd1793_sd_lba; +assign sd_lba[2] = wd1793_sd_lba; +assign sd_lba[3] = wd1793_sd_lba; + +assign sd_rd[0] = (drive_index == 3'd1) ? wd1793_sd_rd: + 1'b0; +assign sd_rd[1] = (drive_index == 3'd2) ? wd1793_sd_rd: + 1'b0; +assign sd_rd[2] = (drive_index == 3'd3) ? wd1793_sd_rd: + 1'b0; +assign sd_rd[3] = (drive_index == 3'd4) ? wd1793_sd_rd: + 1'b0; + +assign sd_wr[0] = (drive_index == 3'd1) ? wd1793_sd_wr: + 1'b0; +assign sd_wr[1] = (drive_index == 3'd2) ? wd1793_sd_wr: + 1'b0; +assign sd_wr[2] = (drive_index == 3'd3) ? wd1793_sd_wr: + 1'b0; +assign sd_wr[3] = (drive_index == 3'd4) ? wd1793_sd_wr: + 1'b0; + +assign wd1793_sd_ack = (drive_index == 3'd1) ? sd_ack[0]: + (drive_index == 3'd2) ? sd_ack[1]: + (drive_index == 3'd3) ? sd_ack[2]: + (drive_index == 3'd4) ? sd_ack[3]: + sd_ack[0]; // default is drive 1 + +assign sd_buff_din[0] = wd1793_sd_buff_din; +assign sd_buff_din[1] = wd1793_sd_buff_din; +assign sd_buff_din[2] = wd1793_sd_buff_din; +assign sd_buff_din[3] = wd1793_sd_buff_din; + // The SD_BLK interface and thus the wd1793 will allways transfer 1 blk. This is blk qty - 1 per spec. assign sd_blk_cnt[3] = 6'd0; @@ -379,9 +354,18 @@ assign sd_blk_cnt[2] = 6'd0; assign sd_blk_cnt[1] = 6'd0; assign sd_blk_cnt[0] = 6'd0; -reg drive_wp[4]; -reg [3:0] drive_ready = 4'B0; -reg [3:0] double_sided = 4'B0; +reg drive_wp[4]; +reg [3:0] drive_ready = 4'B0000; +reg [3:0] double_sided = 4'B0000; +reg [23:0] drive_size[4]; +wire [23:0] selected_drive_size; +wire [31:0] wd1793_sd_lba; +wire wd1793_sd_rd; +wire wd1793_sd_wr; +wire wd1793_sd_ack; +wire [7:0] wd1793_sd_buff_din; +wire selected_drive_ready, selected_drive_wp, selected_double_sided; + // As drives are mounted in MISTer this logic saves the write protect and generates ready for // changing drives to the wd1793. @@ -395,6 +379,7 @@ always @(negedge img_mounted[0]) begin drive_wp[0] <= img_readonly; drive_ready[0] <= 1'b1; + drive_size[0] <= {4'h0, img_size[19:0]}; //Size / 256 on [19:8] double_sided[0]<= (img_size > 64'd368600) & (img_size < 64'd740000);//20'd368640; end @@ -404,6 +389,7 @@ always @(negedge img_mounted[1]) begin drive_wp[1] <= img_readonly; drive_ready[1] <= 1'b1; + drive_size[1] <= {4'h0, img_size[19:0]}; //Size / 256 on [19:8] double_sided[1]<= (img_size > 64'd368600) & (img_size < 64'd740000);//20'd368640; end @@ -413,6 +399,7 @@ always @(negedge img_mounted[2]) begin drive_wp[2] <= img_readonly; drive_ready[2] <= 1'b1; + drive_size[2] <= {4'h0, img_size[19:0]}; //Size / 256 on [19:8] double_sided[2]<= (img_size > 64'd368600) & (img_size < 64'd740000);//20'd368640; end @@ -422,168 +409,69 @@ always @(negedge img_mounted[3]) begin drive_wp[3] <= img_readonly; drive_ready[3] <= 1'b1; + drive_size[3] <= {4'h0, img_size[19:0]}; //Size / 256 on [19:8] //double_sided[3]<= img_size > 20'd368600;//20'd368640; end +assign selected_drive_size = (drive_index == 3'd1) ? drive_size[0]: + (drive_index == 3'd2) ? drive_size[1]: + (drive_index == 3'd3) ? drive_size[2]: + (drive_index == 3'd4) ? drive_size[3]: + drive_size[0]; // default is drive 1 -wd1793 #(1,1) coco_wd1793_0 +assign selected_drive_wp = (drive_index == 3'd1) ? drive_wp[0]: + (drive_index == 3'd2) ? drive_wp[1]: + (drive_index == 3'd3) ? drive_wp[2]: + (drive_index == 3'd4) ? drive_wp[3]: + drive_wp[0]; // default is drive 1 + +assign selected_double_sided= (drive_index == 3'd1) ? double_sided[0]: + (drive_index == 3'd2) ? double_sided[1]: + (drive_index == 3'd3) ? double_sided[2]: + double_sided[0]; // default is drive 1 + +assign selected_drive_ready = (drive_index == 3'd1) ? drive_ready[0]: + (drive_index == 3'd2) ? drive_ready[1]: + (drive_index == 3'd3) ? drive_ready[2]: + (drive_index == 3'd4) ? drive_ready[3]: + 1'b0; // default is not ready + +wd1793 #(1,0) coco_wd1793_0 ( .clk_sys(~CLK), .ce(ena_8Mhz), .reset(~RESET_N), .io_en(1'b1), - .rd(RD[0]), - .wr(WR[0]), + .rd(RD), + .wr(WR), .addr(ADDRESS_L[1:0]), .din(DATA_IN_L), - .dout(dout[0]), - .drq(DRQ[0]), - .intrq(INTRQ[0]), + .dout(DATA_1793), + .drq(selected_DRQ), + .intrq(selected_INTRQ), - .img_mounted(img_mounted[0]), - .img_size(img_size), + .img_mounted(1'b0), + .img_mounted_overide(1'b1), + .img_size(selected_drive_size[19:0]), - .sd_lba(sd_lba[0]), - .sd_rd(sd_rd[0]), - .sd_wr(sd_wr[0]), - .sd_ack(sd_ack[0]), + .sd_lba(wd1793_sd_lba), + .sd_rd(wd1793_sd_rd), + .sd_wr(wd1793_sd_wr), + .sd_ack(wd1793_sd_ack), .sd_buff_addr(sd_buff_addr), .sd_buff_dout(sd_buff_dout), - .sd_buff_din(sd_buff_din[0]), + .sd_buff_din(wd1793_sd_buff_din), .sd_buff_wr(sd_buff_wr), - .wp(drive_wp[0]), + .wp(selected_drive_wp), - .size_code(3'd5), // 5 is 18 sector x 256 bits COCO standard - .layout(~double_sided[0]), // 0 = Track-Side-Sector, 1 - Side-Track-Sector - .side(double_sided[0] & DRIVE_SEL_EXT[3]), - .ready(drive_ready[0]), + .size_code(3'd5), // 5 is 18 sector x 256 bits COCO standard + .layout(~selected_double_sided), // 0 = Track-Side-Sector, 1 - Side-Track-Sector + .side(selected_double_sided & DRIVE_SEL_EXT[3]), + .ready(selected_drive_ready), - .input_active(0), - .input_addr(0), - .input_data(0), - .input_wr(0), - .buff_din(0) -); - -wd1793 #(1,0) coco_wd1793_1 -( - .clk_sys(~CLK), - .ce(ena_8Mhz), - .reset(~RESET_N), - .io_en(1'b1), - .rd(RD[1]), - .wr(WR[1]), - .addr(ADDRESS_L[1:0]), - .din(DATA_IN_L), - .dout(dout[1]), - .drq(DRQ[1]), - .intrq(INTRQ[1]), - - .img_mounted(img_mounted[1]), - .img_size(img_size), - - .sd_lba(sd_lba[1]), - .sd_rd(sd_rd[1]), - .sd_wr(sd_wr[1]), - .sd_ack(sd_ack[1]), - - .sd_buff_addr(sd_buff_addr), - .sd_buff_dout(sd_buff_dout), - .sd_buff_din(sd_buff_din[1]), - .sd_buff_wr(sd_buff_wr), - - .wp(drive_wp[1]), - - .size_code(3'd5), // 5 is 18 sector x 256 bits COCO standard - .layout(~double_sided[1]), // 0 = Track-Side-Sector, 1 - Side-Track-Sector - .side(double_sided[1] & DRIVE_SEL_EXT[3]), - .ready(drive_ready[1]), - - .input_active(0), - .input_addr(0), - .input_data(0), - .input_wr(0), - .buff_din(0) -); - -wd1793 #(1,0) coco_wd1793_2 -( - .clk_sys(~CLK), - .ce(ena_8Mhz), - .reset(~RESET_N), - .io_en(1'b1), - .rd(RD[2]), - .wr(WR[2]), - .addr(ADDRESS_L[1:0]), - .din(DATA_IN_L), - .dout(dout[2]), - .drq(DRQ[2]), - .intrq(INTRQ[2]), - - .img_mounted(img_mounted[2]), - .img_size(img_size), - - .sd_lba(sd_lba[2]), - .sd_rd(sd_rd[2]), - .sd_wr(sd_wr[2]), - .sd_ack(sd_ack[2]), - - .sd_buff_addr(sd_buff_addr), - .sd_buff_dout(sd_buff_dout), - .sd_buff_din(sd_buff_din[2]), - .sd_buff_wr(sd_buff_wr), - - .wp(drive_wp[2]), - - .size_code(3'd5), // 5 is 18 sector x 256 bits COCO standard - .layout(~double_sided[2]), // 0 = Track-Side-Sector, 1 - Side-Track-Sector - .side(double_sided[2] & DRIVE_SEL_EXT[3]), - .ready(drive_ready[2]), - - .input_active(0), - .input_addr(0), - .input_data(0), - .input_wr(0), - .buff_din(0) -); - -wd1793 #(1,0) coco_wd1793_3 -( - .clk_sys(~CLK), - .ce(ena_8Mhz), - .reset(~RESET_N), - .io_en(1'b1), - .rd(RD[3]), - .wr(WR[3]), - .addr(ADDRESS_L[1:0]), - .din(DATA_IN_L), - .dout(dout[3]), - .drq(DRQ[3]), - .intrq(INTRQ[3]), - - .img_mounted(img_mounted[3]), - .img_size(img_size), - - .sd_lba(sd_lba[3]), - .sd_rd(sd_rd[3]), - .sd_wr(sd_wr[3]), - .sd_ack(sd_ack[3]), - - .sd_buff_addr(sd_buff_addr), - .sd_buff_dout(sd_buff_dout), - .sd_buff_din(sd_buff_din[3]), - .sd_buff_wr(sd_buff_wr), - - .wp(drive_wp[3]), - - .size_code(3'd5), // 5 is 18 sector x 256 bits COCO standard - .layout(1'b1), // 0 = Track-Side-Sector, 1 - Side-Track-Sector - .side(1'b0), // DS can not be supported for drive 3. - .ready(drive_ready[3]), - - .input_active(0), + .input_active(0), // Section not used .input_addr(0), .input_data(0), .input_wr(0), diff --git a/rtl/mc6809glb/mc6809glb.v b/rtl/mc6809glb/mc6809glb.v new file mode 100644 index 0000000..9627ab4 --- /dev/null +++ b/rtl/mc6809glb/mc6809glb.v @@ -0,0 +1,4156 @@ +`timescale 1ns / 1ns +////////////////////////////////////////////////////////////////////////////////// +// Company: +// Engineer: Greg Miller +// Copyright (c) 2016, Greg Miller +// +// Create Date: 14:26:59 08/13/2016 +// Design Name: +// Module Name: mc6809 +// Project Name: Cycle-Accurate 6809 Core +// Target Devices: +// Tool versions: +// Description: +// +// Dependencies: Intended to be standalone Vanilla Verilog. +// +// Revision: +// Revision 1.0 - Initial Release +// Additional Comments: +// +////////////////////////////////////////////////////////////////////////////////// + + +// +// The 6809 has incomplete instruction decoding. A collection of instructions, if met, end up actually behaving like +// a binary-adjacent neighbor. +// +// The soft core permits three different behaviors for this situation, controlled by the instantiation parameter +// ILLEGAL_INSTRUCTIONS +// +// "GHOST" - Mimic the 6809's incomplete decoding. This is as similar to a hard 6809 as is practical. [DEFAULT] +// +// "STOP" - Cause the soft core to cease execution, placing $DEAD on the address bus and R/W to 'read'. Interrupts, +// bus control (/HALT, /DMABREQ), etc. are ignored. The core intentionally seizes in this instance. +// (Frankly, this is useful when making changes to the core and you have a logic analyzer connected.) +// +// "IGNORE"- Cause the soft core to merely ignore illegal instructions. It will consider them 1-byte instructions and +// attempt to fetch and run an exception 1 byte later. +// + +module mc6809x +#( + parameter ILLEGAL_INSTRUCTIONS="GHOST" +) +( + + input [7:0] D, + output [7:0] DOut, + output [15:0] ADDR, + output RnW, + input MASTER, + input E, + input Q, + output BS, + output BA, + input nIRQ, + input nFIRQ, + input nNMI, + output AVMA, + output BUSY, + output LIC, + input nHALT, + input nRESET, + input nDMABREQ, + output [111:0] RegData +); + +reg [7:0] DOutput; + +assign DOut = DOutput; + +reg RnWOut; // Combinatorial + +reg rLIC; +assign LIC = rLIC; + +reg rAVMA; +assign AVMA = rAVMA; + +reg rBUSY; +assign BUSY = rBUSY; + +// Bus control +// BS BA +// 0 0 normal (CPU running, CPU is master) +// 0 1 Interrupt Ack +// 1 0 Sync Ack +// 1 1 CPU has gone high-Z on A, D, R/W +// + +assign RnW = RnWOut; + + +///////////////////////////////////////////////// +// Vectors +`define RESET_VECTOR 16'HFFFE +`define NMI_VECTOR 16'HFFFC +`define SWI_VECTOR 16'HFFFA +`define IRQ_VECTOR 16'HFFF8 +`define FIRQ_VECTOR 16'HFFF6 +`define SWI2_VECTOR 16'HFFF4 +`define SWI3_VECTOR 16'HFFF2 +`define Reserved_VECTOR 16'HFFF0 + +////////////////////////////////////////////////////// +// Latched registers +// + +// The last-latched copy. +reg [7:0] a; +reg [7:0] b; +reg [15:0] x; +reg [15:0] y; +reg [15:0] u; +reg [15:0] s; +reg [15:0] pc; +reg [7:0] dp; +reg [7:0] cc; +reg [15:0] tmp; +reg [15:0] addr; +reg [15:0] ea; + + +// Debug ability to export register contents +assign RegData[7:0] = a; +assign RegData[15:8] = b; +assign RegData[31:16] = x; +assign RegData[47:32] = y; +assign RegData[63:48] = s; +assign RegData[79:64] = u; +assign RegData[87:80] = cc; +assign RegData[95:88] = dp; +assign RegData[111:96] = pc; + + + +// The values as being calculated +reg [7:0] a_nxt; +reg [7:0] b_nxt; +reg [15:0] x_nxt; +reg [15:0] y_nxt; +reg [15:0] u_nxt; +reg [15:0] s_nxt; +reg [15:0] pc_nxt; +reg [7:0] dp_nxt; +reg [7:0] cc_nxt; +reg [15:0] addr_nxt; +reg [15:0] ea_nxt; +reg [15:0] tmp_nxt; + +reg BS_nxt; +reg BA_nxt; + +// for ADDR, BS/BA, assign them to the flops +assign BS = BS_nxt; +assign BA = BA_nxt; +assign ADDR=addr_nxt; + +localparam CC_E= 8'H80; +localparam CC_F= 8'H40; +localparam CC_H= 8'H20; +localparam CC_I= 8'H10; +localparam CC_N= 8'H08; +localparam CC_Z= 8'H04; +localparam CC_V= 8'H02; +localparam CC_C= 8'H01; + +localparam CC_E_BIT= 3'd7; +localparam CC_F_BIT= 3'd6; +localparam CC_H_BIT= 3'd5; +localparam CC_I_BIT= 3'd4; +localparam CC_N_BIT= 3'd3; +localparam CC_Z_BIT= 3'd2; +localparam CC_V_BIT= 3'd1; +localparam CC_C_BIT= 3'd0; + +// Convenience calculations +reg [15:0] pc_p1; +reg [15:0] pc_p2; +reg [15:0] pc_p3; +reg [15:0] s_p1; +reg [15:0] s_m1; +reg [15:0] u_p1; +reg [15:0] u_m1; +reg [15:0] addr_p1; +reg [15:0] ea_p1; + +////////////////////////////////////////////////////// +// NMI Mask +// +// NMI is supposed to be masked - despite the name - until the 6809 loads a value into S. +// Frankly, I'm cheating slightly. If someone does a LDS #$0, it won't disable the mask. Pretty much anything else +// that changes the value of S from the default (which is currently $0) will clear the mask. A reset will set the mask again. +reg NMIMask; + +reg NMILatched; +reg NMISample; +reg NMISample2; +reg NMIClear; +reg NMIClear_nxt; +wire wNMIClear = NMIClear; + +reg IRQLatched; + +reg IRQSample; +reg IRQSample2; +reg FIRQLatched; +reg FIRQSample; +reg FIRQSample2; +reg HALTLatched; +reg HALTSample; +reg HALTSample2; +reg DMABREQLatched; +reg DMABREQSample; +reg DMABREQSample2; + +// Interrupt types +localparam INTTYPE_NMI = 3'H0 ; +localparam INTTYPE_IRQ = 3'H1 ; +localparam INTTYPE_FIRQ = 3'H2 ; +localparam INTTYPE_SWI = 3'H3 ; +localparam INTTYPE_SWI2 = 3'H4 ; +localparam INTTYPE_SWI3 = 3'H5 ; + +reg [2:0] IntType; +reg [2:0] IntType_nxt; + +////////////////////////////////////////////////////// +// Instruction Fetch Details +// +reg InstPage2; +reg InstPage3; +reg InstPage2_nxt; +reg InstPage3_nxt; + +reg [7:0] Inst1; +reg [7:0] Inst2; +reg [7:0] Inst3; +reg [7:0] Inst1_nxt; +reg [7:0] Inst2_nxt; +reg [7:0] Inst3_nxt; + + +localparam CPUSTATE_RESET = 7'd0; +localparam CPUSTATE_RESET0 = 7'd1; + +localparam CPUSTATE_RESET2 = 7'd3; +localparam CPUSTATE_FETCH_I1 = 7'd4; +localparam CPUSTATE_FETCH_I1V2 = 7'd5; +localparam CPUSTATE_FETCH_I2 = 7'd8; + +localparam CPUSTATE_LBRA_OFFSETLOW = 7'd17; +localparam CPUSTATE_LBRA_DONTCARE = 7'd18; +localparam CPUSTATE_LBRA_DONTCARE2 = 7'd19; + + + +localparam CPUSTATE_BRA_DONTCARE = 7'd20; + +localparam CPUSTATE_BSR_DONTCARE1 = 7'd21; +localparam CPUSTATE_BSR_DONTCARE2 = 7'd22; +localparam CPUSTATE_BSR_RETURNLOW = 7'd23; +localparam CPUSTATE_BSR_RETURNHIGH = 7'd24; + +localparam CPUSTATE_TFR_DONTCARE1 = 7'd26; +localparam CPUSTATE_TFR_DONTCARE2 = 7'd27; +localparam CPUSTATE_TFR_DONTCARE3 = 7'd28; +localparam CPUSTATE_TFR_DONTCARE4 = 7'd29; + +localparam CPUSTATE_EXG_DONTCARE1 = 7'd30; +localparam CPUSTATE_EXG_DONTCARE2 = 7'd31; +localparam CPUSTATE_EXG_DONTCARE3 = 7'd32; +localparam CPUSTATE_EXG_DONTCARE4 = 7'd33; +localparam CPUSTATE_EXG_DONTCARE5 = 7'd34; +localparam CPUSTATE_EXG_DONTCARE6 = 7'd35; + +localparam CPUSTATE_ABX_DONTCARE = 7'd36; + +localparam CPUSTATE_RTS_HI = 7'd38; +localparam CPUSTATE_RTS_LO = 7'd39; +localparam CPUSTATE_RTS_DONTCARE2 = 7'd40; + +localparam CPUSTATE_16IMM_LO = 7'd41; +localparam CPUSTATE_ALU16_DONTCARE = 7'd42; +localparam CPUSTATE_DIRECT_DONTCARE = 7'd43; + +localparam CPUSTATE_ALU_EA = 7'd44; + +localparam CPUSTATE_ALU_DONTCARE = 7'd46; +localparam CPUSTATE_ALU_WRITEBACK = 7'd47; + +localparam CPUSTATE_LD16_LO = 7'd48; + +localparam CPUSTATE_ST16_LO = 7'd49; +localparam CPUSTATE_ALU16_LO = 7'd50; + + + + +localparam CPUSTATE_JSR_DONTCARE = 7'd53; +localparam CPUSTATE_JSR_RETLO = 7'd54; +localparam CPUSTATE_JSR_RETHI = 7'd55; +localparam CPUSTATE_EXTENDED_ADDRLO = 7'd56; +localparam CPUSTATE_EXTENDED_DONTCARE = 7'd57; +localparam CPUSTATE_INDEXED_BASE = 7'd58; + + +localparam CPUSTATE_IDX_DONTCARE3 = 7'd60; + +localparam CPUSTATE_IDX_OFFSET_LO = 7'd61; +localparam CPUSTATE_IDX_16OFFSET_LO = 7'd62; + +localparam CPUSTATE_IDX_16OFF_DONTCARE0= 7'd63; +localparam CPUSTATE_IDX_16OFF_DONTCARE1= 7'd64; +localparam CPUSTATE_IDX_16OFF_DONTCARE2= 7'd65; +localparam CPUSTATE_IDX_16OFF_DONTCARE3= 7'd66; + +localparam CPUSTATE_IDX_DOFF_DONTCARE1 = 7'd68; +localparam CPUSTATE_IDX_DOFF_DONTCARE2 = 7'd69; +localparam CPUSTATE_IDX_DOFF_DONTCARE3 = 7'd70; +localparam CPUSTATE_IDX_PC16OFF_DONTCARE = 7'd71; + +localparam CPUSTATE_IDX_EXTIND_LO = 7'd72; +localparam CPUSTATE_IDX_EXTIND_DONTCARE = 7'd73; + +localparam CPUSTATE_INDIRECT_HI = 7'd74; +localparam CPUSTATE_INDIRECT_LO = 7'd75; +localparam CPUSTATE_INDIRECT_DONTCARE = 7'd76; +localparam CPUSTATE_MUL_ACTION = 7'd77; + +localparam CPUSTATE_PSH_DONTCARE1 = 7'd80; +localparam CPUSTATE_PSH_DONTCARE2 = 7'd81; +localparam CPUSTATE_PSH_DONTCARE3 = 7'd82; +localparam CPUSTATE_PSH_ACTION = 7'd83; + +localparam CPUSTATE_PUL_DONTCARE1 = 7'd84; +localparam CPUSTATE_PUL_DONTCARE2 = 7'd85; +localparam CPUSTATE_PUL_ACTION = 7'd86; + +localparam CPUSTATE_NMI_START = 7'd87; +localparam CPUSTATE_IRQ_DONTCARE = 7'd88; +localparam CPUSTATE_IRQ_START = 7'd89; +localparam CPUSTATE_IRQ_DONTCARE2 = 7'd90; +localparam CPUSTATE_IRQ_VECTOR_HI = 7'd91; +localparam CPUSTATE_IRQ_VECTOR_LO = 7'd92; +localparam CPUSTATE_FIRQ_START = 7'd93; +localparam CPUSTATE_CC_DONTCARE = 7'd94; +localparam CPUSTATE_SWI_START = 7'd95; + +localparam CPUSTATE_TST_DONTCARE1 = 7'd96; +localparam CPUSTATE_TST_DONTCARE2 = 7'd97; + +localparam CPUSTATE_DEBUG = 7'd98; + +localparam CPUSTATE_16IMM_DONTCARE = 7'd99; + +localparam CPUSTATE_HALTED = 7'd100; + +localparam CPUSTATE_HALT_EXIT2 = 7'd102; +localparam CPUSTATE_STOP = 7'd105; +localparam CPUSTATE_STOP2 = 7'd106; +localparam CPUSTATE_STOP3 = 7'd107; + + +localparam CPUSTATE_CWAI = 7'd108; +localparam CPUSTATE_CWAI_DONTCARE1 = 7'd109; +localparam CPUSTATE_CWAI_POST = 7'd110; + +localparam CPUSTATE_DMABREQ = 7'd111; +localparam CPUSTATE_DMABREQ_EXIT = 7'd112; +localparam CPUSTATE_SYNC = 7'd113; +localparam CPUSTATE_SYNC_EXIT = 7'd114; + +localparam CPUSTATE_INT_DONTCARE = 7'd115; + + +reg [6:0] CpuState = CPUSTATE_RESET; +reg [6:0] CpuState_nxt = CPUSTATE_RESET; + +reg [6:0] NextState = CPUSTATE_RESET; +reg [6:0] NextState_nxt = CPUSTATE_RESET; + +wire [6:0] PostIllegalState; + +// If we encounter something like an illegal addressing mode (an index mode that's illegal for instance) +// What state should we go to? +generate +if (ILLEGAL_INSTRUCTIONS=="STOP") +begin : postillegal + assign PostIllegalState = CPUSTATE_STOP; +end +else +begin + assign PostIllegalState = CPUSTATE_FETCH_I1; +end +endgenerate + + + +/////////////////////////////////////////////////////////////////////// + +// +// MapInstruction - Considering how the core was instantiated, this +// will either directly return D[7:0] *or* remap values from D[7:0] +// that relate to undefined instructions in the 6809 to the instructions +// that the 6809 actually executed when these were encountered, due to +// incomplete decoding. +// +// NEG, COM, LSR, DEC - these four instructions, in Direct, Inherent (A or B) +// Indexed, or Extended addressing do not actually decode bit 0 on the instruction. +// Thus, for instance, a $51 encountered will be executed as a $50, which is a NEGB. +// + +// Specifically, the input is an instruction; if it matches an unknown instruction that the +// 6809 is known to ghost to another instruction, the output of the function +// is the the instruction that actually gets executed. Otherwise, the output is the +// input. + +function [7:0] MapInstruction(input [7:0] i); +reg [3:0] topnyb; +reg [3:0] btmnyb; +reg [7:0] newinst; +begin + newinst = i; + + topnyb = i[7:4]; + btmnyb = i[3:0]; + + if ( (topnyb == 4'H0) || + (topnyb == 4'H4) || + (topnyb == 4'H5) || + (topnyb == 4'H6) || + (topnyb == 4'H7) + ) + begin + if (btmnyb == 4'H1) + newinst = {topnyb, 4'H0}; + if (btmnyb == 4'H2) + newinst = {topnyb, 4'H3}; + if (btmnyb == 4'H5) + newinst = {topnyb, 4'H4}; + if (btmnyb == 4'HB) + newinst = {topnyb, 4'HA}; + end + MapInstruction = newinst; +end +endfunction + + +wire [7:0] MappedInstruction; +generate +if (ILLEGAL_INSTRUCTIONS=="GHOST") +begin : ghost + assign MappedInstruction = MapInstruction(D); +end +else +begin + assign MappedInstruction = D; +end +endgenerate + + + +/////////////////////////////////////////////////////////////////////// + +function IllegalInstruction(input [7:0] i); +reg [3:0] hi; +reg [3:0] lo; +reg illegal; +begin + illegal = 1'b0; + hi = i[7:4]; + lo = i[3:0]; + if ( (hi == 4'H0) || (hi == 4'H4) || (hi == 4'H5) || (hi == 4'H6) || (hi == 4'H7) ) + begin + if ( (lo == 4'H1) || (lo == 4'H2) || (lo == 4'H5) || (lo == 4'HB) ) + illegal = 1'b1; + if (lo == 4'HE) + if ( (hi == 4'H4) || (hi == 4'H5) ) + illegal = 1'b1; + end + if (hi == 4'H3) + begin + if ( (lo == 4'H8) || (lo == 4'HE) ) + illegal = 1'b1; + end + if (hi == 4'H1) + begin + if ( (lo == 4'H4) || (lo == 4'H5) || (lo == 4'H8) || (lo == 4'HB) ) + illegal = 1'b1; + end + if ( (hi == 4'H8) || (hi == 4'HC) ) + begin + if ( (lo == 4'H7) || (lo == 4'HF) ) + illegal = 1'b1; + if ( lo == 4'HD ) + if (hi == 4'HC) + illegal = 1'b1; + end + IllegalInstruction = illegal; +end +endfunction + +wire IsIllegalInstruction; + +generate +if (ILLEGAL_INSTRUCTIONS=="GHOST") +begin : never_illegal + assign IsIllegalInstruction = 1'b0; +end +else +begin + assign IsIllegalInstruction = IllegalInstruction(Inst1); +end +endgenerate + +wire [6:0] IllegalInstructionState; +generate +if (ILLEGAL_INSTRUCTIONS=="IGNORE") +begin : illegal_state + assign IllegalInstructionState = CPUSTATE_FETCH_I1; +end +else if (ILLEGAL_INSTRUCTIONS=="STOP") +begin + assign IllegalInstructionState = CPUSTATE_STOP; +end +else +begin + assign IllegalInstructionState = 7'd0; +end +endgenerate + + +/////////////////////////////////////////////////////////////////////// + + +always @(negedge NMISample2 or posedge wNMIClear) +begin + if (wNMIClear == 1) + NMILatched <= 1; + else if (NMIMask == 0) + NMILatched <= 0; + else + NMILatched <= 1; +end + +// +// The 6809 specs say that the CPU control signals are sampled on the falling edge of Q. +// It also says that the interrupts require 1 cycle of synchronization time. +// That's vague, as it doesn't say where "1 cycle" starts or ends. Starting from the +// falling edge of Q, the next cycle notices an assertion. From checking a hard 6809 on +// an analyzer, what they really mean is that it's sampled on the falling edge of Q, +// but there's a one cycle delay from the falling edge of E (0.25 clocks from the falling edge of Q +// where the signals were sampled) before it can be noticed. +// So, SIGNALSample is the latched value at the falling edge of Q +// SIGNALSample2 is the latched value at the falling edge of E (0.25 clocks after the line above) +// SIGNALLatched is the latched value at the falling edge of E (1 cycle after the line above) +// +// /HALT and /DMABREQ are delayed one cycle less than interrupts. The 6809 specs infer these details, +// but don't list the point-of-reference they're written from (for instance, they say that an interrupt requires +// a cycle for synchronization; however, it isn't clear whether that's from the falling Q to the next falling Q, +// a complete intermediate cycle, the falling E to the next falling E, etc.) - which, in the end, required an +// analyzer on the 6809 to determine how many cycles before a new instruction an interrupt (or /HALT & /DMABREQ) +// had to be asserted to be noted instead of the next instruction running start to finish. +// +always @(negedge MASTER) +begin + if (Q) + begin + NMISample <= nNMI; + + IRQSample <= nIRQ; + + FIRQSample <= nFIRQ; + + HALTSample <= nHALT; + + DMABREQSample <= nDMABREQ; + end +end + +reg rnRESET=0; // The latched version of /RESET, useful 1 clock after it's latched +always @(negedge MASTER) +begin + if (E) + begin + rnRESET <= nRESET; + + NMISample2 <= NMISample; + + IRQSample2 <= IRQSample; + + IRQLatched <= IRQSample2; + + FIRQSample2 <= FIRQSample; + FIRQLatched <= FIRQSample2; + + HALTSample2 <= HALTSample; + HALTLatched <= HALTSample2; + + DMABREQSample2 <= DMABREQSample; + DMABREQLatched <= DMABREQSample2; + + + if (rnRESET == 1) + begin + CpuState <= CpuState_nxt; + + // Don't interpret this next item as "The Next State"; it's a special case 'after this + // generic state, go to this programmable state', so that a single state + // can be shared for many tasks. [Specifically, the stack push/pull code, which is used + // for PSH, PUL, Interrupts, RTI, etc. + NextState <= NextState_nxt; + + // CPU registers latch from the combinatorial circuit + a <= a_nxt; + b <= b_nxt; + x <= x_nxt; + y <= y_nxt; + s <= s_nxt; + u <= u_nxt; + cc <= cc_nxt; + dp <= dp_nxt; + pc <= pc_nxt; + tmp <= tmp_nxt; + addr <= addr_nxt; + ea <= ea_nxt; + + InstPage2 <= InstPage2_nxt; + InstPage3 <= InstPage3_nxt; + Inst1 <= Inst1_nxt; + Inst2 <= Inst2_nxt; + Inst3 <= Inst3_nxt; + NMIClear <= NMIClear_nxt; + + IntType <= IntType_nxt; + + if (s != s_nxt) // Once S changes at all (default is '0'), release the NMI Mask. + NMIMask <= 1'b0; + end + else + begin + CpuState <= CPUSTATE_RESET; + NMIMask <= 1'b1; // Mask NMI until S is loaded. + NMIClear <= 1'b0; // Mark us as not having serviced NMI + end + end +end + + +///////////////////////////////////////////////////////////////// +// Decode the Index byte + +localparam IDX_REG_X = 3'd0; +localparam IDX_REG_Y = 3'd1; +localparam IDX_REG_U = 3'd2; +localparam IDX_REG_S = 3'd3; +localparam IDX_REG_PC = 3'd4; + +localparam IDX_MODE_POSTINC1 = 4'd0; +localparam IDX_MODE_POSTINC2 = 4'd1; +localparam IDX_MODE_PREDEC1 = 4'd2; +localparam IDX_MODE_PREDEC2 = 4'd3; +localparam IDX_MODE_NOOFFSET = 4'd4; +localparam IDX_MODE_B_OFFSET = 4'd5; +localparam IDX_MODE_A_OFFSET = 4'd6; +localparam IDX_MODE_5BIT_OFFSET= 4'd7; // Special case, not bit pattern 7; the offset sits in the bit pattern +localparam IDX_MODE_8BIT_OFFSET= 4'd8; +localparam IDX_MODE_16BIT_OFFSET = 4'd9; +localparam IDX_MODE_D_OFFSET = 4'd11; +localparam IDX_MODE_8BIT_OFFSET_PC = 4'd12; +localparam IDX_MODE_16BIT_OFFSET_PC= 4'd13; +localparam IDX_MODE_EXTENDED_INDIRECT = 4'd15; + +// Return: +// Register base [3 bits] +// Indirect [1 bit] +// Mode [4 bits] + +function [7:0] IndexDecode(input [7:0] postbyte); +reg [2:0] regnum; +reg indirect; +reg [3:0] mode; +begin + indirect = 0; + mode = 0; + + if (postbyte[7] == 0) // 5-bit + begin + mode = IDX_MODE_5BIT_OFFSET; + end + else + begin + mode = postbyte[3:0]; + indirect = postbyte[4]; + end + if ((mode != IDX_MODE_8BIT_OFFSET_PC) && (mode != IDX_MODE_16BIT_OFFSET_PC)) + regnum[2:0] = postbyte[6:5]; + else + regnum[2:0] = IDX_REG_PC; + + IndexDecode = {indirect, mode, regnum}; +end +endfunction + +wire [3:0] IndexedMode; +wire IndexedIndirect; +wire [2:0] IndexedRegister; + +assign {IndexedIndirect, IndexedMode, IndexedRegister} = IndexDecode(Inst2); + +///////////////////////////////////////////////////////////////// +// Is this a JMP instruction? (irrespective of addressing mode) +function IsJMP(input [7:0] inst); +reg [3:0] hi; +reg [3:0] lo; +begin + hi = inst[7:4]; + lo = inst[3:0]; + + IsJMP = 0; + if ((hi == 4'H0) || (hi == 4'H6) || (hi == 4'H7)) + if (lo == 4'HE) + IsJMP = 1; +end +endfunction + +/////////////////////////////////////////////////////////////////// +// Is this an 8-bit Store? + +localparam ST8_REG_A = 1'b0; +localparam ST8_REG_B = 1'b1; + +function [1:0] IsST8(input [7:0] inst); +reg regnum; +reg IsStore; +begin + + IsStore = 1'b0; + regnum = 1'b1; + + if ( (Inst1 == 8'H97) || (Inst1 == 8'HA7) || (Inst1 == 8'HB7) ) + begin + IsStore = 1'b1; + regnum = 1'b0; + end + else if ( (Inst1 == 8'HD7) || (Inst1 == 8'HE7) || (Inst1 == 8'HF7) ) + begin + IsStore = 1'b1; + regnum = 1'b1; + end + IsST8 = {IsStore, regnum}; +end +endfunction + +wire IsStore8; +wire Store8RegisterNum; + +assign {IsStore8, Store8RegisterNum} = IsST8(Inst1); + + +///////////////////////////////////////////////////////////////// +// Is this a 16-bit Store? + +localparam ST16_REG_X = 3'd0; +localparam ST16_REG_Y = 3'd1; +localparam ST16_REG_U = 3'd2; +localparam ST16_REG_S = 3'd3; +localparam ST16_REG_D = 3'd4; + + +function [3:0] IsST16(input [7:0] inst); +reg [3:0] hi; +reg [3:0] lo; +reg [2:0] regnum; +reg IsStore; +begin + hi = inst[7:4]; + lo = inst[3:0]; + IsStore = 1'b0; + regnum = 3'b111; + + if ((inst == 8'H9F) || (inst == 8'HAF) || (inst == 8'HBF)) + begin + IsStore = 1; + if (~InstPage2) + regnum = ST16_REG_X; + else + regnum = ST16_REG_Y; + end + else if ((inst == 8'HDF) || (inst == 8'HEF) || (inst == 8'HFF)) + begin + IsStore = 1; + if (~InstPage2) + regnum = ST16_REG_U; + else + regnum = ST16_REG_S; + end + else if ((inst == 8'HDD) || (inst == 8'HED) || (inst == 8'HFD)) + begin + IsStore = 1; + regnum = ST16_REG_D; + end + + IsST16 = {IsStore, regnum}; +end +endfunction + +wire IsStore16; +wire [2:0] StoreRegisterNum; + +assign {IsStore16, StoreRegisterNum} = IsST16(Inst1); + +///////////////////////////////////////////////////////////////// +// Is this a special Immediate mode instruction, ala +// PSH, PUL, EXG, TFR, ANDCC, ORCC +function IsSpecialImm(input [7:0] inst); +reg is; +reg [3:0] hi; +reg [3:0] lo; +begin + hi = inst[7:4]; + lo = inst[3:0]; + is = 0; + + if (hi == 4'H1) + begin + if ( (lo == 4'HA) || (lo == 4'HC) || (lo == 4'HE) || (lo == 4'HF) ) // ORCC, ANDCC, EXG, TFR + is = 1; + end + else if (hi == 4'H3) + begin + if ( (lo >= 4'H3) && (lo <= 4'H7) ) // PSHS, PULS, PSHU, PULU + is = 1; + end + else + is = 0; + + IsSpecialImm = is; +end +endfunction +wire IsSpecialImmediate = IsSpecialImm(Inst1); + +///////////////////////////////////////////////////////////////// +// Is this a one-byte instruction? [The 6809 reads 2 bytes for every instruction, minimum (it can read more). On a one-byte, we have to ensure that we haven't skipped the PC ahead. +function IsOneByteInstruction(input [7:0] inst); +reg is; +reg [3:0] hi; +reg [3:0] lo; +begin + hi = inst[7:4]; + lo = inst[3:0]; + is = 1'b0; + + if ( (hi == 4'H4) || (hi == 4'H5) ) + is = 1'b1; + else if ( hi == 4'H1) + begin + if ( (lo == 4'H2) || (lo == 4'H3) || (lo == 4'H9) || (lo == 4'HD) ) + is = 1'b1; + end + else if (hi == 4'H3) + begin + if ( (lo >= 4'H9) && (lo != 4'HC) ) + is = 1'b1; + end + else + is = 1'b0; + + IsOneByteInstruction = is; +end +endfunction + +///////////////////////////////////////////////////////////////// +// ALU16 - Simpler than the 8 bit ALU + +localparam ALU16_REG_X = 3'd0; +localparam ALU16_REG_Y = 3'd1; +localparam ALU16_REG_U = 3'd2; +localparam ALU16_REG_S = 3'd3; +localparam ALU16_REG_D = 3'd4; + +function [2:0] ALU16RegFromInst(input Page2, input Page3, input [7:0] inst); +reg [2:0] srcreg; +begin + srcreg = 3'b111; // default + casex ({Page2, Page3, inst}) // Note pattern for the matching below + 10'b1010xx0011: // 1083, 1093, 10A3, 10B3 CMPD + srcreg = ALU16_REG_D; + 10'b1010xx1100: // 108C, 109C, 10AC, 10BC CMPY + srcreg = ALU16_REG_Y; + 10'b0110xx0011: // 1183, 1193, 11A3, 11B3 CMPU + srcreg = ALU16_REG_U; + 10'b0110xx1100: // 118C, 119C, 11AC, 11BC CMPS + srcreg = ALU16_REG_S; + 10'b0010xx1100: // 8C,9C,AC,BC CMPX + srcreg = ALU16_REG_X; + + 10'b0011xx0011: // C3, D3, E3, F3 ADDD + srcreg = ALU16_REG_D; + + 10'b0011xx1100: // CC, DC, EC, FC LDD + srcreg = ALU16_REG_D; + 10'b0010xx1110: // 8E LDX, 9E LDX, AE LDX, BE LDX + srcreg = ALU16_REG_X; + 10'b0011xx1110: // CE LDU, DE LDU, EE LDU, FE LDU + srcreg = ALU16_REG_U; + 10'b1010xx1110: // 108E LDY, 109E LDY, 10AE LDY, 10BE LDY + srcreg = ALU16_REG_Y; + 10'b1011xx1110: // 10CE LDS, 10DE LDS, 10EE LDS, 10FE LDS + srcreg = ALU16_REG_S; + 10'b0010xx0011: // 83, 93, A3, B3 SUBD + srcreg = ALU16_REG_D; + + 10'H03A: // 3A ABX + srcreg = ALU16_REG_X; + 10'H030: // 30 LEAX + srcreg = ALU16_REG_X; + 10'H031: // 31 LEAY + srcreg = ALU16_REG_Y; + 10'H032: // 32 LEAS + srcreg = ALU16_REG_S; + 10'H033: // 32 LEAU + srcreg = ALU16_REG_U; + default: + srcreg = 3'b111; + endcase + ALU16RegFromInst = srcreg; +end +endfunction + +wire [2:0] ALU16Reg = ALU16RegFromInst(InstPage2, InstPage3, Inst1); + +localparam ALUOP16_SUB = 3'H0; +localparam ALUOP16_ADD = 3'H1; +localparam ALUOP16_LD = 3'H2; +localparam ALUOP16_CMP = 3'H3; +localparam ALUOP16_LEA = 3'H4; +localparam ALUOP16_INVALID = 3'H7; + +function [3:0] ALU16OpFromInst(input Page2, input Page3, input [7:0] inst); +reg [2:0] aluop; +reg writeback; +begin + aluop = 3'b111; + writeback = 1'b1; + casex ({Page2, Page3, inst}) + 10'b1010xx0011: // 1083, 1093, 10A3, 10B3 CMPD + begin + aluop = ALUOP16_CMP; + writeback = 1'b0; + end + 10'b1010xx1100: // 108C, 109C, 10AC, 10BC CMPY + begin + aluop = ALUOP16_CMP; + writeback = 1'b0; + end + 10'b0110xx0011: // 1183, 1193, 11A3, 11B3 CMPU + begin + aluop = ALUOP16_CMP; + writeback = 1'b0; + end + 10'b0110xx1100: // 118C, 119C, 11AC, 11BC CMPS + begin + aluop = ALUOP16_CMP; + writeback = 1'b0; + end + 10'b0010xx1100: // 8C,9C,AC,BC CMPX + begin + aluop = ALUOP16_CMP; + writeback = 1'b0; + end + + 10'b0011xx0011: // C3, D3, E3, F3 ADDD + aluop = ALUOP16_ADD; + + 10'b0011xx1100: // CC, DC, EC, FC LDD + aluop = ALUOP16_LD; + 10'b001xxx1110: // 8E LDX, 9E LDX, AE LDX, BE LDX, CE LDU, DE LDU, EE LDU, FE LDU + aluop = ALUOP16_LD; + 10'b101xxx1110: // 108E LDY, 109E LDY, 10AE LDY, 10BE LDY, 10CE LDS, 10DE LDS, 10EE LDS, 10FE LDS + aluop = ALUOP16_LD; + + 10'b0010xx0011: // 83, 93, A3, B3 SUBD + aluop = ALUOP16_SUB; + + 10'H03A: // 3A ABX + aluop = ALUOP16_ADD; + + 10'b00001100xx: // $30-$33, LEAX, LEAY, LEAS, LEAU + aluop = ALUOP16_LEA; + + default: + aluop = ALUOP16_INVALID; + endcase + ALU16OpFromInst = {writeback, aluop}; +end +endfunction + +wire ALU16OpWriteback; +wire [2:0] ALU16Opcode; + +assign {ALU16OpWriteback, ALU16Opcode} = ALU16OpFromInst(InstPage2, InstPage3, Inst1); + +wire IsALU16Opcode = (ALU16Opcode != 3'b111); + +function [23:0] ALU16Inst(input [2:0] operation16, input [15:0] a_arg, input [15:0] b_arg, input [7:0] cc_arg); +reg [7:0] cc_out; +reg [15:0] ALUFn; +reg carry; +reg borrow; +begin + cc_out = cc_arg; + case (operation16) + ALUOP16_ADD: + begin + {cc_out[CC_C_BIT], ALUFn} = {1'b0, a_arg} + b_arg; + cc_out[CC_V_BIT] = (a_arg[15] & b_arg[15] & ~ALUFn[15]) | (~a_arg[15] & ~b_arg[15] & ALUFn[15]); + end + + ALUOP16_SUB: + begin + {cc_out[CC_C_BIT], ALUFn} = {1'b0, a_arg} - {1'b0, b_arg}; + cc_out[CC_V_BIT] = (a_arg[15] & ~b_arg[15] & ~ALUFn[15]) | (~a_arg[15] & b_arg[15] & ALUFn[15]); + end + + ALUOP16_LD: + begin + ALUFn = b_arg; + cc_out[CC_V_BIT] = 1'b0; + end + + ALUOP16_CMP: + begin + {cc_out[CC_C_BIT], ALUFn} = {1'b0, a_arg} - {1'b0, b_arg}; + cc_out[CC_V_BIT] = (a_arg[15] & ~b_arg[15] & ~ALUFn[15]) | (~a_arg[15] & b_arg[15] & ALUFn[15]); + end + + ALUOP16_LEA: + begin + ALUFn = a_arg; + end + + default: + ALUFn = 16'H0000; + + endcase + cc_out[CC_Z_BIT] = (ALUFn[15:0] == 16'H0000); + if (operation16 != ALUOP16_LEA) + cc_out[CC_N_BIT] = ALUFn[15]; + ALU16Inst = {cc_out, ALUFn}; +end +endfunction + +reg [2:0] ALU16_OP; +reg [15:0] ALU16_A; +reg [15:0] ALU16_B; +reg [7:0] ALU16_CC; + +// Top 8 bits == CC, bottom 8 bits = output value +wire [23:0] ALU16 = ALU16Inst(ALU16_OP, ALU16_A, ALU16_B, ALU16_CC); + + +///////////////////////////////////////////////////////////////// +// ALU + +// The ops are organized from the 4 low-order bits of the instructions for the first set of ops, then 16-31 are the second set - even though bit 4 isn't representative. +localparam ALUOP_NEG = 5'd0; +localparam ALUOP_COM = 5'd3; +localparam ALUOP_LSR = 5'd4; +localparam ALUOP_ROR = 5'd6; +localparam ALUOP_ASR = 5'd7; +localparam ALUOP_ASL = 5'd8; +localparam ALUOP_LSL = 5'd8; +localparam ALUOP_ROL = 5'd9; +localparam ALUOP_DEC = 5'd10; +localparam ALUOP_INC = 5'd12; +localparam ALUOP_TST = 5'd13; +localparam ALUOP_CLR = 5'd15; + +localparam ALUOP_SUB = 5'd16; +localparam ALUOP_CMP = 5'd17; +localparam ALUOP_SBC = 5'd18; +localparam ALUOP_AND = 5'd20; +localparam ALUOP_BIT = 5'd21; +localparam ALUOP_LD = 5'd22; +localparam ALUOP_EOR = 5'd24; +localparam ALUOP_ADC = 5'd25; +localparam ALUOP_OR = 5'd26; +localparam ALUOP_ADD = 5'd27; + +function [5:0] ALUOpFromInst(input [7:0] inst); +reg [4:0] op; +reg writeback; +begin + // Okay, this turned out to be simpler than I expected ... + op = {inst[7], inst[3:0]}; + case (op) + ALUOP_CMP: + writeback = 0; + ALUOP_TST: + writeback = 0; + ALUOP_BIT: + writeback = 0; + default: + writeback = 1; + endcase + ALUOpFromInst = {writeback, op}; +end +endfunction + +wire [4:0] ALU8Op; +wire ALU8Writeback; + +assign {ALU8Writeback, ALU8Op} = ALUOpFromInst(Inst1); + +reg [7:0] ALU_A; +reg [7:0] ALU_B; +reg [7:0] ALU_CC; +reg [4:0] ALU_OP; + + +function [15:0] ALUInst(input [4:0] operation, input [7:0] a_arg, input [7:0] b_arg, input [7:0] cc_arg); +reg [7:0] cc_out; +reg [7:0] ALUFn; +reg carry; +reg borrow; +begin + cc_out = cc_arg; + case (operation) + ALUOP_NEG: + begin + ALUFn[7:0] = ~a_arg + 1'b1; + cc_out[CC_C_BIT] = (ALUFn[7:0] != 8'H00); + cc_out[CC_V_BIT] = (a_arg == 8'H80); + end + + ALUOP_LSL: + begin + {cc_out[CC_C_BIT], ALUFn} = {a_arg, 1'b0}; + cc_out[CC_V_BIT] = a_arg[7] ^ a_arg[6]; + end + + ALUOP_LSR: + begin + {ALUFn, cc_out[CC_C_BIT]} = {1'b0, a_arg}; + end + + ALUOP_ASR: + begin + {ALUFn, cc_out[CC_C_BIT]} = {a_arg[7], a_arg}; + end + + ALUOP_ROL: + begin + {cc_out[CC_C_BIT], ALUFn} = {a_arg, cc_arg[CC_C_BIT]}; + cc_out[CC_V_BIT] = a_arg[7] ^ a_arg[6]; + end + + ALUOP_ROR: + begin + {ALUFn, cc_out[CC_C_BIT]} = {cc_arg[CC_C_BIT], a_arg}; + end + + ALUOP_OR: + begin + ALUFn[7:0] = (a_arg | b_arg); + cc_out[CC_V_BIT] = 1'b0; + end + + ALUOP_ADD: + begin + {cc_out[CC_C_BIT], ALUFn[7:0]} = {1'b0, a_arg} + {1'b0, b_arg}; + cc_out[CC_V_BIT] = (a_arg[7] & b_arg[7] & ~ALUFn[7]) | (~a_arg[7] & ~b_arg[7] & ALUFn[7]); + cc_out[CC_H_BIT] = a_arg[4] ^ b_arg[4] ^ ALUFn[4]; + end + + ALUOP_SUB: + begin + {cc_out[CC_C_BIT], ALUFn[7:0]} = {1'b0, a_arg} - {1'b0, b_arg}; + cc_out[CC_V_BIT] = (a_arg[7] & ~b_arg[7] & ~ALUFn[7]) | (~a_arg[7] & b_arg[7] & ALUFn[7]); + end + + ALUOP_AND: + begin + ALUFn[7:0] = (a_arg & b_arg); + cc_out[CC_V_BIT] = 1'b0; + end + + ALUOP_BIT: + begin + ALUFn[7:0] = (a_arg & b_arg); + cc_out[CC_V_BIT] = 1'b0; + end + + ALUOP_EOR: + begin + ALUFn[7:0] = (a_arg ^ b_arg); + cc_out[CC_V_BIT] = 1'b0; + end + + ALUOP_CMP: + begin + {cc_out[CC_C_BIT], ALUFn[7:0]} = {1'b0, a_arg} - {1'b0, b_arg}; + cc_out[CC_V_BIT] = (a_arg[7] & ~b_arg[7] & ~ALUFn[7]) | (~a_arg[7] & b_arg[7] & ALUFn[7]); + end + + ALUOP_COM: + begin + ALUFn[7:0] = ~a_arg; + cc_out[CC_V_BIT] = 1'b0; + cc_out[CC_C_BIT] = 1'b1; + end + + ALUOP_ADC: + begin + {cc_out[CC_C_BIT], ALUFn[7:0]} = {1'b0, a_arg} + {1'b0, b_arg} + cc_arg[CC_C_BIT]; + cc_out[CC_V_BIT] = (a_arg[7] & b_arg[7] & ~ALUFn[7]) | (~a_arg[7] & ~b_arg[7] & ALUFn[7]); + cc_out[CC_H_BIT] = a_arg[4] ^ b_arg[4] ^ ALUFn[4]; + end + + ALUOP_LD: + begin + ALUFn[7:0] = b_arg; + cc_out[CC_V_BIT] = 1'b0; + end + + ALUOP_INC: + begin + {carry, ALUFn} = {1'b0, a_arg} + 1'b1; + cc_out[CC_V_BIT] = (~a_arg[7] & ALUFn[7]); + end + + ALUOP_DEC: + begin + {carry, ALUFn[7:0]} = {1'b0, a_arg} - 1'b1; + cc_out[CC_V_BIT] = (a_arg[7] & ~ALUFn[7]); + end + + ALUOP_CLR: + begin + ALUFn[7:0] = 8'H00; + cc_out[CC_V_BIT] = 1'b0; + cc_out[CC_C_BIT] = 1'b0; + end + + ALUOP_TST: + begin + ALUFn[7:0] = a_arg; + cc_out[CC_V_BIT] = 1'b0; + end + + ALUOP_SBC: + begin + {cc_out[CC_C_BIT], ALUFn[7:0]} = {1'b0, a_arg} - {1'b0, b_arg} - cc_arg[CC_C_BIT]; + cc_out[CC_V_BIT] = (a_arg[7] & ~b_arg[7] & ~ALUFn[7]) | (~a_arg[7] & b_arg[7] & ALUFn[7]); + end + + default: + ALUFn = 8'H00; + + endcase + + cc_out[CC_N_BIT] = ALUFn[7]; + cc_out[CC_Z_BIT] = (ALUFn == 8'H00); + ALUInst = {cc_out[7:0], ALUFn[7:0]}; +end +endfunction + + +// Top 8 bits == CC, bottom 8 bits = output value +wire [15:0] ALU = ALUInst(ALU_OP, ALU_A, ALU_B, ALU_CC); + +//////////////////////////////////////////////////////////// + +localparam TYPE_INHERENT = 3'd0; +localparam TYPE_IMMEDIATE = 3'd1; +localparam TYPE_DIRECT = 3'd2; +localparam TYPE_RELATIVE = 3'd3; +localparam TYPE_INDEXED = 3'd4; +localparam TYPE_EXTENDED = 3'd5; + +localparam TYPE_INVALID = 3'd7; + +// Function to decode the addressing mode the instruction uses +function [2:0] addressing_mode_type(input [7:0] inst); +begin + casex (inst) + 8'b0000???? : addressing_mode_type = TYPE_DIRECT; + 8'b0001???? : + begin + casex (inst[3:0]) + 4'b0010: + addressing_mode_type = TYPE_INHERENT; + + 4'b0011: + addressing_mode_type = TYPE_INHERENT; + + 4'b1001: + addressing_mode_type = TYPE_INHERENT; + + 4'b1101: + addressing_mode_type = TYPE_INHERENT; + + 4'b0110: + addressing_mode_type = TYPE_RELATIVE; + + 4'b0111: + addressing_mode_type = TYPE_RELATIVE; + + 4'b1010: + addressing_mode_type = TYPE_IMMEDIATE; + + 4'b1100: + addressing_mode_type = TYPE_IMMEDIATE; + + 4'b1110: + addressing_mode_type = TYPE_IMMEDIATE; + + 4'b1111: + addressing_mode_type = TYPE_IMMEDIATE; + + default: + addressing_mode_type = TYPE_INVALID; + endcase + end + + 8'b0010????: addressing_mode_type = TYPE_RELATIVE; + 8'b0011????: + begin + casex(inst[3:0]) + 4'b00??: + addressing_mode_type = TYPE_INDEXED; + + 4'b01??: + addressing_mode_type = TYPE_IMMEDIATE; + + 4'b1001: + addressing_mode_type = TYPE_INHERENT; + + 4'b101?: + addressing_mode_type = TYPE_INHERENT; + + 4'b1100: + addressing_mode_type = TYPE_INHERENT; + + 4'b1101: + addressing_mode_type = TYPE_INHERENT; + + 4'b1111: + addressing_mode_type = TYPE_INHERENT; + + default: + addressing_mode_type = TYPE_INVALID; + endcase + end + + 8'b010?????: addressing_mode_type = TYPE_INHERENT; + + 8'b0110????: addressing_mode_type = TYPE_INDEXED; + + 8'b0111????: addressing_mode_type = TYPE_EXTENDED; + + 8'b1000????: + begin + casex (inst[3:0]) + 4'b0111: addressing_mode_type = TYPE_INVALID; + 4'b1111: addressing_mode_type = TYPE_INVALID; + 4'b1101: addressing_mode_type = TYPE_RELATIVE; + default: addressing_mode_type = TYPE_IMMEDIATE; + endcase + end + + 8'b1001????: addressing_mode_type = TYPE_DIRECT; + 8'b1010????: addressing_mode_type = TYPE_INDEXED; + 8'b1011????: addressing_mode_type = TYPE_EXTENDED; + 8'b1100????: addressing_mode_type = TYPE_IMMEDIATE; + 8'b1101????: addressing_mode_type = TYPE_DIRECT; + 8'b1110????: addressing_mode_type = TYPE_INDEXED; + 8'b1111????: addressing_mode_type = TYPE_EXTENDED; + + endcase +end +endfunction + +wire [2:0] AddrModeType = addressing_mode_type(Inst1); + +////////////////////////////////////////////////// + +// Individual opcodes that are the top of a column of states. + +localparam OPCODE_INH_ABX = 8'H3A; +localparam OPCODE_INH_RTS = 8'H39; +localparam OPCODE_INH_RTI = 8'H3B; +localparam OPCODE_INH_CWAI = 8'H3C; +localparam OPCODE_INH_MUL = 8'H3D; +localparam OPCODE_INH_SWI = 8'H3F; +localparam OPCODE_INH_SEX = 8'H1D; +localparam OPCODE_INH_NOP = 8'H12; +localparam OPCODE_INH_SYNC = 8'H13; +localparam OPCODE_INH_DAA = 8'H19; + +localparam OPCODE_IMM_ORCC = 8'H1A; +localparam OPCODE_IMM_ANDCC = 8'H1C; +localparam OPCODE_IMM_EXG = 8'H1E; +localparam OPCODE_IMM_TFR = 8'H1F; +localparam OPCODE_IMM_PSHS = 8'H34; +localparam OPCODE_IMM_PULS = 8'H35; +localparam OPCODE_IMM_PSHU = 8'H36; +localparam OPCODE_IMM_PULU = 8'H37; + +localparam OPCODE_IMM_SUBD = 8'H83; +localparam OPCODE_IMM_CMPX = 8'H8C; +localparam OPCODE_IMM_LDX = 8'H8E; +localparam OPCODE_IMM_ADDD = 8'HC3; +localparam OPCODE_IMM_LDD = 8'HCC; +localparam OPCODE_IMM_LDU = 8'HCE; +localparam OPCODE_IMM_CMPD = 8'H83; // Page2 +localparam OPCODE_IMM_CMPY = 8'H8C; // Page2 +localparam OPCODE_IMM_LDY = 8'H8E; // Page2 +localparam OPCODE_IMM_LDS = 8'HCE; // Page2 +localparam OPCODE_IMM_CMPU = 8'H83; // Page3 +localparam OPCODE_IMM_CMPS = 8'H8C; // Page3 + +localparam EXGTFR_REG_D = 4'H0; +localparam EXGTFR_REG_X = 4'H1; +localparam EXGTFR_REG_Y = 4'H2; +localparam EXGTFR_REG_U = 4'H3; +localparam EXGTFR_REG_S = 4'H4; +localparam EXGTFR_REG_PC = 4'H5; +localparam EXGTFR_REG_A = 4'H8; +localparam EXGTFR_REG_B = 4'H9; +localparam EXGTFR_REG_CC = 4'HA; +localparam EXGTFR_REG_DP = 4'HB; + +function IsALU8Set0(input [7:0] instr); +reg result; +reg [3:0] hi; +reg [3:0] lo; +begin + hi = instr[7:4]; + lo = instr[3:0]; + if ( (hi == 4'H0) || (hi == 4'H4) || (hi == 4'H5) || (hi == 4'H6) || (hi == 4'H7) ) + begin + if ( (lo != 4'H1) && (lo != 4'H2) && (lo != 4'H5) && (lo != 4'HB) && (lo != 4'HE) ) // permit NEG, COM, LSR, ROR, ASR, ASL/LSL, ROL, DEC, INC, TST, CLR + result = 1; + else + result = 0; + end + else + result = 0; + IsALU8Set0 = result; +end +endfunction + +function IsALU8Set1(input [7:0] instr); +reg result; +reg [3:0] hi; +reg [3:0] lo; +begin + hi = instr[7:4]; + lo = instr[3:0]; + if ( (hi >= 4'H8) ) + begin + if ( (lo <= 4'HB) && (lo != 4'H3) && (lo != 4'H7) ) // 8-bit SUB, CMP, SBC, AND, BIT, LD, EOR, ADC, OR, ADD + result = 1; + else + result = 0; + end + else + result = 0; + IsALU8Set1 = result; +end +endfunction + +// Determine if the instruction is performing an 8-bit op (ALU only) +function ALU8BitOp(input [7:0] instr); +begin + ALU8BitOp = IsALU8Set0(instr) | IsALU8Set1(instr); +end +endfunction + +wire Is8BitInst = ALU8BitOp(Inst1); + +function IsRegA(input [7:0] instr); +reg result; +reg [3:0] hi; +begin + hi = instr[7:4]; + if ((hi == 4'H4) || (hi == 4'H8) || (hi == 4'H9) || (hi == 4'HA) || (hi == 4'HB) ) + result = 1; + else + result = 0; + IsRegA = result; +end +endfunction + +wire IsTargetRegA = IsRegA(Inst1); + +// +// +// Decode +// 00-0F = DIRECT +// 10-1F = INHERENT, RELATIVE, IMMEDIATE +// 20-2F = RELATIVE +// 30-3F = INDEXED, IMMEDIATE (pus, pul), INHERENT +// 40-4F = INHERENT +// 50-5F = INHERENT +// 60-6F = INDEXED +// 70-7F = EXTENDED +// 80-8F = IMMEDIATE, RELATIVE (BSR) +// 90-9F = DIRECT +// A0-AF = INDEXED +// B0-BF = EXTENDED +// C0-CF = IMMEDIATE +// D0-DF = DIRECT +// E0-EF = INDEXED +// F0-FF = EXTENDED + +// DIRECT; 00-0F, 90-9F, D0-DF +// INHERENT; 10-1F (12, 13, 19, 1D), 30-3F (39-3F), 40-4F, 50-5F, +// RELATIVE: 10-1F (16, 17), 20-2F, 80-8F (8D) +// IMMEDIATE: 10-1F (1A, 1C, 1E, 1F), 30-3F (34-37), 80-8F (80-8C, 8E), C0-CF +// INDEXED: 60-6F, A0-AF, E0-EF +// EXTENDED: 70-7F, B0-Bf, F0-FF + +localparam INST_LBRA = 8'H16; // always -- shitty numbering, damnit +localparam INST_LBSR = 8'H17; // + +localparam INST_BRA = 8'H20; // always +localparam INST_BRN = 8'H21; // never +localparam INST_BHI = 8'H22; // CC.Z = 0 && CC.C = 0 +localparam INST_BLS = 8'H23; // CC.Z != 0 && CC.C != 0 +localparam INST_BCC = 8'H24; // CC.C = 0 +localparam INST_BHS = 8'H24; // same as BCC +localparam INST_BCS = 8'H25; // CC.C = 1 +localparam INST_BLO = 8'H25; // same as BCS +localparam INST_BNE = 8'H26; // CC.Z = 0 +localparam INST_BEQ = 8'H27; // CC.Z = 1 +localparam INST_BVC = 8'H28; // V = 1 +localparam INST_BVS = 8'H29; // V = 0 +localparam INST_BPL = 8'H2A; // CC.N = 0 +localparam INST_BMI = 8'H2B; // CC.N = 1 +localparam INST_BGE = 8'H2C; // CC.N = CC.V +localparam INST_BLT = 8'H2D; // CC.N != CC.V +localparam INST_BGT = 8'H2E; // CC.N = CC.V && CC.Z = 0 +localparam INST_BLE = 8'H2F; // CC.N != CC.V && CC.Z = 1 +localparam INST_BSR = 8'H8D; // always + +localparam NYB_BRA = 4'H0; // always +localparam NYB_BRN = 4'H1; // never +localparam NYB_BHI = 4'H2; // CC.Z = 0 && CC.C = 0 +localparam NYB_BLS = 4'H3; // CC.Z != 0 && CC.C != 0 +localparam NYB_BCC = 4'H4; // CC.C = 0 +localparam NYB_BHS = 4'H4; // same as BCC +localparam NYB_BCS = 4'H5; // CC.C = 1 +localparam NYB_BLO = 4'H5; // same as BCS +localparam NYB_BNE = 4'H6; // CC.Z = 0 +localparam NYB_BEQ = 4'H7; // CC.Z = 1 +localparam NYB_BVC = 4'H8; // V = 0 +localparam NYB_BVS = 4'H9; // V = 1 +localparam NYB_BPL = 4'HA; // CC.N = 0 +localparam NYB_BMI = 4'HB; // CC.N = 1 +localparam NYB_BGE = 4'HC; // CC.N = CC.V +localparam NYB_BLT = 4'HD; // CC.N != CC.V +localparam NYB_BGT = 4'HE; // CC.N = CC.V && CC.Z = 0 +localparam NYB_BLE = 4'HF; // CC.N != CC.V && CC.Z = 1 + + + +function take_branch(input [7:0] Inst1, input [7:0] cc); +begin + take_branch = 0; //default + if ( (Inst1 == INST_BSR) || (Inst1 == INST_LBSR) || (Inst1 == INST_LBRA) ) + take_branch = 1; + else + case (Inst1[3:0]) + NYB_BRA: + take_branch = 1; + NYB_BRN: + take_branch = 0; + NYB_BHI: + if ( ( cc[CC_Z_BIT] | cc[CC_C_BIT] ) == 0) + take_branch = 1; + NYB_BLS: + if ( cc[CC_Z_BIT] | cc[CC_C_BIT] ) + take_branch = 1; + NYB_BCC: + if ( cc[CC_C_BIT] == 0 ) + take_branch = 1; + NYB_BCS: + if ( cc[CC_C_BIT] == 1 ) + take_branch = 1; + NYB_BNE: + if ( cc[CC_Z_BIT] == 0 ) + take_branch = 1; + NYB_BEQ: + if ( cc[CC_Z_BIT] == 1 ) + take_branch = 1; + NYB_BVC: + if ( cc[CC_V_BIT] == 0) + take_branch = 1; + NYB_BVS: + if ( cc[CC_V_BIT] == 1) + take_branch = 1; + NYB_BPL: + if ( cc[CC_N_BIT] == 0 ) + take_branch = 1; + NYB_BMI: + if (cc[CC_N_BIT] == 1) + take_branch = 1; + NYB_BGE: + if ((cc[CC_N_BIT] ^ cc[CC_V_BIT]) == 0) + take_branch = 1; + NYB_BLT: + if ((cc[CC_N_BIT] ^ cc[CC_V_BIT]) == 1) + take_branch = 1; + NYB_BGT: + if ( ((cc[CC_N_BIT] ^ cc[CC_V_BIT]) == 0) & (cc[CC_Z_BIT] == 0) ) + take_branch = 1; + NYB_BLE: + if ( ((cc[CC_N_BIT] ^ cc[CC_V_BIT]) == 1) | (cc[CC_Z_BIT] == 1) ) + take_branch = 1; + endcase +end +endfunction + +wire TakeBranch = take_branch(Inst1, cc); + +///////////////////////////////////////////////////////////////////// +// Convenience function for knowing the contents for TFR, EXG +function [15:0] EXGTFRRegister(input [3:0] regid); +begin + case (regid) + EXGTFR_REG_D: + EXGTFRRegister = {a, b}; + EXGTFR_REG_X: + EXGTFRRegister = x; + EXGTFR_REG_Y: + EXGTFRRegister = y; + EXGTFR_REG_U: + EXGTFRRegister = u; + EXGTFR_REG_S: + EXGTFRRegister = s; + EXGTFR_REG_PC: + EXGTFRRegister = pc_p1; // For both EXG and TFR, this is used on the 2nd byte in the instruction's cycle. The PC intended to transfer is actually the next byte. + EXGTFR_REG_DP: + EXGTFRRegister = {8'HFF, dp}; + EXGTFR_REG_A: + EXGTFRRegister = {8'HFF, a}; + EXGTFR_REG_B: + EXGTFRRegister = {8'HFF, b}; + EXGTFR_REG_CC: + EXGTFRRegister = {8'HFF, cc}; + default: + EXGTFRRegister = 16'H0; + endcase +end +endfunction +wire [15:0] EXGTFRRegA = EXGTFRRegister(D[7:4]); +wire [15:0] EXGTFRRegB = EXGTFRRegister(D[3:0]); + +// CPU state machine +always @(*) +begin + rLIC = 1'b0; + rAVMA = 1'b1; + rBUSY = 1'b0; + + addr_nxt = 16'HFFFF; + pc_p1 = (pc+16'H1); + pc_p2 = (pc+16'H2); + pc_p3 = (pc+16'H3); + s_p1 = (s+16'H1); + s_m1 = (s-16'H1); + u_p1 = (u+16'H1); + u_m1 = (u-16'H1); + addr_p1 = (addr+16'H1); + ea_p1 = (ea+16'H1); + BS_nxt = 1'b0; + BA_nxt = 1'b0; + + // These may be overridden below, but the "next" version by default should be + // the last latched version. + IntType_nxt = IntType; + NMIClear_nxt = NMIClear; + NextState_nxt = NextState; + a_nxt = a; + b_nxt = b; + x_nxt = x; + y_nxt = y; + s_nxt = s; + u_nxt = u; + cc_nxt = cc; + dp_nxt = dp; + pc_nxt = pc; + tmp_nxt = tmp; + ea_nxt = ea; + + ALU_A = 8'H00; + ALU_B = 8'H00; + ALU_CC = 8'H00; + ALU_OP = 5'H00; + + ALU16_OP = 3'H0; + ALU16_A = 16'H0000; + ALU16_B = 16'H0000; + ALU16_CC = 8'H00; + + DOutput = 8'H00; + RnWOut = 1'b1; // read + + Inst1_nxt = Inst1; + Inst2_nxt = Inst2; + Inst3_nxt = Inst3; + InstPage2_nxt = InstPage2; + InstPage3_nxt = InstPage3; + + CpuState_nxt = CpuState; + + case (CpuState) + CPUSTATE_RESET: + begin + addr_nxt = 16'HFFFF; + a_nxt = 0; + b_nxt = 0; + x_nxt = 0; + y_nxt = 0; + s_nxt = 16'HFFFD; // Take care about removing the reset of S. There's logic depending on the delta between s and s_nxt to clear NMIMask. + u_nxt = 0; + cc_nxt = CC_F | CC_I; // reset disables interrupts + dp_nxt = 0; + ea_nxt = 16'HFFFF; + + RnWOut = 1; // read + rLIC = 1'b0; // Instruction incomplete + NMIClear_nxt= 1'b0; + IntType_nxt = 3'b111; + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_RESET0; + end + + CPUSTATE_RESET0: + begin + addr_nxt = `RESET_VECTOR; + rBUSY = 1'b1; + pc_nxt[15:8] = D[7:0]; + BS_nxt = 1'b1; // ACK RESET + rAVMA = 1'b1; + rLIC = 1'b1; + CpuState_nxt = CPUSTATE_RESET2; + end + + CPUSTATE_RESET2: + begin + addr_nxt = addr_p1; + BS_nxt = 1'b1; // ACK RESET + pc_nxt[7:0] = D[7:0]; + rAVMA = 1'b1; + rLIC = 1'b1; + CpuState_nxt = CPUSTATE_FETCH_I1; + end + + CPUSTATE_FETCH_I1: + begin + if (~DMABREQLatched) + begin + addr_nxt = pc; + RnWOut = 1'b1; + rAVMA = 1'b0; + tmp_nxt = {tmp[15:4], 4'b1111}; + BS_nxt = 1'b1; + BA_nxt = 1'b1; + rLIC = 1'b1; + CpuState_nxt = CPUSTATE_DMABREQ; + end + else if (~HALTLatched) + begin + addr_nxt = pc; + RnWOut = 1'b1; + rAVMA = 1'b0; + BS_nxt = 1'b1; + BA_nxt = 1'b1; + rLIC = 1'b1; + CpuState_nxt = CPUSTATE_HALTED; + end + else // not halting, run the inst byte fetch + begin + addr_nxt = pc; // Set the address bus for the next instruction, first byte + pc_nxt = pc_p1; + RnWOut = 1; // Set for a READ + Inst1_nxt = MappedInstruction; + InstPage2_nxt = 0; + InstPage3_nxt = 0; + + // New instruction fetch; service interrupts pending + if (NMILatched == 0) + begin + pc_nxt = pc; + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_NMI_START; + end + else if ((FIRQLatched == 0) && (cc[CC_F_BIT] == 0)) + begin + pc_nxt = pc; + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_FIRQ_START; + end + else if ((IRQLatched == 0) && (cc[CC_I_BIT] == 0)) + begin + pc_nxt = pc; + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_IRQ_START; + end + + // The actual 1st byte checks + else if (Inst1_nxt == 8'H10) // Page 2 Note, like the 6809, $10 $10 $10 $10 has the same effect as a single $10. + begin + InstPage2_nxt = 1; + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_FETCH_I1V2; + end + else if (Inst1_nxt == 8'H11) // Page 3 + begin + InstPage3_nxt = 1; + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_FETCH_I1V2; + end + else + begin + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_FETCH_I2; + end + end // if not halting + end + + CPUSTATE_FETCH_I1V2: + begin + addr_nxt = pc; // Set the address bus for the next instruction, first byte + pc_nxt = pc_p1; + RnWOut = 1; // Set for a READ + Inst1_nxt = MappedInstruction; + + if (Inst1_nxt == 8'H10) // Page 2 Note, like the 6809, $10 $10 $10 $10 has the same effect as a single $10. + begin + if (InstPage3 == 0) // $11 $11 $11 $11 ... $11 $10 still = Page 3 + InstPage2_nxt = 1; + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_FETCH_I1V2; + end + else if (Inst1_nxt == 8'H11) // Page 3 + begin + if (InstPage2 == 0) // $10 $10 ... $10 $11 still = Page 2 + InstPage3_nxt = 1; + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_FETCH_I1V2; + end + else + begin + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_FETCH_I2; + end + end + + + CPUSTATE_FETCH_I2: // We've fetched the first byte. If a $10 or $11 (page select), mark those flags and fetch the next byte as instruction byte 1. + begin + addr_nxt = addr_p1; // Address bus++ + pc_nxt = pc_p1; + Inst2_nxt = D[7:0]; + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_FETCH_I1; + + if (IsIllegalInstruction) // Skip illegal instructions + begin + + rAVMA = 1'b1; + CpuState_nxt = IllegalInstructionState; + rLIC = 1'b1; + end + else + begin + // First byte Decode for this stage + case (AddrModeType) + TYPE_INDEXED: + begin + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_INDEXED_BASE; + end + + + TYPE_EXTENDED: + begin + ea_nxt[15:8] = Inst2_nxt; + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_EXTENDED_ADDRLO; + end + TYPE_DIRECT: + begin + ea_nxt = {dp, Inst2_nxt}; + rAVMA = 1'b0; + CpuState_nxt = CPUSTATE_DIRECT_DONTCARE; + end + + TYPE_INHERENT: + begin + if (Inst1 == OPCODE_INH_NOP) + begin + rLIC = 1'b1; // Instruction done! + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_FETCH_I1; + end + else if (Inst1 == OPCODE_INH_DAA) // Bcd lunacy + begin + if ( ((a[3:0] > 4'H9) | (cc[CC_H_BIT])) & + ((a[7:4] > 4'H9) | (cc[CC_C_BIT])) ) + begin + {cc_nxt[CC_C_BIT], a_nxt} = {1'b0, a} + 8'H66; + end + else if ((a[3:0] > 4'H9) | (cc[CC_H_BIT])) + begin + {cc_nxt[CC_C_BIT], a_nxt} = {1'b0, a} + 8'H06; + end + else if ((a[7:4] > 4'H9) | (cc[CC_C_BIT])) + begin + {cc_nxt[CC_C_BIT], a_nxt} = {1'b0, a} + 8'H60; + end + cc_nxt[CC_N_BIT] = a_nxt[7]; + cc_nxt[CC_Z_BIT] = (a_nxt == 8'H00); + rLIC = 1'b1; // Instruction done! + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_FETCH_I1; + end + else if (Inst1 == OPCODE_INH_SYNC) + begin + CpuState_nxt = CPUSTATE_SYNC; + rLIC = 1'b1; + rAVMA = 1'b0; + end + else if (Inst1 == OPCODE_INH_MUL) + begin + tmp_nxt = 16'H0000; + ea_nxt[15:8] = 8'H00; + ea_nxt[7:0] = a; + a_nxt = 8; + rAVMA = 1'b0; + CpuState_nxt = CPUSTATE_MUL_ACTION; + end + else if (Inst1 == OPCODE_INH_RTS) + begin + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_RTS_HI; + end + else if (Inst1 == OPCODE_INH_RTI) + begin + rAVMA = 1'b1; + tmp_nxt = 16'H1001; // Set tmp[12] to indicate an RTI being processed, and at least pull CC. + CpuState_nxt = CPUSTATE_PUL_ACTION; + NextState_nxt = CPUSTATE_FETCH_I1; + end + else if (Inst1 == OPCODE_INH_SWI) + begin + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_SWI_START; + end + else if (Inst1 == OPCODE_INH_CWAI) + begin + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_CWAI; + end + else if (Inst1 == OPCODE_INH_SEX) + begin + a_nxt = {8{b[7]}}; + rLIC = 1'b1; // Instruction done! + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_FETCH_I1; + end + else if (Inst1 == OPCODE_INH_ABX) + begin + x_nxt = x + b; + rAVMA = 1'b0; + CpuState_nxt = CPUSTATE_ABX_DONTCARE; + end + else + begin + ALU_OP = ALU8Op; + if (IsTargetRegA) + ALU_A = a; + else + ALU_A = b; + + ALU_B = 0; + ALU_CC = cc; + cc_nxt = ALU[15:8]; + + if (ALU8Writeback) + begin + if (IsTargetRegA) + a_nxt = ALU[7:0]; + else + b_nxt = ALU[7:0]; + end + rLIC = 1'b1; // Instruction done! + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_FETCH_I1; + end + if (IsOneByteInstruction(Inst1)) // This check is probably superfluous. Every inherent instruction is 1 byte on the 6809. + pc_nxt = pc; // The 6809 auto-reads 2 bytes for every instruction. :( Adjust by not incrementing PC on the 2nd byte read. + end + + TYPE_IMMEDIATE: + begin + if (IsSpecialImmediate) + begin + if (Inst1 == OPCODE_IMM_ANDCC) + begin + pc_nxt = pc_p1; + cc_nxt = cc & D; //cc_nxt & Inst2_nxt; + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_CC_DONTCARE; + end + else if (Inst1 == OPCODE_IMM_ORCC) + begin + pc_nxt = pc_p1; + cc_nxt = cc | D; //cc_nxt | Inst2_nxt; + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_CC_DONTCARE; + end + else if ( (Inst1 == OPCODE_IMM_PSHS) | (Inst1 == OPCODE_IMM_PSHU) ) + begin + pc_nxt = pc_p1; + tmp_nxt[15] = 1'b0; + tmp_nxt[14] = Inst1[1]; // Mark whether to save to U or S. + tmp_nxt[13] = 1'b0; // Not pushing due to an interrupt. + tmp_nxt[13:8] = 6'H00; + tmp_nxt[7:0] = Inst2_nxt; + rAVMA = 1'b0; + CpuState_nxt = CPUSTATE_PSH_DONTCARE1; + NextState_nxt = CPUSTATE_FETCH_I1; + end + else if ( (Inst1 == OPCODE_IMM_PULS) | (Inst1 == OPCODE_IMM_PULU) ) + begin + pc_nxt = pc_p1; + tmp_nxt[15] = 1'b0; + tmp_nxt[14] = Inst1[1]; // S (0) or U (1) stack in use. + tmp_nxt[13:8] = 6'H00; + tmp_nxt[7:0] = Inst2_nxt; + rAVMA = 1'b0; + CpuState_nxt = CPUSTATE_PUL_DONTCARE1; + NextState_nxt = CPUSTATE_FETCH_I1; + end + else if (Inst1 == OPCODE_IMM_TFR) + begin + // The second byte lists the registers; Top nybble is reg #1, bottom is reg #2. + + case (Inst2_nxt[3:0]) + EXGTFR_REG_D: + {a_nxt,b_nxt} = EXGTFRRegA; + EXGTFR_REG_X: + x_nxt = EXGTFRRegA; + EXGTFR_REG_Y: + y_nxt = EXGTFRRegA; + EXGTFR_REG_U: + u_nxt = EXGTFRRegA; + EXGTFR_REG_S: + s_nxt = EXGTFRRegA; + EXGTFR_REG_PC: + pc_nxt = EXGTFRRegA; + EXGTFR_REG_DP: + dp_nxt = EXGTFRRegA[7:0]; + EXGTFR_REG_A: + a_nxt = EXGTFRRegA[7:0]; + EXGTFR_REG_B: + b_nxt = EXGTFRRegA[7:0]; + EXGTFR_REG_CC: + cc_nxt = EXGTFRRegA[7:0]; + default: + begin + end + endcase + rAVMA = 1'b0; + CpuState_nxt = CPUSTATE_TFR_DONTCARE1; + + end + else if (Inst1 == OPCODE_IMM_EXG) + begin + // The second byte lists the registers; Top nybble is reg #1, bottom is reg #2. + + case (Inst2_nxt[7:4]) + EXGTFR_REG_D: + {a_nxt,b_nxt} = EXGTFRRegB; + EXGTFR_REG_X: + x_nxt = EXGTFRRegB; + EXGTFR_REG_Y: + y_nxt = EXGTFRRegB; + EXGTFR_REG_U: + u_nxt = EXGTFRRegB; + EXGTFR_REG_S: + s_nxt = EXGTFRRegB; + EXGTFR_REG_PC: + pc_nxt = EXGTFRRegB; + EXGTFR_REG_DP: + dp_nxt = EXGTFRRegB[7:0]; + EXGTFR_REG_A: + a_nxt = EXGTFRRegB[7:0]; + EXGTFR_REG_B: + b_nxt = EXGTFRRegB[7:0]; + EXGTFR_REG_CC: + cc_nxt = EXGTFRRegB[7:0]; + default: + begin + end + endcase + case (Inst2_nxt[3:0]) + EXGTFR_REG_D: + {a_nxt,b_nxt} = EXGTFRRegA; + EXGTFR_REG_X: + x_nxt = EXGTFRRegA; + EXGTFR_REG_Y: + y_nxt = EXGTFRRegA; + EXGTFR_REG_U: + u_nxt = EXGTFRRegA; + EXGTFR_REG_S: + s_nxt = EXGTFRRegA; + EXGTFR_REG_PC: + pc_nxt = EXGTFRRegA; + EXGTFR_REG_DP: + dp_nxt = EXGTFRRegA[7:0]; + EXGTFR_REG_A: + a_nxt = EXGTFRRegA[7:0]; + EXGTFR_REG_B: + b_nxt = EXGTFRRegA[7:0]; + EXGTFR_REG_CC: + cc_nxt = EXGTFRRegA[7:0]; + default: + begin + end + endcase + rAVMA = 1'b0; + CpuState_nxt = CPUSTATE_EXG_DONTCARE1; + end + end + // Determine if this is an 8-bit ALU operation. + else if (Is8BitInst) + begin + ALU_OP = ALU8Op; + if (IsTargetRegA) + ALU_A = a; + else + ALU_A = b; + + ALU_B = Inst2_nxt; + ALU_CC = cc; + cc_nxt = ALU[15:8]; + + if (ALU8Writeback) + begin + if (IsTargetRegA) + a_nxt = ALU[7:0]; + else + b_nxt = ALU[7:0]; + end + rLIC = 1'b1; // Instruction done! + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_FETCH_I1; + end + else // Then it must be a 16 bit instruction + begin + // 83 SUBD + // 8C CMPX + // 8E LDX + // C3 ADDD + // CC LDD + // CE LDU + // 108E CMPD + // 108C CMPY + // 108E LDY + // 10CE LDS + // 1183 CMPU + // 118C CMPS + // Wow, they were just stuffing them in willy-nilly ... + + // LD* 16 bit immediate + if (IsALU16Opcode) + begin + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_16IMM_LO; + end + // there's a dead zone here; I need an else to take us back to CPUSTATE_FETCHI1 if we want to ignore illegal instructions, to CPUSTATE_DEAD if we want to catch them. + + end + + end + + TYPE_RELATIVE: + begin + // Is this a LB** or a B**? + // If InstPage2 is set, it's a long branch; if clear, a normal branch. + if ( (InstPage2) || (Inst1 == INST_LBRA) || (Inst1 == INST_LBSR) ) + begin + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_LBRA_OFFSETLOW; + end + else + begin + rAVMA = 1'b0; + CpuState_nxt = CPUSTATE_BRA_DONTCARE; + end + + end + default: + begin + CpuState_nxt = CPUSTATE_FETCH_I1; + end + endcase + end + end + + + CPUSTATE_LBRA_OFFSETLOW: + begin + addr_nxt = pc; + pc_nxt = pc_p1; + Inst3_nxt = D[7:0]; + rAVMA = 1'b0; + CpuState_nxt = CPUSTATE_LBRA_DONTCARE; + end + + CPUSTATE_LBRA_DONTCARE: + begin + addr_nxt = 16'HFFFF; + if ( TakeBranch ) + begin + rAVMA = 1'b0; + CpuState_nxt = CPUSTATE_LBRA_DONTCARE2; + end + else + begin + rLIC = 1'b1; // Instruction done! + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_FETCH_I1; + end + end + + CPUSTATE_BRA_DONTCARE: + begin + addr_nxt = 16'HFFFF; + tmp_nxt = pc; + if (TakeBranch) + begin + pc_nxt = pc + { {8{Inst2[7]}}, Inst2[7:0]}; // Sign-extend the 8 bit offset to 16. + + if (Inst1 == INST_BSR) + begin + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_BSR_DONTCARE1; + end + else + begin + rLIC = 1'b1; // Instruction done! + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_FETCH_I1; + end + end + else + begin + rLIC = 1'b1; + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_FETCH_I1; + end + + end + + CPUSTATE_LBRA_DONTCARE2: + begin + tmp_nxt= pc; + addr_nxt = 16'HFFFF; + + // Take branch + pc_nxt = pc + {Inst2[7:0], Inst3[7:0]}; + if (Inst1 == INST_LBSR) + begin + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_BSR_DONTCARE1; + end + else + begin + rLIC = 1'b1; // Instruction done! + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_FETCH_I1; + end + end + + CPUSTATE_BSR_DONTCARE1: + begin + addr_nxt = pc; + rAVMA = 1'b0; + CpuState_nxt = CPUSTATE_BSR_DONTCARE2; + end + + CPUSTATE_BSR_DONTCARE2: + begin + addr_nxt = 16'HFFFF; + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_BSR_RETURNLOW; + end + + CPUSTATE_BSR_RETURNLOW: + begin + addr_nxt = s_m1; + s_nxt = s_m1; + DOutput[7:0] = tmp[7:0]; + RnWOut = 0; + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_BSR_RETURNHIGH; + end + + CPUSTATE_BSR_RETURNHIGH: + begin + addr_nxt = s_m1; + s_nxt = s_m1; + DOutput[7:0] = tmp[15:8]; + RnWOut = 0; + rLIC = 1'b1; // Instruction done! + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_FETCH_I1; // after this, RnWOut must go to 1, and the bus needs the PC placed on it. + end + + CPUSTATE_TFR_DONTCARE1: + begin + addr_nxt = 16'HFFFF; + rAVMA = 1'b0; + CpuState_nxt = CPUSTATE_TFR_DONTCARE2; + end + + CPUSTATE_TFR_DONTCARE2: + begin + addr_nxt = 16'HFFFF; + rAVMA = 1'b0; + CpuState_nxt = CPUSTATE_TFR_DONTCARE3; + end + + CPUSTATE_TFR_DONTCARE3: + begin + addr_nxt = 16'HFFFF; + rAVMA = 1'b0; + CpuState_nxt = CPUSTATE_TFR_DONTCARE4; + end + + CPUSTATE_TFR_DONTCARE4: + begin + addr_nxt = 16'HFFFF; + rAVMA = 1'b1; + rLIC = 1'b1; // Instruction done! + CpuState_nxt = CPUSTATE_FETCH_I1; + end + + CPUSTATE_EXG_DONTCARE1: + begin + addr_nxt = 16'HFFFF; + rAVMA = 1'b0; + CpuState_nxt = CPUSTATE_EXG_DONTCARE2; + end + + CPUSTATE_EXG_DONTCARE2: + begin + addr_nxt = 16'HFFFF; + rAVMA = 1'b0; + CpuState_nxt = CPUSTATE_EXG_DONTCARE3; + end + + CPUSTATE_EXG_DONTCARE3: + begin + addr_nxt = 16'HFFFF; + rAVMA = 1'b0; + CpuState_nxt = CPUSTATE_EXG_DONTCARE4; + end + + CPUSTATE_EXG_DONTCARE4: + begin + addr_nxt = 16'HFFFF; + rAVMA = 1'b0; + CpuState_nxt = CPUSTATE_EXG_DONTCARE5; + end + + CPUSTATE_EXG_DONTCARE5: + begin + rAVMA = 1'b0; + addr_nxt = 16'HFFFF; + CpuState_nxt = CPUSTATE_EXG_DONTCARE6; + end + + CPUSTATE_EXG_DONTCARE6: + begin + addr_nxt = 16'HFFFF; + rAVMA = 1'b1; + rLIC = 1'b1; // Instruction done! + CpuState_nxt = CPUSTATE_FETCH_I1; + end + + CPUSTATE_ABX_DONTCARE: + begin + addr_nxt = 16'HFFFF; + rAVMA = 1'b1; + rLIC = 1'b1; // Instruction done! + CpuState_nxt = CPUSTATE_FETCH_I1; + end + + CPUSTATE_RTS_HI: + begin + addr_nxt = s; + s_nxt = s_p1; + pc_nxt[15:8] = D[7:0]; + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_RTS_LO; + end + + CPUSTATE_RTS_LO: + begin + addr_nxt = s; + s_nxt = s_p1; + pc_nxt[7:0] = D[7:0]; + rAVMA = 1'b0; + CpuState_nxt = CPUSTATE_RTS_DONTCARE2; + end + + CPUSTATE_RTS_DONTCARE2: + begin + addr_nxt = 16'HFFFF; + rLIC = 1'b1; // Instruction done! + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_FETCH_I1; + end + + CPUSTATE_16IMM_LO: + begin + addr_nxt = pc; + pc_nxt = pc_p1; + + ALU16_OP = ALU16Opcode; + ALU16_CC = cc; + ALU16_B = {Inst2, D[7:0]}; + + case (ALU16Reg) + ALU16_REG_X: + ALU16_A = x; + ALU16_REG_D: + ALU16_A = {a, b}; + ALU16_REG_Y: + ALU16_A = y; + ALU16_REG_U: + ALU16_A = u; + ALU16_REG_S: + ALU16_A = s; + default: + ALU16_A = 16'H0; + endcase + + if (ALU16OpWriteback) + begin + case (ALU16Reg) + ALU16_REG_X: + {cc_nxt, x_nxt} = ALU16; + ALU16_REG_D: + {cc_nxt, a_nxt, b_nxt} = ALU16; + ALU16_REG_Y: + {cc_nxt, y_nxt} = ALU16; + ALU16_REG_U: + {cc_nxt, u_nxt} = ALU16; + ALU16_REG_S: + {cc_nxt, s_nxt} = ALU16; + default: + begin + end + endcase + end + else + cc_nxt = ALU16[23:16]; + + if (ALU16_OP == ALUOP16_LD) + begin + rLIC = 1'b1; // Instruction done! + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_FETCH_I1; + end + else + begin + rAVMA = 1'b0; + CpuState_nxt = CPUSTATE_16IMM_DONTCARE; + end + end + + CPUSTATE_DIRECT_DONTCARE: + begin + addr_nxt = 16'HFFFF; + + if (IsJMP(Inst1)) + begin + pc_nxt = ea; + rLIC = 1'b1; // Instruction done! + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_FETCH_I1; + end + else + begin + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_ALU_EA; + end + end + + CPUSTATE_ALU_EA: + begin + + // Is Figure 18/5 Column 2? JMP (not Immediate Mode) + // This actually isn't done here. All checks passing in to ALU_EA should check for a JMP; FIXME EVERYWHERE + + // Is Figure 18/5 Column 8? TST (not immediate mode) + // THIS IS BURIED IN THE COLUMN 3 section with comparisons to ALUOP_TST. + + // Is Figure 18/5 Column 3? + if (IsALU8Set1(Inst1)) + begin + addr_nxt = ea; + + ALU_OP = ALU8Op; + ALU_B = D[7:0]; + ALU_CC = cc; + + if (IsTargetRegA) + ALU_A = a; + else + ALU_A = b; + + cc_nxt = ALU[15:8]; + + if ( (ALU8Writeback) ) + begin + if (IsTargetRegA) + a_nxt = ALU[7:0]; + else + b_nxt = ALU[7:0]; + end + + rLIC = 1'b1; // Instruction done! + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_FETCH_I1; + end + + // Is Figure 18/5 Column 4? (Store, 8 bits) + else if (IsStore8) + begin + addr_nxt = ea; + RnWOut = 0; // write + + ALU_OP = ALUOP_LD; // load has the same CC characteristics as store + ALU_A = 8'H00; + ALU_CC = cc; + + case (Store8RegisterNum) + ST8_REG_A: + begin + DOutput = a; + ALU_B = a; + end + ST8_REG_B: + begin + DOutput = b; + ALU_B = b; + end + + + endcase + + cc_nxt = ALU[15:8]; + + rLIC = 1'b1; // Instruction done! + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_FETCH_I1; + end + + // Is Figure 18/5 Column 5? (Load, 16 bits) + else if (IsALU16Opcode & (ALU16Opcode == ALUOP16_LD)) + begin + addr_nxt = ea; + ea_nxt = ea_p1; + + case (ALU16Reg) + ALU16_REG_X: + x_nxt[15:8] = D[7:0]; + ALU16_REG_D: + a_nxt = D[7:0]; + ALU16_REG_Y: + y_nxt[15:8] = D[7:0]; + ALU16_REG_S: + s_nxt[15:8] = D[7:0]; + ALU16_REG_U: + u_nxt[15:8] = D[7:0]; + default: + begin + end + endcase + rAVMA = 1'b1; + rBUSY = 1'b1; + CpuState_nxt = CPUSTATE_LD16_LO; + + end + + // Is Figure 18/5 Column 6? (Store, 16 bits) + else if (IsStore16) + begin + addr_nxt = ea; + ea_nxt = ea_p1; + + ALU16_OP = ALUOP16_LD; // LD and ST have the same CC characteristics + ALU16_CC = cc; + ALU16_A = 8'H00; + + case (StoreRegisterNum) + ST16_REG_X: + begin + DOutput[7:0] = x[15:8]; + ALU16_B = x; + end + ST16_REG_Y: + begin + DOutput[7:0] = y[15:8]; + ALU16_B = y; + end + ST16_REG_U: + begin + DOutput[7:0] = u[15:8]; + ALU16_B = u; + end + ST16_REG_S: + begin + DOutput[7:0] = s[15:8]; + ALU16_B = s; + end + ST16_REG_D: + begin + DOutput[7:0] = a[7:0]; + ALU16_B = {a,b}; + end + default: + begin + end + endcase + + cc_nxt = ALU16[23:16]; + + RnWOut = 0; // Write + rAVMA = 1'b1; + rBUSY = 1'b1; + CpuState_nxt = CPUSTATE_ST16_LO; + end + + // Is Figure 18/5 Column 7? + else if (IsALU8Set0(Inst1)) + begin + // These are registerless instructions, ala + // ASL, ASR, CLR, COM, DEC, INC, (LSL), LSR, NEG, ROL, ROR + // and TST (special!) + // They require READ, Modify (the operation above), WRITE. Between the Read and the Write cycles, there's actually a /VMA + // cycle where the 6809 likely did the operation. We'll include a /VMA cycle for accuracy, but we'll do the work primarily in the first cycle. + addr_nxt = ea; + + ALU_OP = ALU8Op; + ALU_A = D[7:0]; + ALU_CC = cc; + tmp_nxt[15:8] = cc; // for debug only + tmp_nxt[7:0] = ALU[7:0]; + cc_nxt = ALU[15:8]; + if (ALU8Op == ALUOP_TST) + begin + rAVMA = 1'b0; + CpuState_nxt = CPUSTATE_TST_DONTCARE1; + end + else + begin + rAVMA = 1'b0; + rBUSY = 1'b1; + CpuState_nxt = CPUSTATE_ALU_DONTCARE; + end + + end + + // Is Figure 18/5 Column 8? TST + // NOTE: + // THIS IS BURIED IN THE COLUMN 3 section with comparisons to ALUOP_TST. [Directly above.] + + + // Is Figure 18/5 Column 9? (16-bit ALU ops, non-load) + else if (IsALU16Opcode && (ALU16Opcode != ALUOP16_LD) && ((Inst1 < 8'H30) || (Inst1 > 8'H33)) ) // 30-33 = LEAX, LEAY, LEAS, LEAU; don't include them here. + begin + addr_nxt = ea; + ea_nxt = ea_p1; + + tmp_nxt[15:8] = D[7:0]; + rAVMA = 1'b1; + rBUSY = 1'b1; + CpuState_nxt = CPUSTATE_ALU16_LO; + + end + + // Is Figure 18/5 Column 10? JSR (not Immediate Mode) + else if ((Inst1 == 8'H9D) || (Inst1 == 8'HAD) || (Inst1 == 8'HBD)) // JSR + begin + pc_nxt = ea; + addr_nxt = ea; + tmp_nxt = pc; + rAVMA = 1'b0; + CpuState_nxt = CPUSTATE_JSR_DONTCARE; + end + // Is Figure 18/5 Column 11? LEA(X,Y,S,U) + else if ((Inst1 >= 8'H30) && (Inst1<= 8'H33)) + begin + addr_nxt = 16'HFFFF; // Ack, actually a valid cycle, this isn't a dontcare (/VMA) cycle! + + ALU16_OP = ALU16Opcode; + ALU16_CC = cc; + ALU16_A = ea; + + case (ALU16Reg) + ALU16_REG_X: + {cc_nxt, x_nxt} = ALU16; + ALU16_REG_Y: + {cc_nxt, y_nxt} = ALU16; + ALU16_REG_U: + u_nxt = ALU16[15:0]; + ALU16_REG_S: + s_nxt = ALU16[15:0]; + default: + begin + end + endcase + + rLIC = 1'b1; // Instruction done! + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_FETCH_I1; + + end + + end + + + CPUSTATE_ALU_DONTCARE: + begin + addr_nxt = 16'HFFFF; + rAVMA = 1'b1; + rBUSY = 1'b1; // We do nothing here, but on the real 6809, they did the modify phase here. :| + CpuState_nxt = CPUSTATE_ALU_WRITEBACK; + end + + CPUSTATE_ALU_WRITEBACK: + begin + addr_nxt = ea; + RnWOut = 0; // Write + DOutput = tmp[7:0]; + rLIC = 1'b1; // Instruction done! + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_FETCH_I1; + end + + CPUSTATE_LD16_LO: + begin + addr_nxt = ea; + + case (ALU16Reg) + ALU16_REG_X: + begin + x_nxt[7:0] = D[7:0]; + ALU16_B[15:8] = x[15:8]; + end + ALU16_REG_D: + begin + b_nxt = D[7:0]; + ALU16_B[15:8] = a; + end + ALU16_REG_Y: + begin + y_nxt[7:0] = D[7:0]; + ALU16_B[15:8] = y[15:8]; + end + ALU16_REG_S: + begin + s_nxt[7:0] = D[7:0]; + ALU16_B[15:8] = s[15:8]; + end + ALU16_REG_U: + begin + u_nxt[7:0] = D[7:0]; + ALU16_B[15:8] = u[15:8]; + end + default: + begin + end + + endcase + + ALU16_OP = ALU16Opcode; + ALU16_CC = cc; + ALU16_A = 8'H00; + ALU16_B[7:0] = D[7:0]; + cc_nxt = ALU16[23:16]; + + rLIC = 1'b1; // Instruction done! + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_FETCH_I1; + end + + CPUSTATE_ST16_LO: + begin + addr_nxt = ea; + ea_nxt = ea_p1; + case (StoreRegisterNum) + ST16_REG_X: + DOutput[7:0] = x[7:0]; + ST16_REG_Y: + DOutput[7:0] = y[7:0]; + ST16_REG_U: + DOutput[7:0] = u[7:0]; + ST16_REG_S: + DOutput[7:0] = s[7:0]; + ST16_REG_D: + DOutput[7:0] = b[7:0]; + default: + begin + end + endcase + RnWOut = 0; // write + + rLIC = 1'b1; // Instruction done! + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_FETCH_I1; + end + + CPUSTATE_ALU16_LO: + begin + addr_nxt = ea; + + ALU16_OP = ALU16Opcode; + ALU16_CC = cc; + + ALU16_B = {tmp[15:8], D[7:0]}; + + case (ALU16Reg) + ALU16_REG_X: + ALU16_A = x; + ALU16_REG_D: + ALU16_A = {a, b}; + ALU16_REG_Y: + ALU16_A = y; + ALU16_REG_S: + ALU16_A = s; + ALU16_REG_U: + ALU16_A = u; + default: + ALU16_A = 16'H0; + + endcase + + if (ALU16OpWriteback) + begin + case (ALU16Reg) + ALU16_REG_X: + {cc_nxt, x_nxt} = ALU16; + ALU16_REG_D: + {cc_nxt, a_nxt, b_nxt} = ALU16; + ALU16_REG_Y: + {cc_nxt, y_nxt} = ALU16; + ALU16_REG_U: + {cc_nxt, u_nxt} = ALU16; + ALU16_REG_S: + {cc_nxt, s_nxt} = ALU16; + default: + begin + end + endcase + end + else + cc_nxt = ALU16[23:16]; + rAVMA = 1'b0; + CpuState_nxt = CPUSTATE_ALU16_DONTCARE; + end + + CPUSTATE_ALU16_DONTCARE: + begin + addr_nxt = 16'HFFFF; + rLIC = 1'b1; // Instruction done! + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_FETCH_I1; + end + + + CPUSTATE_JSR_DONTCARE: + begin + addr_nxt = 16'HFFFF; + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_JSR_RETLO; + end + + CPUSTATE_JSR_RETLO: + begin + addr_nxt = s_m1; + s_nxt = s_m1; + RnWOut = 0; + DOutput = tmp[7:0]; + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_JSR_RETHI; + end + + CPUSTATE_JSR_RETHI: + begin + addr_nxt = s_m1; + s_nxt = s_m1; + RnWOut = 0; + DOutput = tmp[15:8]; + rLIC = 1'b1; // Instruction done! + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_FETCH_I1; + end + + CPUSTATE_EXTENDED_ADDRLO: + begin + addr_nxt = pc; + pc_nxt = pc_p1; + ea_nxt[7:0] = D[7:0]; + rAVMA = 1'b0; + CpuState_nxt = CPUSTATE_EXTENDED_DONTCARE; + end + + CPUSTATE_EXTENDED_DONTCARE: + begin + addr_nxt = 16'HFFFF; + if (IsJMP(Inst1)) + begin + pc_nxt = ea; + rLIC = 1'b1; // Instruction done! + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_FETCH_I1; + end + else + begin + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_ALU_EA; + end + end + + CPUSTATE_INDEXED_BASE: + begin + addr_nxt = pc; + + Inst3_nxt = D[7:0]; + + case (IndexedRegister) + IDX_REG_X: + ALU16_A = x; + IDX_REG_Y: + ALU16_A = y; + IDX_REG_U: + ALU16_A = u; + IDX_REG_S: + ALU16_A = s; + IDX_REG_PC: + ALU16_A = pc_p1; + default: + ALU16_A = 16'H0; + endcase + ALU16_OP = ALUOP16_ADD; + + case (IndexedMode) + IDX_MODE_NOOFFSET: + begin + case (IndexedRegister) + IDX_REG_X: + ea_nxt = x; + IDX_REG_Y: + ea_nxt = y; + IDX_REG_U: + ea_nxt = u; + IDX_REG_S: + ea_nxt = s; + default: + ea_nxt = 16'H0; + endcase + + if (IndexedIndirect) + begin + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_INDIRECT_HI; + end + else + begin + if (IsJMP(Inst1)) + begin + pc_nxt = ea_nxt; + rLIC = 1'b1; // Instruction done! + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_FETCH_I1; + end + else + begin + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_ALU_EA; + end + end + end + + IDX_MODE_5BIT_OFFSET: + begin + // The offset is the bottom 5 bits of the Index Postbyte, which is Inst2 here. + // We'll sign-extend it to 16 bits. + ALU16_B = { {11{Inst2[4]}}, Inst2[4:0] }; + ea_nxt = ALU16[15:0]; + rAVMA = 1'b0; + CpuState_nxt = CPUSTATE_IDX_DONTCARE3; + end + + + IDX_MODE_8BIT_OFFSET_PC: + begin + ALU16_B = { {8{D[7]}}, D[7:0] }; + pc_nxt = pc_p1; + ea_nxt = ALU16[15:0]; + rAVMA = 1'b0; + CpuState_nxt = CPUSTATE_IDX_DONTCARE3; + end + + IDX_MODE_8BIT_OFFSET: + begin + ALU16_B = { {8{D[7]}}, D[7:0] }; + pc_nxt = pc_p1; + ea_nxt = ALU16[15:0]; + rAVMA = 1'b0; + CpuState_nxt = CPUSTATE_IDX_DONTCARE3; + end + + IDX_MODE_A_OFFSET: + begin + ALU16_B = { {8{a[7]}}, a[7:0] }; + rAVMA = 1'b0; + CpuState_nxt = CPUSTATE_IDX_DONTCARE3; + ea_nxt = ALU16[15:0]; + end + + IDX_MODE_B_OFFSET: + begin + ALU16_B = { {8{b[7]}}, b[7:0] }; + rAVMA = 1'b0; + CpuState_nxt = CPUSTATE_IDX_DONTCARE3; + ea_nxt = ALU16[15:0]; + end + + IDX_MODE_D_OFFSET: + begin + ALU16_B = {a, b}; + + ea_nxt = ALU16[15:0]; + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_IDX_DOFF_DONTCARE1; + end + + IDX_MODE_POSTINC1: + begin + ALU16_B = 16'H1; + ea_nxt = ALU16_A; + case (IndexedRegister) + IDX_REG_X: + x_nxt = ALU16[15:0]; + IDX_REG_Y: + y_nxt = ALU16[15:0]; + IDX_REG_U: + u_nxt = ALU16[15:0]; + IDX_REG_S: + s_nxt = ALU16[15:0]; + default: + begin + end + endcase + rAVMA = 1'b0; + CpuState_nxt = CPUSTATE_IDX_16OFF_DONTCARE2; + end + + IDX_MODE_POSTINC2: + begin + ALU16_B = 16'H2; + ea_nxt = ALU16_A; + case (IndexedRegister) + IDX_REG_X: + x_nxt = ALU16[15:0]; + IDX_REG_Y: + y_nxt = ALU16[15:0]; + IDX_REG_U: + u_nxt = ALU16[15:0]; + IDX_REG_S: + s_nxt = ALU16[15:0]; + default: + begin + end + endcase + rAVMA = 1'b0; + CpuState_nxt = CPUSTATE_IDX_16OFF_DONTCARE0; + end + + IDX_MODE_PREDEC1: + begin + ALU16_B = 16'HFFFF; // -1 + case (IndexedRegister) + IDX_REG_X: + x_nxt = ALU16[15:0]; + IDX_REG_Y: + y_nxt = ALU16[15:0]; + IDX_REG_U: + u_nxt = ALU16[15:0]; + IDX_REG_S: + s_nxt = ALU16[15:0]; + default: + begin + end + endcase + ea_nxt = ALU16[15:0]; + rAVMA = 1'b0; + CpuState_nxt = CPUSTATE_IDX_16OFF_DONTCARE2; + end + + IDX_MODE_PREDEC2: + begin + ALU16_B = 16'HFFFE; // -2 + case (IndexedRegister) + IDX_REG_X: + x_nxt = ALU16[15:0]; + IDX_REG_Y: + y_nxt = ALU16[15:0]; + IDX_REG_U: + u_nxt = ALU16[15:0]; + IDX_REG_S: + s_nxt = ALU16[15:0]; + default: + begin + end + endcase + ea_nxt = ALU16[15:0]; + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_IDX_16OFF_DONTCARE0; + end + + IDX_MODE_16BIT_OFFSET_PC: + begin + tmp_nxt[15:8] = D[7:0]; + pc_nxt = pc_p1; + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_IDX_16OFFSET_LO; + end + + IDX_MODE_16BIT_OFFSET: + begin + tmp_nxt[15:8] = D[7:0]; + pc_nxt = pc_p1; + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_IDX_16OFFSET_LO; + end + + IDX_MODE_EXTENDED_INDIRECT: + begin + ea_nxt[15:8] = D[7:0]; + pc_nxt = pc_p1; + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_IDX_EXTIND_LO; + end + + default: + begin + rLIC = 1'b1; + CpuState_nxt = PostIllegalState; + end + + endcase + end + + CPUSTATE_IDX_OFFSET_LO: + begin + tmp_nxt[7:0] = D[7:0]; + addr_nxt = pc; + pc_nxt = pc_p1; + ALU16_B = tmp_nxt; + + case (IndexedRegister) + IDX_REG_X: + ALU16_A = x; + IDX_REG_Y: + ALU16_A = y; + IDX_REG_U: + ALU16_A = u; + IDX_REG_S: + ALU16_A = s; + IDX_REG_PC: + ALU16_A = pc; + default: + ALU16_A = 16'H0; + endcase + ALU16_OP = ALUOP16_ADD; + + ea_nxt = ALU16[15:0]; + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_IDX_16OFF_DONTCARE1; + end + + + CPUSTATE_IDX_DONTCARE3: + begin + addr_nxt = 16'HFFFF; + if (IndexedIndirect) + begin + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_INDIRECT_HI; + end + else + begin + if (IsJMP(Inst1)) + begin + pc_nxt = ea; + rLIC = 1'b1; // Instruction done! + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_FETCH_I1; + end + else + begin + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_ALU_EA; + end + end + + end + + CPUSTATE_IDX_16OFFSET_LO: + begin + addr_nxt = pc; + pc_nxt = pc_p1; + + case (IndexedRegister) + IDX_REG_X: + ALU16_A = x; + IDX_REG_Y: + ALU16_A = y; + IDX_REG_U: + ALU16_A = u; + IDX_REG_S: + ALU16_A = s; + IDX_REG_PC: + ALU16_A = pc_nxt; // Whups; tricky; not part of the actual pattern + default: + ALU16_A = x; // Default to something + endcase + + ALU16_OP = ALUOP16_ADD; + + ALU16_B = {tmp[15:8], D[7:0]}; + + ea_nxt = ALU16[15:0]; + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_IDX_16OFF_DONTCARE1; + end + + CPUSTATE_IDX_16OFF_DONTCARE1: + begin + addr_nxt = pc; + rAVMA = 1'b0; + CpuState_nxt = CPUSTATE_IDX_16OFF_DONTCARE2; + end + + CPUSTATE_IDX_16OFF_DONTCARE0: + begin + addr_nxt = 16'HFFFF; + rAVMA = 1'b0; + CpuState_nxt = CPUSTATE_IDX_16OFF_DONTCARE2; + end + + CPUSTATE_IDX_16OFF_DONTCARE2: + begin + addr_nxt = 16'HFFFF; + if (IndexedRegister == IDX_REG_PC) + begin + rAVMA = 1'b0; + CpuState_nxt = CPUSTATE_IDX_PC16OFF_DONTCARE; + end + else + begin + rAVMA = 1'b0; + CpuState_nxt = CPUSTATE_IDX_16OFF_DONTCARE3; + end + end + + CPUSTATE_IDX_PC16OFF_DONTCARE: + begin + addr_nxt = 16'HFFFF; + rAVMA = 1'b0; + CpuState_nxt = CPUSTATE_IDX_16OFF_DONTCARE3; + end + + + CPUSTATE_IDX_16OFF_DONTCARE3: + begin + addr_nxt = 16'HFFFF; + if (IndexedIndirect) + begin + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_INDIRECT_HI; + end + else + begin + if (IsJMP(Inst1)) + begin + pc_nxt = ea; + rLIC = 1'b1; // Instruction done! + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_FETCH_I1; + end + else + begin + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_ALU_EA; + end + end + end + + CPUSTATE_IDX_DOFF_DONTCARE1: + begin + addr_nxt = pc_p1; + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_IDX_DOFF_DONTCARE2; + end + + CPUSTATE_IDX_DOFF_DONTCARE2: + begin + addr_nxt = pc_p2; + rAVMA = 1'b0; + CpuState_nxt = CPUSTATE_IDX_16OFF_DONTCARE2; + end + + CPUSTATE_IDX_DOFF_DONTCARE3: + begin + addr_nxt = pc_p3; + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_IDX_DOFF_DONTCARE2; + end + + CPUSTATE_IDX_EXTIND_LO: + begin + ea_nxt[7:0] = D[7:0]; + addr_nxt = pc; + pc_nxt = pc_p1; + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_IDX_EXTIND_DONTCARE; + end + + CPUSTATE_IDX_EXTIND_DONTCARE: + begin + addr_nxt = pc; + if (IndexedIndirect) + begin + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_INDIRECT_HI; + end + else + begin + if (IsJMP(Inst1)) + begin + pc_nxt = ea; + rLIC = 1'b1; // Instruction done! + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_FETCH_I1; + end + else + begin + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_ALU_EA; + end + end + end + + CPUSTATE_INDIRECT_HI: + begin + addr_nxt = ea; + tmp_nxt[15:8] = D[7:0]; + rAVMA = 1'b1; + rBUSY = 1'b1; + CpuState_nxt = CPUSTATE_INDIRECT_LO; + end + + CPUSTATE_INDIRECT_LO: + begin + addr_nxt = ea_p1; + ea_nxt[15:8] = tmp_nxt[15:8]; + ea_nxt[7:0] = D[7:0]; + rAVMA = 1'b0; + CpuState_nxt = CPUSTATE_INDIRECT_DONTCARE; + end + + CPUSTATE_INDIRECT_DONTCARE: + begin + addr_nxt = 16'HFFFF; + if (IsJMP(Inst1)) + begin + pc_nxt = ea; + rLIC = 1'b1; // Instruction done! + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_FETCH_I1; + end + else + begin + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_ALU_EA; + end + end + + CPUSTATE_MUL_ACTION: + begin + addr_nxt = 16'HFFFF; + rAVMA = 1'b0; + // tmp = result + // ea = additor (the shifted multiplicand) + // a = counter + // b is the multiplier (which gets shifted right) + if (a != 8'H00) + begin + if (b[0]) + begin + tmp_nxt = tmp + ea; + end + ea_nxt = {ea[14:0], 1'b0}; + b_nxt = {1'b0, b[7:1]}; + a_nxt = a - 8'H1; + end + else + begin + {a_nxt, b_nxt} = tmp; + + cc_nxt[CC_Z_BIT] = (tmp == 0); + cc_nxt[CC_C_BIT] = tmp[7]; + rLIC = 1'b1; // Instruction done! + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_FETCH_I1; + end + end + + CPUSTATE_PSH_DONTCARE1: + begin + addr_nxt = 16'HFFFF; + rAVMA = 1'b0; + CpuState_nxt = CPUSTATE_PSH_DONTCARE2; + end + + CPUSTATE_PSH_DONTCARE2: + begin + addr_nxt = 16'HFFFF; + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_PSH_DONTCARE3; + end + + CPUSTATE_PSH_DONTCARE3: + begin + addr_nxt = (Inst1[1]) ? u : s; + + CpuState_nxt = CPUSTATE_PSH_ACTION; + end + + CPUSTATE_PSH_ACTION: + begin + rAVMA = 1'b1; + if (tmp[7] & ~(tmp[15])) // PC_LO + begin + addr_nxt = (tmp[14]) ? u_m1 : s_m1; + if (tmp[14]) + u_nxt = u_m1; + else + s_nxt = s_m1; + DOutput = pc[7:0]; + RnWOut = 1'b0; // write + tmp_nxt[15] = 1'b1; + end + else if (tmp[7] & (tmp[15])) // PC_HI + begin + addr_nxt = (tmp[14]) ? u_m1 : s_m1; + if (tmp[14]) + u_nxt = u_m1; + else + s_nxt = s_m1; + DOutput = pc[15:8]; + RnWOut = 1'b0; // write + tmp_nxt[7] = 1'b0; + tmp_nxt[15] = 1'b0; + end + else if (tmp[6] & ~(tmp[15])) // U/S_LO + begin + addr_nxt = (tmp[14]) ? u_m1 : s_m1; + if (tmp[14]) + u_nxt = u_m1; + else + s_nxt = s_m1; + DOutput = (tmp[14]) ? s[7:0] : u[7:0]; + RnWOut = 1'b0; // write + tmp_nxt[15] = 1'b1; + end + else if (tmp[6] & (tmp[15])) // U/S_HI + begin + addr_nxt = (tmp[14]) ? u_m1 : s_m1; + if (tmp[14]) + u_nxt = u_m1; + else + s_nxt = s_m1; + DOutput = (tmp[14]) ? s[15:8] : u[15:8]; + RnWOut = 1'b0; // write + tmp_nxt[6] = 1'b0; + tmp_nxt[15] = 1'b0; + end + else if (tmp[5] & ~(tmp[15])) // Y_LO + begin + addr_nxt = (tmp[14]) ? u_m1 : s_m1; + if (tmp[14]) + u_nxt = u_m1; + else + s_nxt = s_m1; + DOutput = y[7:0]; + RnWOut = 1'b0; // write + tmp_nxt[15] = 1'b1; + end + else if (tmp[5] & (tmp[15])) // Y_HI + begin + addr_nxt = (tmp[14]) ? u_m1 : s_m1; + if (tmp[14]) + u_nxt = u_m1; + else + s_nxt = s_m1; + DOutput = y[15:8]; + RnWOut = 1'b0; // write + tmp_nxt[5] = 1'b0; + tmp_nxt[15] = 1'b0; + end + else if (tmp[4] & ~(tmp[15])) // X_LO + begin + addr_nxt = (tmp[14]) ? u_m1 : s_m1; + if (tmp[14]) + u_nxt = u_m1; + else + s_nxt = s_m1; + DOutput = x[7:0]; + RnWOut = 1'b0; // write + tmp_nxt[15] = 1'b1; + end + else if (tmp[4] & (tmp[15])) // X_HI + begin + addr_nxt = (tmp[14]) ? u_m1 : s_m1; + if (tmp[14]) + u_nxt = u_m1; + else + s_nxt = s_m1; + DOutput = x[15:8]; + RnWOut = 1'b0; // write + tmp_nxt[4] = 1'b0; + tmp_nxt[15] = 1'b0; + end + else if (tmp[3]) // DP + begin + addr_nxt = (tmp[14]) ? u_m1 : s_m1; + if (tmp[14]) + u_nxt = u_m1; + else + s_nxt = s_m1; + DOutput = dp; + RnWOut = 1'b0; // write + tmp_nxt[3] = 1'b0; + end + else if (tmp[2]) // B + begin + addr_nxt = (tmp[14]) ? u_m1 : s_m1; + if (tmp[14]) + u_nxt = u_m1; + else + s_nxt = s_m1; + DOutput = b; + RnWOut = 1'b0; // write + tmp_nxt[2] = 1'b0; + end + else if (tmp[1]) // A + begin + addr_nxt = (tmp[14]) ? u_m1 : s_m1; + if (tmp[14]) + u_nxt = u_m1; + else + s_nxt = s_m1; + DOutput = a; + RnWOut = 1'b0; // write + tmp_nxt[1] = 1'b0; + end + else if (tmp[0]) // CC + begin + addr_nxt = (tmp[14]) ? u_m1 : s_m1; + if (tmp[14]) + u_nxt = u_m1; + else + s_nxt = s_m1; + DOutput = cc; + RnWOut = 1'b0; // write + tmp_nxt[0] = 1'b0; + end + if (tmp[13]) // Then we're pushing for an IRQ, and LIC is supposed to be set. + rLIC = 1'b1; + if (tmp_nxt[7:0] == 8'H00) + begin + if (NextState == CPUSTATE_FETCH_I1) + begin + rAVMA = 1'b1; + rLIC = 1'b1; + end + else + rAVMA = 1'b0; + CpuState_nxt = NextState; + end + end + + CPUSTATE_PUL_DONTCARE1: + begin + addr_nxt = 16'HFFFF; + rAVMA = 1'b0; + CpuState_nxt = CPUSTATE_PUL_DONTCARE2; + end + + CPUSTATE_PUL_DONTCARE2: + begin + addr_nxt = 16'HFFFF; + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_PUL_ACTION; + end + + CPUSTATE_PUL_ACTION: + begin + rAVMA = 1'b1; + if (tmp[0]) // CC + begin + addr_nxt = (tmp[14]) ? u : s; + if (tmp[14]) + u_nxt = u_p1; + else + s_nxt = s_p1; + cc_nxt = D[7:0]; + if (tmp[12] == 1'b1) // This pull is from an RTI, the E flag comes from the retrieved CC, and set the tmp_nxt accordingly, indicating what other registers to retrieve + begin + if (D[CC_E_BIT]) + tmp_nxt[7:0] = 8'HFE; // Retrieve all registers (ENTIRE) [CC is already retrieved] + else + tmp_nxt[7:0] = 8'H80; // Retrieve PC and CC [CC is already retrieved] + end + else + tmp_nxt[0] = 1'b0; + end + else if (tmp[1]) // A + begin + addr_nxt = (tmp[14]) ? u : s; + if (tmp[14]) + u_nxt = u_p1; + else + s_nxt = s_p1; + a_nxt = D[7:0]; + tmp_nxt[1] = 1'b0; + end + else if (tmp[2]) // B + begin + addr_nxt = (tmp[14]) ? u : s; + if (tmp[14]) + u_nxt = u_p1; + else + s_nxt = s_p1; + b_nxt = D[7:0]; + tmp_nxt[2] = 1'b0; + end + else if (tmp[3]) // DP + begin + addr_nxt = (tmp[14]) ? u : s; + if (tmp[14]) + u_nxt = u_p1; + else + s_nxt = s_p1; + dp_nxt = D[7:0]; + tmp_nxt[3] = 1'b0; + end + else if (tmp[4] & (~tmp[15])) // X_HI + begin + addr_nxt = (tmp[14]) ? u : s; + if (tmp[14]) + u_nxt = u_p1; + else + s_nxt = s_p1; + x_nxt[15:8] = D[7:0]; + tmp_nxt[15] = 1'b1; + end + else if (tmp[4] & tmp[15]) // X_LO + begin + addr_nxt = (tmp[14]) ? u : s; + if (tmp[14]) + u_nxt = u_p1; + else + s_nxt = s_p1; + x_nxt[7:0] = D[7:0]; + tmp_nxt[4] = 1'b0; + tmp_nxt[15] = 1'b0; + end + else if (tmp[5] & (~tmp[15])) // Y_HI + begin + addr_nxt = (tmp[14]) ? u : s; + if (tmp[14]) + u_nxt = u_p1; + else + s_nxt = s_p1; + y_nxt[15:8] = D[7:0]; + tmp_nxt[15] = 1'b1; + end + else if (tmp[5] & tmp[15]) // Y_LO + begin + addr_nxt = (tmp[14]) ? u : s; + if (tmp[14]) + u_nxt = u_p1; + else + s_nxt = s_p1; + y_nxt[7:0] = D[7:0]; + tmp_nxt[5] = 1'b0; + tmp_nxt[15] = 1'b0; + end + else if (tmp[6] & (~tmp[15])) // U/S_HI + begin + addr_nxt = (tmp[14]) ? u : s; + if (tmp[14]) + u_nxt = u_p1; + else + s_nxt = s_p1; + if (tmp[14]) + s_nxt[15:8] = D[7:0]; + else + u_nxt[15:8] = D[7:0]; + tmp_nxt[15] = 1'b1; + end + else if (tmp[6] & tmp[15]) // U/S_LO + begin + addr_nxt = (tmp[14]) ? u : s; + if (tmp[14]) + u_nxt = u_p1; + else + s_nxt = s_p1; + if (tmp[14]) + s_nxt[7:0] = D[7:0]; + else + u_nxt[7:0] = D[7:0]; + tmp_nxt[6] = 1'b0; + tmp_nxt[15] = 1'b0; + end + else if (tmp[7] & (~tmp[15])) // PC_HI + begin + addr_nxt = (tmp[14]) ? u : s; + if (tmp[14]) + u_nxt = u_p1; + else + s_nxt = s_p1; + pc_nxt[15:8] = D[7:0]; + tmp_nxt[15] = 1'b1; + end + else if (tmp[7] & tmp[15]) // PC_LO + begin + addr_nxt = (tmp[14]) ? u : s; + if (tmp[14]) + u_nxt = u_p1; + else + s_nxt = s_p1; + pc_nxt[7:0] = D[7:0]; + tmp_nxt[7] = 1'b0; + tmp_nxt[15] = 1'b0; + end + else + begin + addr_nxt = (tmp[14]) ? u : s; + if (NextState == CPUSTATE_FETCH_I1) + begin + rAVMA = 1'b1; + rLIC = 1'b1; + end + else + rAVMA = 1'b0; + CpuState_nxt = NextState; + end + end + + CPUSTATE_NMI_START: + begin + NMIClear_nxt = 1'b1; + addr_nxt = pc; + // tmp stands as the bits to push to the stack + tmp_nxt = 16'H20FF; // Save to the S stack, PC, U, Y, X, DP, B, A, CC; set LIC on every push + NextState_nxt = CPUSTATE_IRQ_DONTCARE2; + rAVMA = 1'b0; + CpuState_nxt = CPUSTATE_IRQ_DONTCARE; + IntType_nxt = INTTYPE_NMI; + cc_nxt[CC_E_BIT] = 1'b1; + end + + CPUSTATE_IRQ_START: + begin + addr_nxt = pc; + tmp_nxt = 16'H20FF; // Save to the S stack, PC, U, Y, X, DP, B, A, CC; set LIC on every push + NextState_nxt = CPUSTATE_IRQ_DONTCARE2; + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_IRQ_DONTCARE; + IntType_nxt = INTTYPE_IRQ; + cc_nxt[CC_E_BIT] = 1'b1; + end + + CPUSTATE_FIRQ_START: + begin + addr_nxt = pc; + tmp_nxt = 16'H2081; // Save to the S stack, PC, CC; set LIC on every push + NextState_nxt = CPUSTATE_IRQ_DONTCARE2; + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_IRQ_DONTCARE; + IntType_nxt = INTTYPE_FIRQ; + cc_nxt[CC_E_BIT] = 1'b0; + end + + CPUSTATE_SWI_START: + begin + addr_nxt = pc; + tmp_nxt = 16'H00FF; // Save to the S stack, PC, U, Y, X, DP, B, A, CC + + NextState_nxt = CPUSTATE_IRQ_DONTCARE2; + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_IRQ_DONTCARE; + if (InstPage3) + IntType_nxt = INTTYPE_SWI3; + if (InstPage2) + IntType_nxt = INTTYPE_SWI2; + else + IntType_nxt = INTTYPE_SWI; + + cc_nxt[CC_E_BIT] = 1'b1; + end + + CPUSTATE_IRQ_DONTCARE: + begin + NMIClear_nxt = 1'b0; + addr_nxt = 16'HFFFF; + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_PSH_ACTION; + end + + + CPUSTATE_IRQ_DONTCARE2: + begin + addr_nxt = 16'HFFFF; + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_IRQ_VECTOR_HI; + rLIC = 1'b1; + end + + CPUSTATE_IRQ_VECTOR_HI: + begin + case (IntType) + INTTYPE_NMI: + begin + addr_nxt = `NMI_VECTOR; + BS_nxt = 1'b1; // ACK Interrupt + end + INTTYPE_IRQ: + begin + addr_nxt = `IRQ_VECTOR; + BS_nxt = 1'b1; // ACK Interrupt + end + INTTYPE_SWI: + begin + addr_nxt = `SWI_VECTOR; + end + INTTYPE_FIRQ: + begin + addr_nxt = `FIRQ_VECTOR; + BS_nxt = 1'b1; // ACK Interrupt + end + INTTYPE_SWI2: + begin + addr_nxt = `SWI2_VECTOR; + end + INTTYPE_SWI3: + begin + addr_nxt = `SWI3_VECTOR; + end + default: // make the default an IRQ, even though it really should never happen + begin + addr_nxt = `IRQ_VECTOR; + BS_nxt = 1'b1; // ACK Interrupt + end + endcase + + pc_nxt[15:8] = D[7:0]; + rAVMA = 1'b1; + rBUSY = 1'b1; + rLIC = 1'b1; + CpuState_nxt = CPUSTATE_IRQ_VECTOR_LO; + + + end + + CPUSTATE_IRQ_VECTOR_LO: + begin + case (IntType) + INTTYPE_NMI: + begin + addr_nxt = `NMI_VECTOR+16'H1; + cc_nxt[CC_I_BIT] = 1'b1; + cc_nxt[CC_F_BIT] = 1'b1; + BS_nxt = 1'b1; // ACK Interrupt + end + INTTYPE_IRQ: + begin + addr_nxt = `IRQ_VECTOR+16'H1; + cc_nxt[CC_I_BIT] = 1'b1; + BS_nxt = 1'b1; // ACK Interrupt + end + INTTYPE_SWI: + begin + addr_nxt = `SWI_VECTOR+16'H1; + cc_nxt[CC_F_BIT] = 1'b1; + cc_nxt[CC_I_BIT] = 1'b1; + rLIC = 1'b1; + end + INTTYPE_FIRQ: + begin + addr_nxt = `FIRQ_VECTOR+16'H1; + cc_nxt[CC_F_BIT] = 1'b1; + cc_nxt[CC_I_BIT] = 1'b1; + BS_nxt = 1'b1; // ACK Interrupt + end + INTTYPE_SWI2: + begin + addr_nxt = `SWI2_VECTOR+16'H1; + rLIC = 1'b1; + end + INTTYPE_SWI3: + begin + addr_nxt = `SWI3_VECTOR+16'H1; + rLIC = 1'b1; + end + default: + begin + end + endcase + + pc_nxt[7:0] = D[7:0]; + rAVMA = 1'b1; + rLIC = 1'b1; + CpuState_nxt = CPUSTATE_INT_DONTCARE; + end + + CPUSTATE_INT_DONTCARE: + begin + addr_nxt = 16'HFFFF; + rAVMA = 1'b1; + rLIC = 1'b1; + CpuState_nxt = CPUSTATE_FETCH_I1; + end + + CPUSTATE_CC_DONTCARE: + begin + addr_nxt = pc; + rLIC = 1'b1; + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_FETCH_I1; + end + + CPUSTATE_TST_DONTCARE1: + begin + addr_nxt = 16'HFFFF; + rAVMA = 1'b0; + CpuState_nxt = CPUSTATE_TST_DONTCARE2; + end + + CPUSTATE_TST_DONTCARE2: + begin + addr_nxt = 16'HFFFF; + rLIC = 1'b1; + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_FETCH_I1; + end + + CPUSTATE_DEBUG: + begin + addr_nxt = tmp; + rLIC = 1'b1; + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_FETCH_I1; + end + + CPUSTATE_16IMM_DONTCARE: + begin + addr_nxt = 16'HFFFF; + rLIC = 1'b1; + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_FETCH_I1; + end + + CPUSTATE_SYNC: + begin + addr_nxt = 16'HFFFF; + BA_nxt = 1'b1; + rLIC = 1'b1; + rAVMA = 1'b0; + + if (~(NMILatched & FIRQLatched & IRQLatched)) + begin + CpuState_nxt = CPUSTATE_SYNC_EXIT; + end + end + + CPUSTATE_SYNC_EXIT: + begin + addr_nxt = 16'HFFFF; + BA_nxt = 1'b1; + rLIC = 1'b1; + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_FETCH_I1; + end + + + CPUSTATE_DMABREQ: + begin + rAVMA = 1'b0; + addr_nxt = 16'HFFFF; + BS_nxt = 1'b1; + BA_nxt = 1'b1; + rLIC = 1'b1; + tmp_nxt[3:0] = tmp[3:0] - 1'b1; + if ( (tmp[3:0] == 4'H0) | (DMABREQSample2) ) + begin + CpuState_nxt = CPUSTATE_DMABREQ_EXIT; + end + end + + CPUSTATE_DMABREQ_EXIT: + begin + addr_nxt = 16'HFFFF; + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_FETCH_I1; + end + + CPUSTATE_HALTED: + begin + rAVMA = 1'b0; + addr_nxt = 16'HFFFF; + BS_nxt = 1'b1; + BA_nxt = 1'b1; + rLIC = 1'b1; + if (HALTSample2) + begin + CpuState_nxt = CPUSTATE_HALT_EXIT2; + end + end + + + CPUSTATE_HALT_EXIT2: + begin + addr_nxt = 16'HFFFF; + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_FETCH_I1; + end + + CPUSTATE_STOP: + begin + addr_nxt = 16'HDEAD; + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_STOP2; + end + + CPUSTATE_STOP2: + begin + addr_nxt = pc; + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_STOP3; + end + + CPUSTATE_STOP3: + begin + addr_nxt = 16'H0000; //{Inst1, Inst2}; + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_STOP; + end + + // The otherwise critically useful Figure 18 in the 6809 datasheet contains an error; + // it lists that CWAI has a tri-stated bus while it waits for an interrupt. + // That is not true. SYNC tristates the bus, as do things like /HALT and /DMABREQ. + // CWAI does not. It waits with /VMA cycles on the bus until an interrupt occurs. + // The implementation here fits with the 6809 Programming Manual and other Motorola + // sources, not with that typo in Figure 18. + CPUSTATE_CWAI: + begin + addr_nxt = pc; + cc_nxt = {1'b1, (cc[6:0] & Inst2[6:0])}; // Set E flag, AND CC with CWAI argument + tmp_nxt = 16'H00FF; // Save to the S stack, PC, U, Y, X, DP, B, A, CC + + NextState_nxt = CPUSTATE_CWAI_POST; + rAVMA = 1'b0; + CpuState_nxt = CPUSTATE_CWAI_DONTCARE1; + end + + CPUSTATE_CWAI_DONTCARE1: + begin + addr_nxt = 16'HFFFF; + rAVMA = 1'b1; + CpuState_nxt = CPUSTATE_PSH_ACTION; + end + + CPUSTATE_CWAI_POST: + begin + addr_nxt = 16'HFFFF; + rAVMA = 1'b0; + + CpuState_nxt = CPUSTATE_CWAI_POST; + + // Wait for an interrupt + if (NMILatched == 0) + begin + rAVMA = 1'b1; + IntType_nxt = INTTYPE_NMI; + cc_nxt[CC_F_BIT] = 1'b1; + cc_nxt[CC_I_BIT] = 1'b1; + CpuState_nxt = CPUSTATE_IRQ_VECTOR_HI; + end + else if ((FIRQLatched == 0) && (cc[CC_F_BIT] == 0)) + begin + rAVMA = 1'b1; + cc_nxt[CC_F_BIT] = 1'b1; + cc_nxt[CC_I_BIT] = 1'b1; + IntType_nxt = INTTYPE_FIRQ; + CpuState_nxt = CPUSTATE_IRQ_VECTOR_HI; + end + else if ((IRQLatched == 0) && (cc[CC_I_BIT] == 0)) + begin + rAVMA = 1'b1; + cc_nxt[CC_I_BIT] = 1'b1; + IntType_nxt = INTTYPE_IRQ; + CpuState_nxt = CPUSTATE_IRQ_VECTOR_HI; + end + end + + default: // Picky darned Verilog. + begin + CpuState_nxt = PostIllegalState; + end + + endcase +end + +endmodule + diff --git a/rtl/sdc.sv b/rtl/sdc.sv index 1b31b18..2ae4b47 100644 --- a/rtl/sdc.sv +++ b/rtl/sdc.sv @@ -47,6 +47,9 @@ //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// +// Define Config features +`include "..\RTL\config.v" + module sdc( input CLK, // clock input RESET_N, // async reset @@ -59,26 +62,31 @@ module sdc( input SDC_WR, input SDC_RD, - output sdc_always, - output reg sdc_HALT, + output reg ext_response, + output reg sdc_always, + // SD block level interface - input [1:0] img_mounted, // signaling that new image has been mounted - input img_readonly, // mounted as read only. valid only for active bit in img_mounted - input [19:0] img_size, // size of image in bytes. 1MB MAX! - output [31:0] sd_lba[2], output reg [1:0] sd_rd, output reg [1:0] sd_wr, input [1:0] sd_ack, +// Drive descripters + + input drive_wp[2], + input [1:0] drive_ready, + input [31:0] drive_size[2], + + // SD byte level access. Signals for 2-PORT altsyncram. input [8:0] sd_buff_addr, input [7:0] sd_buff_dout, output [7:0] sd_buff_din[2], input sd_buff_wr + ); reg [23:0] LSN; @@ -87,36 +95,35 @@ reg [7:0] transfer_address; reg new_cmd, new_cmd_d, cmd_done; reg data_inc, run; +reg rxt_res_end; reg transfer_clear; reg [3:0] sdc_data_reg; wire [7:0] sdc_status_reg = {sdc_data_reg, 4'h4}; -reg [15:0] drive_size[2]; -typedef enum +enum int unsigned { - state_idle, + state_idle = 0, - state_read, - state_r1, - state_r1a, - state_r2, - state_r3, - state_r4, + state_read = 1, + state_r1 = 2, + state_r1a = 3, + state_r2 = 4, + state_r3 = 5, + state_r4 = 6, - state_write, - state_w1, - state_w1a, - state_w2, - state_w3, + state_write = 7, + state_w1 = 8, + state_w1a = 9, + state_w2 = 10, + state_w3 = 11, + state_w4 = 12, - state_ext, - state_e1, - state_e2 + state_ext = 13, + state_e1 = 14, + state_e2 = 15 -} state_t; - -state_t state = state_idle; +} state; localparam ADRS_FF42 = 4'h2; localparam ADRS_FF43 = 4'h3; @@ -125,6 +132,7 @@ localparam ADRS_FF49 = 4'h9; localparam ADRS_FF4A = 4'hA; localparam ADRS_FF4B = 4'hB; + always @(negedge CLK or negedge RESET_N) begin if(!RESET_N) @@ -133,17 +141,18 @@ begin command <= 8'h00; new_cmd <= 1'b0; data_inc <= 1'b0; + rxt_res_end <= 1'b0; transfer_address <= 8'h00; sdc_data_reg <= 4'h0; end else begin data_inc <= 1'b0; - + rxt_res_end <= 1'b0; if (cmd_done) new_cmd <= 1'b0; - if (SDC_WR) //Write + if (CLK_EN & SDC_WR) //Write begin case(ADDRESS) ADRS_FF42: // $ff42 @@ -152,7 +161,7 @@ begin endcase end - if ((SDC_EN | sdc_always) & SDC_WR) //Write + if (SDC_EN & CLK_EN & SDC_WR) //Write begin case(ADDRESS) @@ -180,14 +189,19 @@ begin if (~run) LSN[7:0] <= SDC_DATA_IN; else + begin data_inc <= 1'b1; + end end endcase end - if (CLK_EN & SDC_RD & (ADDRESS[3:1] == 3'b101) & (run)) // Read @ $ff4A / $ff4B + if (CLK_EN & SDC_RD & (ADDRESS[3:1] == 3'b101) & (run)) // Read @ $ff4A / $ff4B data_inc <= 1'b1; + if (CLK_EN & SDC_RD & (ADDRESS[3:0] == 4'b1001) & (~run)) // Read @ $ff49 [last of size data] + rxt_res_end <= 1'b1; + if (data_inc) transfer_address <= transfer_address + 1'b1; @@ -205,11 +219,11 @@ localparam CMD_EXT = 5'b11000; reg wr_cmd; reg ack_d; -reg ext_response; reg [23:0] response_reg; wire end_ack = ~sd_ack[l_drive] & ack_d; reg l_drive, buffer_upper; - +reg time_clr; +reg [13:0] delay_time; always @(negedge CLK or negedge RESET_N) begin @@ -236,6 +250,8 @@ begin sdc_HALT <= 1'b0; l_drive <= 1'b0; buffer_upper <= 1'b0; + time_clr <= 1'b1; + delay_time <= 14'b00000000000000; end else begin @@ -244,18 +260,21 @@ begin ack_d <= sd_ack[l_drive]; - if (~(SDC_EN | sdc_always)) - begin - sdc_busy <= 1'b1; - sdc_ready <= 1'b0; - end + delay_time <= delay_time + 1'b1; + if (time_clr) + delay_time <= 14'b00000000000000; + + if (rxt_res_end) // If we read ff4b then we've read the ext_response + ext_response <= 1'b0; case(state) state_idle: begin sdc_busy <= 1'b0; + sdc_ready <= 1'b0; run <= 1'b0; wr_cmd <= 1'b0; + time_clr <= 1'b1; transfer_clear <= 1'b1; if (new_cmd & ~new_cmd_d) if (command[7:3] == CMD_READ) @@ -271,35 +290,34 @@ begin state <= state_ext; end else // no valid command found + begin cmd_done <= 1'b1; + sdc_fail <= 1'b1; + end end state_read: begin sdc_busy <= 1'b1; - if (~sdc_HALT) - begin - buffer_upper <= LSN[0]; - l_drive <= command[0]; - ext_response <= 1'b0; - transfer_clear <= 1'b0; - run <= 1'b1; + buffer_upper <= LSN[0]; + l_drive <= command[0]; + ext_response <= 1'b0; // If we have not read the ext_response by now we are not going too + transfer_clear <= 1'b0; + run <= 1'b1; - if (command[7:3] == CMD_WRITE) - wr_cmd <= 1'b1; + if (command[7:3] == CMD_WRITE) + wr_cmd <= 1'b1; // Issue sda read command... - if (~command[0]) // This reference to the drive must be to the command register as l_drive has not yet updated - sd_lba[0] <= {8'h00, 1'b0, LSN[23:1]}; - else - sd_lba[1] <= {8'h00, 1'b0, LSN[23:1]}; - state <= state_r1; - end + if (~command[0]) // This reference to the drive must be to the command register as l_drive has not yet updated + sd_lba[0] <= {8'h00, 1'b0, LSN[23:1]}; + else + sd_lba[1] <= {8'h00, 1'b0, LSN[23:1]}; + state <= state_r1; end state_r1: begin sd_rd[l_drive] <= 1'b1; state <= state_r1a; - sdc_HALT <= 1'b1; end state_r1a: if (sd_ack[l_drive]) @@ -311,7 +329,6 @@ begin begin if (sd_ack[l_drive] & sd_buff_wr & (sd_buff_addr == 9'b111111111)) // wait for the last ack begin - sdc_HALT <= 1'b0; sdc_ready <= 1'b1; if (wr_cmd) state <= state_write; @@ -323,7 +340,6 @@ begin begin if ((transfer_address == 8'hff) & CLK_EN & SDC_RD & (ADDRESS[3:1] == 3'b101)) // wait for the last read begin - sdc_fail <= 1'b0; cmd_done <= 1'b1; sdc_ready <= 1'b0; sdc_busy <= 1'b0; @@ -334,7 +350,7 @@ begin state_write: begin - if ((transfer_address == 8'hff) & SDC_WR & (ADDRESS[3:1] == 3'b101)) // wait for the last write + if ((transfer_address == 8'hff) & CLK_EN & SDC_WR & (ADDRESS[3:1] == 3'b101)) // wait for the last write begin state <= state_w1; end @@ -353,11 +369,20 @@ begin end state_w3: begin - if (end_ack & sdc_HALT) // wait for the end of ack... + time_clr <= 1'b1; + if (end_ack) // wait for the end of ack... + begin + state <= state_w4; + end + end + state_w4: + begin + time_clr <= 1'b0; + if (delay_time[13]) // wait for .1ms... begin sdc_HALT <= 1'b0; - sdc_fail <= 1'b0; wr_cmd <= 1'b0; + cmd_done <= 1'b1; sdc_ready <= 1'b0; sdc_busy <= 1'b0; @@ -372,34 +397,41 @@ begin sdc_busy <= 1'b1; state <= state_e1; end -// else if (LSN[23:16] == 8'H67) // This is g [Disable FDC emulation] -// begin -// cmd_done <= 1'b1; -// sdc_always <= 1'b1; // Disable floppy -// state <= state_idle; -// end + else if (LSN[23:16] == 8'H67) // This is g [Disable FDC emulation] [Used by OS9] + begin + cmd_done <= 1'b1; + sdc_always <= 1'b1; // Disable floppy + state <= state_idle; + end else begin cmd_done <= 1'b1; // All other ext commands... + sdc_fail <= 1'b1; state <= state_idle; end end state_e1: begin - sdc_busy <= 1'b0; ext_response <= 1'b1; - response_reg <= {8'h00, drive_size[l_drive]}; + + `ifdef CoCo3_sdc_override_size + response_reg <= 24'h555555; // This fixes a redirect error in OS9EOU - Value=no hardware + `else + response_reg <= drive_size[l_drive][31:8]; // This returns the correct size of the mounted drive in sectors + `endif state <= state_e2; end state_e2: begin + sdc_busy <= 1'b0; cmd_done <= 1'b1; state <= state_idle; end endcase + end end @@ -407,12 +439,12 @@ wire [7:0] hd_buff_data; wire [7:0] sd_buf_out; -assign sd_buff_din[0] = (~l_drive) ? sd_buf_out: - 8'h00; -assign sd_buff_din[1] = (l_drive) ? sd_buf_out: - 8'h00; +// Both drives cannot be executing a read or write at the same time. Both use the same sd sector buffer +assign sd_buff_din[0] = sd_buf_out; + +assign sd_buff_din[1] = sd_buf_out; sdc_dpram hd_buff ( @@ -424,44 +456,24 @@ sdc_dpram hd_buff .address_b({buffer_upper, transfer_address}), .data_b(SDC_DATA_IN), - .wren_b((SDC_EN | sdc_always) & SDC_WR & (ADDRESS[3:1] == 3'b101)), + .wren_b(SDC_EN & CLK_EN & SDC_WR & (ADDRESS[3:1] == 3'b101)), .q_b(hd_buff_data) ); -wire [1:0] drive_wp; -reg [1:0] drive_ready = 2'b00; wire [7:0] sdc_status; assign sdc_status = {sdc_fail, drive_wp[l_drive], 1'b0, ~drive_ready[l_drive], 2'b00, sdc_ready, sdc_busy}; assign SDC_READ_DATA = (ADDRESS == ADRS_FF42) ? {sdc_data_reg, 4'h0}: (ADDRESS == ADRS_FF43) ? sdc_status_reg: - ((ADDRESS == ADRS_FF48) & ~ext_response) ? sdc_status: - ((ADDRESS == ADRS_FF48) & ext_response) ? response_reg[23:16]: + (ADDRESS == ADRS_FF48) ? sdc_status: + (ADDRESS == ADRS_FF49) ? response_reg[23:16]: ((ADDRESS == ADRS_FF4A) & ~ext_response) ? hd_buff_data: ((ADDRESS == ADRS_FF4A) & ext_response) ? response_reg[15:8]: ((ADDRESS == ADRS_FF4B) & ~ext_response) ? hd_buff_data: ((ADDRESS == ADRS_FF4B) & ext_response) ? response_reg[7:0]: 8'h00; -// SD Drive 0 - -always @(negedge img_mounted[0]) -begin - drive_wp[0] <= img_readonly; - drive_ready[0] <= 1'b1; - drive_size[0] <= {4'h0, img_size[19:8]}; //Size / 256 -end - -// SD Drive 1 - -always @(negedge img_mounted[1]) -begin - drive_wp[1] <= img_readonly; - drive_ready[1] <= 1'b1; - drive_size[1] <= {4'h0, img_size[19:8]}; //Size / 256 -end - endmodule diff --git a/rtl/sdc_top.sv b/rtl/sdc_top.sv index 6751623..0f4362e 100644 --- a/rtl/sdc_top.sv +++ b/rtl/sdc_top.sv @@ -47,6 +47,8 @@ // of this controller will be shutdown and the normal 4 drive fdc will take // over dfc on a different mpi slot. // +// Ver 2.00 Implemented with single 1793 ... +// //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// @@ -77,6 +79,8 @@ module sdc_top( input SDC_REG_W_ENA, input SDC_REG_READ, + output ext_response, + // SD block level interface input [1:0] img_mounted, // signaling that new image has been mounted @@ -124,70 +128,103 @@ begin end localparam SDC_MAGIC_CMD = 8'h43; +wire sdc_always; wire [7:0] FF40_READ_VALUE = {HALT_EN, DRIVE_SEL_EXT[3], DENSITY, WRT_PREC, MOTOR, DRIVE_SEL_EXT[2:0]}; -wire SDC_EN = (FF40_READ_VALUE == SDC_MAGIC_CMD); +wire SDC_EN = ((FF40_READ_VALUE == SDC_MAGIC_CMD) | sdc_always); wire [7:0] SDC_READ_DATA; -wire sdc_always; -wire FF40_RD = ({SDC_EN_CS, ADDRESS[3:0]} == 5'h10); - +wire FF40_RD = ({SDC_EN_CS, ADDRESS[3:0]} == 5'b10000); //FDC read data path. =$ff40 or wd1793(s) -assign DATA_HDD = (SDC_EN | sdc_always) ? SDC_READ_DATA: - (SDC_EN_CS & (ADDRESS[3:1] == 3'b001)) ? SDC_READ_DATA: // FF42 & FF43 - (FF40_RD) ? FF40_READ_VALUE: - (WD1793_RD) ? DATA_1793: //(1793[s]) - 8'h00; + +assign DATA_HDD = + (FF40_RD) ? FF40_READ_VALUE: + (SDC_EN | ext_response) ? SDC_READ_DATA: + (SDC_EN_CS & (ADDRESS[3:1] == 3'b001)) ? SDC_READ_DATA: // FF42 & FF43 + (WD1793_RD) ? DATA_1793: //(1793[s]) + 8'h00; wire [31:0] sdc_sd_lba[2]; wire [31:0] fdc_sd_lba[2]; +wire [31:0] wd1793_sd_lba; wire [1:0] sdc_sd_rd; +wire wd1793_sd_rd; wire [1:0] fdc_sd_rd; wire [1:0] sdc_sd_wr; wire [1:0] fdc_sd_wr; +wire wd1793_sd_wr; wire [7:0] sdc_sd_buff_din[2]; wire [7:0] fdc_sd_buff_din[2]; +wire [7:0] wd1793_sd_buff_din; +wire wd1793_sd_ack; wire sdc_HALT; -assign sd_lba[0:1] = (SDC_EN | sdc_always) ? sdc_sd_lba[0:1]: +assign sd_lba[0:1] = SDC_EN ? sdc_sd_lba[0:1]: fdc_sd_lba[0:1]; -assign sd_rd[1:0] = (SDC_EN | sdc_always) ? sdc_sd_rd[1:0]: +assign fdc_sd_lba[0] = wd1793_sd_lba; +assign fdc_sd_lba[1] = wd1793_sd_lba; + +assign sd_rd[1:0] = SDC_EN ? sdc_sd_rd[1:0]: fdc_sd_rd[1:0]; + +assign fdc_sd_rd[0] = (drive_index == 3'd1) ? wd1793_sd_rd: + 1'b0; + +assign fdc_sd_rd[1] = (drive_index == 3'd2) ? wd1793_sd_rd: + 1'b0; -assign sd_wr[1:0] = (SDC_EN | sdc_always) ? sdc_sd_wr[1:0]: +assign sd_wr[1:0] = SDC_EN ? sdc_sd_wr[1:0]: fdc_sd_wr[1:0]; -assign sd_buff_din[0:1] = (SDC_EN | sdc_always) ? sdc_sd_buff_din[0:1]: +assign fdc_sd_wr[0] = (drive_index == 3'd1) ? wd1793_sd_wr: + 1'b0; + +assign fdc_sd_wr[1] = (drive_index == 3'd2) ? wd1793_sd_wr: + 1'b0; + +assign sd_buff_din[0:1] = SDC_EN ? sdc_sd_buff_din[0:1]: fdc_sd_buff_din[0:1]; -sdc coco_sdc( - .CLK(CLK), // clock - .RESET_N(RESET_N), // async reset - .ADDRESS(ADDRESS), // i/o port addr [extended for coco] - .SDC_DATA_IN(DATA_IN), // data in - .SDC_READ_DATA, // data out +assign fdc_sd_buff_din[0] = wd1793_sd_buff_din; +assign fdc_sd_buff_din[1] = wd1793_sd_buff_din; - .SDC_EN(SDC_EN), // SDC is active [input to sdc] + +assign wd1793_sd_ack = (drive_index == 3'd1) ? sd_ack[0]: + (drive_index == 3'd2) ? sd_ack[1]: + sd_ack[0]; // default is drive 1 + + +sdc coco_sdc( + .CLK(CLK), // clock + .RESET_N(RESET_N), // async reset + .ADDRESS(ADDRESS), // i/o port addr [extended for coco] + .SDC_DATA_IN(DATA_IN), // data in + .SDC_READ_DATA(SDC_READ_DATA), // data out + + .SDC_EN(SDC_EN), // SDC is active [input to sdc] .CLK_EN(CLK_EN), .SDC_WR(SDC_REG_W_ENA), .SDC_RD(SDC_REG_READ), - .sdc_always(sdc_always), // SDC is active [output from sdc (sdc is turning off fdc)] - .sdc_HALT(sdc_HALT), -// SD block level interface + .ext_response(ext_response), + .sdc_always(sdc_always), - .img_mounted(img_mounted[1:0]), // signaling that new image has been mounted - .img_readonly(img_readonly), // mounted as read only. valid only for active bit in img_mounted - .img_size(img_size), // size of image in bytes. +// SD block level interface .sd_lba(sdc_sd_lba[0:1]), .sd_rd(sdc_sd_rd[1:0]), .sd_wr(sdc_sd_wr[1:0]), .sd_ack(sd_ack[1:0]), +// Drive descripters + + .drive_wp(drive_wp), + .drive_ready(drive_ready), + .drive_size(drive_size[0:1]), + // SD byte level access. Signals for 2-PORT altsyncram. .sd_buff_addr(sd_buff_addr), .sd_buff_dout(sd_buff_dout), @@ -199,15 +236,14 @@ sdc coco_sdc( // $ff40 control register [part 1] -wire [3:0] DRIVE_SEL_EXT_PRE = {DATA_IN[6], DATA_IN[2:0]}; +wire [3:0] DRIVE_SEL_EXT_PRE = {DATA_IN[6] // Side Select + , DATA_IN[2:0]}; // ONLY 2 drives (DS) + reg [2:0] drive_index; // SD blk system is a array of 4 systems - one for each drive. -// To keep disk track memory, we created 4 wd1793's to match the sd block interfaces -// For the interface back to the coco - we need to isolate the wd1793 the computer is talking -// to and route those feedback signals back to the coco. This is accomplished via the drive -// select. 'drive_index' identifies which controller is addressd. - +// 'drive_index' identifies which controller is addressd. +// drive 1-2 for the sdc is denoted as 1 , 2 [0 is no drive selected] always @(negedge FF40_CLK or negedge RESET_N) begin @@ -217,30 +253,36 @@ begin MOTOR <= 1'b0; WRT_PREC <= 1'b0; DENSITY <= 1'b0; - drive_index <= 3'd0; + drive_index <= 3'd0; end else begin if (FF40_ENA) begin - DRIVE_SEL_EXT <= {4'b0000, - DATA_IN[6], // Drive Select [3] / Side Select - 1'b0, - DATA_IN[1:0]}; // Drive Select [1:0] (2 drives + side select) + DRIVE_SEL_EXT <= {4'b0000, DRIVE_SEL_EXT_PRE}; MOTOR <= DATA_IN[3]; // Turn on motor, not used here just checked, 0=MotorOff 1=MotorOn WRT_PREC <= DATA_IN[4]; // Write Precompensation, not used here DENSITY <= DATA_IN[5]; // Density, not used here just checked case(DRIVE_SEL_EXT_PRE) 4'b0010: - drive_index <= 3'd1; + drive_index <= 3'd2; 4'b0001: - drive_index <= 3'd0; - - 4'b1010: drive_index <= 3'd1; + 4'b1010: + drive_index <= 3'd2; + 4'b1001: + drive_index <= 3'd1; + + 4'b1011: // This is what the Magic Number $43 does so we select a non-active drive + drive_index <= 3'd0; + 4'b1000: // This is no drive with DS = illegal drive + drive_index <= 3'd0; + 4'b0000: // This is no drive (maybe 0 in ff40) = illegal drive + drive_index <= 3'd0; + default: drive_index <= 3'd0; endcase end @@ -259,6 +301,8 @@ begin if (FF40_ENA) begin HALT_EN <= DATA_IN[7]; // Normal Halt enable, 0=Disabled 1=Enabled + if (sdc_always) + HALT_EN <= 1'b0; end end end @@ -266,18 +310,14 @@ end // Control signals for the wd1793 -wire INTRQ[2]; -wire DRQ[2]; wire selected_DRQ; wire selected_INTRQ; -wire WR[2]; -wire RD[2]; -wire RD_E[2]; -//wire CE; +wire WR; +wire RD; +wire RD_E; wire HALT_EN_RST; wire [7:0] DATA_1793; -wire [7:0] dout[2]; reg read; reg write; reg read_d; @@ -289,8 +329,7 @@ reg read1; reg write1; reg [1:0] ADDRESS_L; -assign RD[0] = (read || RD_E[0]) && (drive_index == 3'd0); -assign RD[1] = (read || RD_E[1]) && (drive_index == 3'd1); +assign RD = (read || RD_E); // Even with no drive selected allow read to the controller // The idea here is to "stretch" the CPU read and write signals to ensure we catch a 8 mhz enable. // For writes we will buffer the data out to ensure it does not go away. @@ -301,18 +340,18 @@ assign RD[1] = (read || RD_E[1]) && (drive_index == 3'd1); // It is heavily dependant on address and write data being available just after // the previous cycle. -always @(negedge CLK or negedge RESET_N) +wire wd1793_r_w_sync_rst = RESET_N; + +always @(negedge CLK or negedge wd1793_r_w_sync_rst) begin - if(!RESET_N) + if(!wd1793_r_w_sync_rst) begin read_d <= 1'b0; write_d <= 1'b0; r_w_active <= 1'b0; clk_8Mhz_enable_found <= 1'b0; - WR[0] <= 1'b0; - WR[1] <= 1'b0; - RD_E[0] <= 1'b0; - RD_E[1] <= 1'b0; + WR <= 1'b0; + RD_E <= 1'b0; read1 <= 1'b0; write1 <= 1'b0; read <= 1'b0; @@ -322,10 +361,10 @@ begin begin // synchronizers - read1 <= WD1793_RD_CTRL & ~(SDC_EN | sdc_always); + read1 <= WD1793_RD_CTRL & ~SDC_EN; read <= read1; - write1 <= WD1793_WR_CTRL & ~(SDC_EN | sdc_always); + write1 <= WD1793_WR_CTRL & ~SDC_EN; write <= write1; // delays for edge detection @@ -342,26 +381,16 @@ begin // Synchronus rising edge of write if ((write == 1'b1) && (write_d == 1'b0)) begin -// Set Writes +// Set Write r_w_active <= 1'b1; - case (drive_index) - 3'd0: - WR[0] <= 1'b1; - 3'd1: - WR[1] <= 1'b1; - endcase + WR <= 1'b1; end // Synchronus rising edge of read if ((read == 1'b1) && (read_d == 1'b0)) begin r_w_active <= 1'b1; - case (drive_index) - 3'd0: - RD_E[0] <= 1'b1; - 3'd1: - RD_E[1] <= 1'b1; - endcase + RD_E <= 1'b1; end // Clears @@ -373,39 +402,23 @@ begin begin clk_8Mhz_enable_found <= 1'b0; r_w_active <= 1'b0; - - WR[0] <= 1'b0; - WR[1] <= 1'b0; - - RD_E[0] <= 1'b0; - RD_E[1] <= 1'b0; + WR <= 1'b0; + RD_E <= 1'b0; end end end // NMI from disk controller -// Selected INTRQ -assign selected_INTRQ = (drive_index == 3'd0) ? INTRQ[0]: - (drive_index == 3'd1) ? INTRQ[1]: - 1'b0; -assign NMI_09 = DENSITY & selected_INTRQ; // Send NMI if Double Density (Halt Mode) +assign NMI_09 = ~SDC_EN & DENSITY & selected_INTRQ; // Send NMI if Double Density (Halt Mode) // HALT from disk controller -// Selected DRQ -assign selected_DRQ = (drive_index == 3'd0) ? DRQ[0]: - (drive_index == 3'd1) ? DRQ[1]: - 1'b1; -assign HALT = (HALT_EN & ~selected_DRQ) | sdc_HALT; +assign HALT = (~SDC_EN & HALT_EN & ~selected_DRQ) | sdc_HALT; assign HALT_EN_RST = RESET_N & ~selected_INTRQ; // From controller schematic -// Data bus selection -assign DATA_1793 = (drive_index == 3'd0) ? dout[0]: - (drive_index == 3'd1) ? dout[1]: - 8'd0; // The SD_BLK interface and thus the wd1793 will allways transfer 1 blk. This is blk qty - 1 per spec. assign sd_blk_cnt[1] = 6'd0; @@ -414,6 +427,9 @@ assign sd_blk_cnt[0] = 6'd0; reg drive_wp[2]; reg [1:0] drive_ready = 2'b00; reg [1:0] double_sided = 2'b00; +reg [31:0] drive_size[2]; +wire [31:0] selected_drive_size; +wire selected_drive_ready, selected_drive_wp, selected_double_sided; // As drives are mounted in MISTer this logic saves the write protect and generates ready for // changing drives to the wd1793. @@ -427,6 +443,7 @@ always @(negedge img_mounted[0]) begin drive_wp[0] <= img_readonly; drive_ready[0] <= 1'b1; + drive_size[0] <= img_size[31:0]; //Size / 256 on [31:8] double_sided[0]<= (img_size > 64'd368600) & (img_size < 64'd740000);//20'd368640; end @@ -436,90 +453,67 @@ always @(negedge img_mounted[1]) begin drive_wp[1] <= img_readonly; drive_ready[1] <= 1'b1; + drive_size[1] <= img_size[31:0]; //Size / 256 on [31:8] double_sided[1]<= (img_size > 64'd368600) & (img_size < 64'd740000);//20'd368640; end +assign selected_drive_size = (drive_index == 3'd1) ? drive_size[0]: + (drive_index == 3'd2) ? drive_size[1]: + drive_size[0]; // default is drive 1 -wd1793 #(1,1) coco_wd1793_0 +assign selected_drive_wp = (drive_index == 3'd1) ? drive_wp[0]: + (drive_index == 3'd2) ? drive_wp[1]: + drive_wp[0]; // default is drive 1 + +assign selected_double_sided= (drive_index == 3'd1) ? double_sided[0]: + (drive_index == 3'd2) ? double_sided[1]: + double_sided[0]; // default is drive 1 + +assign selected_drive_ready = (drive_index == 3'd1) ? drive_ready[0]: + (drive_index == 3'd2) ? drive_ready[1]: + drive_ready[0]; // default is drive 1 + +wd1793 #(1,0) coco_wd1793_sdc ( .clk_sys(~CLK), .ce(ena_8Mhz), .reset(~RESET_N), .io_en(1'b1), - .rd(RD[0]), - .wr(WR[0]), + .rd(RD), + .wr(WR), .addr(ADDRESS_L[1:0]), .din(DATA_IN_L), - .dout(dout[0]), - .drq(DRQ[0]), - .intrq(INTRQ[0]), + .dout(DATA_1793), + .drq(selected_DRQ), + .intrq(selected_INTRQ), - .img_mounted(img_mounted[0]), - .img_size(img_size), + .img_mounted(1'b0), // Not used when using _override + .img_mounted_overide(1'b1), // Load img_size and layout on each clock + .img_size(selected_drive_size[19:0]), - .sd_lba(fdc_sd_lba[0]), - .sd_rd(fdc_sd_rd[0]), - .sd_wr(fdc_sd_wr[0]), - .sd_ack(sd_ack[0]), + .sd_lba(wd1793_sd_lba), + .sd_rd(wd1793_sd_rd), + .sd_wr(wd1793_sd_wr), + .sd_ack(wd1793_sd_ack), .sd_buff_addr(sd_buff_addr), .sd_buff_dout(sd_buff_dout), - .sd_buff_din(fdc_sd_buff_din[0]), + .sd_buff_din(wd1793_sd_buff_din), .sd_buff_wr(sd_buff_wr), - .wp(drive_wp[0]), + .wp(selected_drive_wp), - .size_code(3'd5), // 5 is 18 sector x 256 bits COCO standard - .layout(~double_sided[0]), // 0 = Track-Side-Sector, 1 - Side-Track-Sector - .side(double_sided[0] & DRIVE_SEL_EXT[3]), - .ready(drive_ready[0]), + .size_code(3'd5), // 5 is 18 sector x 256 bits COCO standard + .layout(~selected_double_sided), // 0 = Track-Side-Sector, 1 - Side-Track-Sector + .side(selected_double_sided & DRIVE_SEL_EXT[3]), + .ready(selected_drive_ready), - .input_active(0), + .input_active(0), // Section not used .input_addr(0), .input_data(0), .input_wr(0), .buff_din(0) ); -wd1793 #(1,0) coco_wd1793_1 -( - .clk_sys(~CLK), - .ce(ena_8Mhz), - .reset(~RESET_N), - .io_en(1'b1), - .rd(RD[1]), - .wr(WR[1]), - .addr(ADDRESS_L[1:0]), - .din(DATA_IN_L), - .dout(dout[1]), - .drq(DRQ[1]), - .intrq(INTRQ[1]), - - .img_mounted(img_mounted[1]), - .img_size(img_size), - - .sd_lba(fdc_sd_lba[1]), - .sd_rd(fdc_sd_rd[1]), - .sd_wr(fdc_sd_wr[1]), - .sd_ack(sd_ack[1]), - - .sd_buff_addr(sd_buff_addr), - .sd_buff_dout(sd_buff_dout), - .sd_buff_din(fdc_sd_buff_din[1]), - .sd_buff_wr(sd_buff_wr), - - .wp(drive_wp[1]), - - .size_code(3'd5), // 5 is 18 sector x 256 bits COCO standard - .layout(~double_sided[1]), // 0 = Track-Side-Sector, 1 - Side-Track-Sector - .side(double_sided[1] & DRIVE_SEL_EXT[3]), - .ready(drive_ready[1]), - - .input_active(0), - .input_addr(0), - .input_data(0), - .input_wr(0), - .buff_din(0) -); endmodule diff --git a/rtl/wd1793.sv b/rtl/wd1793.sv index 443e8c8..3f64b8d 100644 --- a/rtl/wd1793.sv +++ b/rtl/wd1793.sv @@ -4,6 +4,7 @@ // // Copyright (C) 2007,2008 Viacheslav Slavinsky // Copyright (C) 2016 Sorgelig +// Copyright (C) 2021,2023 Stan Hodge // // Modifications for track size of 18 x 256 by Stan Hodge (SRH) 9/6/21 // Modifications not to reset the track and sector registers by SRH 12/18/21 @@ -47,7 +48,8 @@ module wd1793 #(parameter RWMODE=0, EDSK=1) input ready, // SD access (RWMODE == 1) - input img_mounted, // signaling that new image has been mounted + input img_mounted, // signaling that new image has been mounted + input img_mounted_overide, // SRH - used to always load img_size (& layout) per clock [img_mounted occurs at higher level] // input [19:0] img_size, // size of image in bytes. 1MB MAX! input [63:0] img_size, // size of image in bytes. output prepare, @@ -299,6 +301,13 @@ always @(posedge clk_sys) begin if(RWMODE) begin old_mounted <= img_mounted; + +// SRH img_mounted_overide added to allow img_mounted to be processed at higher level + if (img_mounted_overide) + begin + disk_size <= img_size[19:0]; + layout_r <= layout; + end if(old_mounted && ~img_mounted) begin if(EDSK) begin scan_active<= 1;