0001010000101011011110110001101010010010101101011100100001011111001110001001000100001101000101101011010011000001011011011100010011110011010011101110001111001010111110000010110110100011000110110110000111100001001011000110110001011000111010111010100100000110101010000101010011100000010101001011000011010110000101001011101100111111111010001101000100001001101101010001101100010011000101110110010000010001 1011010011011011111110001011110001000001110011110001000011110101001000110110011100001100010111011110111110000111001001011110010001111110011110100001101010011100011101100110001000111000110100010100000010001011011011101011011001101000000110010010101110010011101001101100000111101101101001111000101111101110110000101101000101010011001100011001111111111001011000000111110001110011101110111000001011100011 1001100101101100100110100011101001011110110001011011010111110111111011110001111010011100100111001110011011110100011010000000111000110101011111001010000011001111000110111100000000111010111001000100101010000111000011010000001101010111111110101100101100010010000100011101111110010010011100001101111001001000011110110110101001001000101111011111000011111011011110011000110000111110011101000000011010000001 0011011101011011011001111000010111011100111101111111110110100110100110010111101011001001101000011100001110101011110011000011001110001000001100001011110000010110110110010100011000001010001111011100010011010111111000110101010100111001011000111110011100001000110010110011000010100111000010010101010100011001101110011111111001110111010111101111000101101000100001000100100111100000001101111001101001101100 1011110101110101110100001000001110011011000011000010110110001100111111011110100100101001110111101100111101101011110011010111001101001011111010111111100000100110101111010000010001110010101100010011011111100101010001101110000101011110000001110100010001111010110111100111110100101011111101001101110110010010000000101100000010011110010100010101110100111101011011101010110100010001100100001110010110011010 0110000000101111111111011111101000110101000101111111000101101101010011101100010010101000001101010111010101010000000110001011011110011100010010100001011010101100100011110111101110001011101000111000101111110001111010001000101110011010001000110101011101111101111100010000010100010110110011111001010100110101000001111111101100001101111001110111010110101100011111011111110000011010100010110110110101011110 1100110010010110111101000011110100010001011100011110001001100011000110110111111111001010000000001110110100001100100010101110010001000110111110111111000111001101000110110001111010100111101011010011101111011100001111101100100011100101111110110000000110001100101111111011111111100111011000001101110011001010010001111011100100001010011111110110110000010101001001011000001000100010010011010001001011001001 1011001011110000101110111111010111001100100100011101100111110110001101000100110001100100010010100001101111000011101011010001111011101101100011110001001101100011011010110000101101000100001011010000110000111111110111011001010101111010101101101001011010001101110100000100101010100110101010100101110000001000101000011010001010100001100000011110101011101011101010001110001101111000001111011111011011000011 0100010000111111001111101000100001000111000101011110010000010101101111010011001011011010010101011110010001010110100001111001101011101111111001001101001000001001111111011100011101001110000111101111100001001110011011110001001101110101001110001110100010111101100011001110100000110011111101110011110001100101101100000000001011110000000010011101000011110110111010000001010111000001010110111010110011001000 0001111000000111110100111000100101100100000101010000101110011011101101010100100100001110101111101010110110100000000000001001001101010001101101111001101110011011111000100011011001011001010011100001000010110001000111001000111100101101001000100101011101110100110110101111110110111111100111101111011111011001010110100110110111111111000010001001010010111000010000101100100100001001001101010111100111011000 0000000000001110011111100000010001111111101111010100011100011111000101100100000101001100001010000111000001110100110110000110111101011010001011100111100110101110001110010011001111110001011010001010100010111101101010100011110011111100011100110011111100100011010000000110001100010101110110100001011001011001000101100101011001100110100101110011111011011100011110011111001010101100011011100011010101011110 1000001101001111010101101111010010000101010001100011000101011001011101000010100000010000100000100000000100110001000101111111110100100000101001100101001011111111101000001011010101111000011100001101011100100101011011001100111000110111100001000010010110000010001000000100100001111111100111000000001010010010100101010111110110001101001010010000101001110111001111011000101111010101111010010100011110110001 1010111001101010101001111000001111000001001000000011000001001101100110100111110100000000101001100011100011100100010111000000000000000111000010001000010111011000000000001100000101011010100000101000000111110011001110010110001010001010010010000000001011110110010000010110000100101000110000000100010001010100110001001001111110101101010000100011010101100010110010110001110001111101100001010000101110010110 0111100101010010000100011100111010001101001010100110111111010001100110000110101101111011011110100001001100100011000111001110100110011010100100001101110111111010101011010111101111000000011010000111101101011110010011011000000110101011000110000011010111110111111111001011110111101101011001101101110010100011111011011010010011000010010110110100000110010010001111100011011011110100110110110101010111110110 1101000100000011111111111110101001000011111111001110011100000101010111010110010011011100110010010011001011010110010010011111011101100011101010110111000101111100000110111011011101010010100101011001001011010101110010101100000110011000110100110101111011010101101010110000010011100000100110100110000110101011001000000101111010001011111001010011011100010001001100011000001000110101010011000100100111011011 1111001011110100101010000111010011000100000110111101000010101001111111011100011111010001010011101011000100011001110001111011000001101111101101010010100001101000010000100111100010111011011000110010101010010010111000000001001110001010001101101001011110100010010100111000111001001100110001101010000111101101100101000111111011111000100101111100001111100110110000011010101100100101010111100110010110011001 0111001101001010111111100000110110000011110010111111101101111000001110001101101110001111011001101111001110111110010110001001001011110111011000100101111010110010100010100000001110000101101000011111010100011101000001101110111010010110011101111110010001000100000100010000100100100001111010100001101110001110000100101011110011011001110011110110110001110100001001000000010001111110001110100011111100010011 1010100001011110001100001111011010110001110011100100100101100100001001001001000100001100110001010001010100101100110010101011100110110100000000111011011001111101111001101001100110101100010000100011101000010110101010010010010010011110010110101000011010011001101000111100000100000011001101011001011000000111101100001110011011100001111001010000010111101101000000111101011101111110011111101001010110010101 1011001000100100010010001010111001101000111001011001010101110100000110111110011100001011111011001101100100001000010110101101111011100111000001100000111010100011101110111100011110100101000000101111111000011100010101001010011010001001000011001110000001110101101010101010111101110101100010110001001011001110110101101011000110010101011010001011010011001011000101001100010101010000110011101000110110001110 0110001011111000111110110110111011001110000100010110111101111010101111010101111111010011010111010100010101011001110111111101110000101100001001100001010011010101011011001110010000111010101100001111011011110001010100001101101000000011011000110010000000000110101000001010001010011110110001110111101100101110101111000011000101011010001001000000101010100000000110001111001101000110100001111011110001101001 0011111001111011100101101101111100111000110101011010100110110011010110110000101010111101110000100101000001111001100100111000100001001111100110110101000000000011011101100001101001001011111011000000010001000001000011111100110001000101011000000111000011000100111010011111001111001010111010010101111101110110001100111110100111111110001011011110011111001010100100010011100000101000100111011011110001100100 1010000111100111000101110000001011011111101001000000011011100000011101110100011101101011011010101101100001100010001000010010001101000011001000101111100110000001000101010010001100011111011111000000010111100011100010100100000100101100010000000100001111101101000101010100110110001110100110011100110010001111010110001101000100010011100110010001011001110100011110010110011100001011010100011000101001011010 0011101110110001001101001101101010001000010000010011111001110110111101011010010111111010111000101110000101011000011110101101100011011011010000011111001011010001110000001001011111001010111101010100101100011111000111111010100110011000110011111110100000110101111001001010110110011010010000101010011000111100111011001100000111111101111110011001001101011100010011101001011100011101100010010010110101001111 0100100110100101011100011010010011010111101011111100110100111010011011111111100001100011011001010110011111001001111110101011001010000001111110101000010010000010110101111110110101101001000100010011111011001000010010010011001101001010111000011001100000100110010100001010011010001011010010100101001111111001001010111001101011111101010011100111000011000111000111000110000111010111000110111101111000100111 1011000111010010100010111110101011001011001011010000001011010100000000110000110110011111001101011101111011011001011000000111110110000001111110110100011001011110000000010011111110101000110011011101001101011100100100111001110110000011111001101010100110011110101001111100011000011101010001000101100101111111011110010001101110001010101111111011100101011001001111000010000111100111010011010110111000110000 0011011110100011001011001110111010000010001111000011001011100101001100011001010010111000001011001110100101000001110100111101100111001110011111000011100101100110010111111011110111100101001000011100111100010000000011000101011110011000000101011000010000100001001100110011100011100110011101000111100110101101110000110110010001111111000110101010001111001111101010101100110110101110000101111001111101011100 1011110100111000011111111111000101101111001110110001110101111000111010101110010101100101111010000111100010110010001011011001000011101001000010010100111101100111000001011010110001101110100001001010100101001001011101011111011000101100010111101100110101001110001100001001011010111010000001110001101101010101101100001001100010100101110011110111001011101000010010100011001010100110000011101101111011110000 1100011000010100101010001000111000011010001101101101011000111010110100010000000111000011011001111110010101011001110010011111011111111110110100110100110110111001010010111000110011000000001011110100000000011011100101000000000011111111110010110001010101001000000101001000111110000010011110010001000000000111011111100011000001110000001001111101101010111100101001100001000010100100101100010110100010110001 1010100001011011101000110101000010000000000011000001011110101010011010111100001110001010010010010011111111010010110100111100101000101010001001100000110001011100100110111100100001101010110101111011010011101001101110011100000100101100001100110001011100100110000100100010100010010110001010011110110111001110101101101111000110100011100000001011001111001011011001010100010100101111110111010000111000101001 1000110100001010100101000101100011010100001000111000111011101111111010000100011001000011010110011110001101111000100011110011100101110001000101000001001011100100111100101001011100000101010101100011101100111001010110110000100100000101111101100110111101010011100110000110100111100101010100110001110111010010010101010100010111110001010001110111111001111110010010011001111100100000000001110000100100000101 1001011110110100011110101111100011101100011011101100110001011110001111110000000000001001111000101001001110111100100011110100101110110001101000010000000101100000100101110010011011110111110001001101111100101010100011000001001110100000010011001111011100011001001011110000110110111001000111011000110110111000111000100010000101001010001101001101011001011001000100100010000011000110000001000000110011110001 0110100011001111100001101111111001111110110111110001100110110101011110011111110101110100111101010010111111011111011111111111110101011100111010110100100100101010001100111010011111000111110000000110111110000101101111010101001011101010011010100101110010101001011100011101011101111010010100100000011001001011101100000101000001011101100001111001001101111001111110000011011011100111001110100110010011101101 0101011011000010001011111101111101000100000011110111100011011100111111111100000001001000010000000000111010110100011100101100101110110011110001011101010100010100001110101111100110111010110000011110011111111101100101110100111111001000001111110010011011100001010111010000111100011100111110101010001101010010110100110010011000010100011000000011000000001011011101111111010000001111100000101111111010101110 0011101101001010110000111001001010100001000000100011101001010010001101101111010101101001000110000101111000000110101101001100010111100101110110101011111100001000110000000100100100111110000011011000110001000001011111101100000000110111101000101111110100001010101011001001110100111001011111110011111010010111000000111011100010011111001101110011110011110001000101101101010001111011101110010101001101111101 1110111010100010011000010110111011110100111100101101101010111010100011000111110000001111100001101010000001011001100010000000111001011110100110010000100100100011110001000000010010000000101001111100111101110001101100011011101001101001010100101001001011010010101001101101100101010100100011111010000000101111011001011000100010111101011100101001011011011111011100110010111100010000111110111111010111100111 1100010000111000110110100000100011111000011110101011100010111010010101110010100110101111110100101011001010001000101100111110101110111111010001100100111001100011101000011011111101100110100011110001001001100110011001001111001111110110001100011101001010001000111111111000011001001001010000110110001100001100011100111011001111011011000111101000111001010111001000101011010000110101110001011011010011011001 0110100000101000011010100001000101010100001010111101111110000110101011111001111100000111110101100101011111010001001110111011111001100100011000010101101101001111001010101010010100111011010000101001001110101111011111000001100111000110001110011000110101100001111101111011110111010100000001010111000000000000101000111001001110111101000111110101010010000100000001111100001111000000000011101011011100101011 1000001101110001111110000100000011001011111010011011101010001000100010100100100000101000111101110010100111101000110110011110010010110100000011110010110011001100011000111101101000000110001110111101111010100001100010011110100010100111001001110110101010001000010011110100000110001100110000110100110011100011010000110000001111101110111011110000011110101111010100000111100101100010001101000000001010110010 0011000111111111100000001000010011111011001100100101100001011000001100110110010010110101100110010001010110110100110110100011011100111111111010000000011110111010001101000010000111010100110011110011001001010100011001101110010100000111001000111110110111111100000010001110111011101000010110111101011111010011010000110011000011010100101110101100100001100111110001111101110010011101011100001100110110000000 0111011011111000110000100110001100101000011100101101111110100001001000101000010010110101011010111000110000010001001100100001101111000010110011110100011100110000101100010100011000110100001110000101101100010101010011110100010101110110110100010110011111001110101110001100011000100011000000110000100000001011011111000011111011101000110110101011110101011001101001011100001000011011100001000010011001100001 1111001101011001011100110010111111001011011101111100110100000011010000000100111100000011100111001010010100001001010010000010000000011101111010101111111001111011011010111011101110001100110010011110011111010000111011000011010100110100000111111011111110110100000110100111101000010010100111110000000011110110111100111101000100111111010010011100011110011001011111100010011000001000101000111001000010101001 1110100000100010001101011100010000010001010100101101111010000101000100100111111011101110001111101100011111100100111111010010010011001110001011111000000010011011000000111100001111011011011110110010110000111010010111101100001010110101111110110011101000100101111111101010111010010001101001111010100011001110110101000110011000001100010101010111000011001011101011100100010101010100011000100000011001111100 1111010101111100001000001110101011110101110111011101001110010010000100100101110011011100111011010011110011101101010000111010100110100100111101010110110011000111000001011001010000001001001100010101111100011111011011010110101111001010100100011110101010000100000110111111111101000100000000111101010100101110110000100001011000000100010101111010010001001011000110001010101111111111011001110101111101101001 1000010111010010001101010101101100101000000001110010000010110110110010101110010101010111100010101111010001010011001101000100011000100011101110101001110111001001011110111111111101011000101000110001000010000000000111101111001111110011110110101111000001001011010111100000101110010000000001010000001100001001011011000011010001000001011011101101000010110001101000100011010110011010010111011110000000111110 1101001100101110111100010000011100100111110110010010001001111100101100010110101000111100110100110000011010011000111000101110000011001000001010011000101101111010000100001011011010011101000111101110010111010001010010101100110111001100011010111100000000110110111110101101011001011010110010101110011011001010111110100010101010111010101001100111001110011011111010000111010001011111101100000100111001100111 0010100100011000010110100010001111111001000011001101100110001000001000100000000010111101110101010101010110010110100111000011101110101011111000101110010110111110100011011111100000010111001001010110000101011010100101100011000010010110001101110101111011101011111000010110011000100111110110111101100000011110110110001101000001000111010110101001111011001001001010110010100101000111101111110100001011000111 0110101001000110000011101101001100011011001011011100100000100001110010111111010010111000000011000111001011100000010001011110100000101001000011110000000101100100000110110100100010010101110011000111010011010000011110010000010111100011110110100011110110000000011010100110110011010111011110110010101001010111100110110010001101101100000011000011101001000001011110011011111100010010111000011000100001001110 1111010111110010100011000011011100011010011001010101010110101100110011100010011110110001010001011011010011110111001010011001110101101001100011100001010000110000001100111101010111000101011010110111111110010011111001101111000001010111010101101011001100110000001110111100100010000000010101001001001101001011111100010101011001011101100100000000001011010001110001001110010110000001010100001111101010011100 1110111110111011111000010011110111001010001111000111101111111010111110011001001111001111001111011101010110001100111001001110010010110010010011001010010101001000000111011000001110100111001111100000110010011111110111110101100100111001101100001101011000010100111101100111001001110101110011111001001101101011101111010010011001110001011111000001000001000010010010111110000001101100000011101100110011000101 1010011101110110100000101111000110011010111010100111110100000101110011000101001011001011001001010101001111100100101100010001100001101111010000111000100110100101000001000111000010010011011000100011010000100010001100000000011010100000100001001101110000001110100110000101000011110010011001101000100100011101110111010100010000011011001010110010010101010111101010011010100100101110110010100010010100010101 1010001011000110111011001010100001111111000010001100111100101011110111000000110011110001010000101100001100111101110000101001101100100000111110011111111001011001000101000101011011000111000100111101000101000001111100011000101100001111110010001111000000001001100111001111100001111101010111100000011110000101111010000111100101011000101011010001100011011000011100101000111110001101100001101000001101001011 0011000110111011101011001001100111001101101011100100011101100111111001011011110101100010001000111110011110100100010110110011101001111100001100000101111110110111101001001010011100111111000101000100111100111100010100000100101100111101110100001110101100101001011001111011000111011111001110101111110111010101001100001100000110111010111101000111100101110000000010101011110000000110101100010000110101101101 0010100001100110100001111001101111010000010011011101000000110110100010100110111110000111001101011100000110101111010111011100011010011001101000001010000101001011101110110011111100110000101101010110111011011100100010101010001111100010111111011000101001010001111101110110110011001110010010111100110011110001001000011101110010110110000111100111001100000101111111110101010110101000110110100000101011111010 0111011101001110010010110000101111101011000000100000111110101001110101010010001101110100001000001110110001110010101101001110001111101101000111101111011110010101011101011100110001101001001111111000110001100011000010111010101000100110001110001001111101100011010101010111110000110111011101001110100110011010001001011011001111000010110111011001101111111101101110010001101111001010000001001100111011001001 1010111010001100111100001111000000110100100100111011101010011011010011100110110101011101110110001011010000001010101011101111111100101010100010111011001011011000110000111100100111000001111000000011111111010011000110111000100101011110001000100011001010010100000000000110110100000001111000001101001011100100001011101111011011100111110110100101100001100101001100111110001110000110010010110101001011001100 1110111011101101101101100001101101111011011110011110001110001010110010111110111001001111101111001001111100001100011110100011010010001010110000001101011011010101101111000011000011000011110100111010111001100000111100000000101110000110101111011010100000100001010111010110111010110110101101111110010010011101100111011001101100011101000000101101110011011110100010111111001011000000000100010101100000011101 0011011011111011110111011000010011011101101100100100011101001010001011111001010010101110111000000110101111101011010010001101100101000010111001110110100111010000101101111110000110010001010001011000111011011111100011110011101100100001100000100101110011101010010010001010100001111010010110001011111000111001001001000111010101010011000110101010010011011101100000111100011101000111111001010111011010001110 1101010111001111001111000101101010101100011000010100011101001110100010101000010010100100110000111101100111010001100111000110110001100001000001000101000011001001001000100110110110110111111001000001000111101010100011101000111100001110001110110001101100000000011101000000110001000010111101101100001100100000000101101111001101111111000001100100110101101111000100000110111110110001111011101110000111000011 1010110101000010010010000111100100110011011010101110011011011101111011101001110110000011111010001010110000010011100111000010000100011000110011100110001010000110110100000011010010111101101000101010000001001000101011000001001100100100111111010010100110001110110101110001010110100101011111010100111100111100000111110010001111010111001010011001111100101111100001111111000010100010001110100001110111100000 1010001100111101000110111110001101000010100100011100001110000000110110000010101100001000101011110000110111101100111100011011010010101110000001000000111111000111010010011110111100000010010110111110000001110110001010001001100011110110000110101101100001100101010101000110101011000111111000010010111101011000101111001100111000100011001000000001010000101011100110111000111000100000110000010001110111001100 0010010110010101001001010110010111010001001001101111100110000101100001000001101001000001110010100010010110000001111111010000001001011011111010101100010000011111000011000010110110100010111100001000011111101001100010101111100000001010110010110010000111110111111010011101010101000000110001010011100010011101111010001001001100011011100000000110001111010000100110100001100101010100000101001000010101001110 1100101100110110110001100010000101001110001110011010100011011010000111010001101110111110111010001010110111000010101111001100001001100101001100110100110101001010011001101000101111111100100000011101101101110110010000001011101001110111111111011010010001001111001101001111001110101100100001101100011001011000010011110010110100101010011111100110101000000010110010110100010100101110001110011000101000001001 0110011100101001000101111111111110100000001011100011001110101110000011110001110001101101111000011000100110011001110001011000000011111001011110011010100111000010011110101010000000101010111011011110010111100000010010000000100011001100100010010100010000001101010100111111011011100110011000000101110101111101100000010101010010000010111000100100110110101001100011010111110011011001101010010010100100101000 0000101011010010011011110010000011100011101011000111100000100110101101101100101101011001111111101000011000001111001101101110110010111100010110011110110111011001001000010011101111000100100000000000001111001011111000100001011001100110100011010010100000010010001000110101001110011100111101100010110111010100111101011101001010011110101011010101011001010100011001110010000101000000101010111010100100100010 0111110101011001100101110000111000101010011000001001100011101001100010001000110100111110000000010000100001100001010000001110010101011100011110010111110001110110010010000010011011100110000000001101111100010000000100111011111011000010101000011111111100010110101110101001001100011001001110000111000100110000000110000011101110011010110101111101000110111000110000001111111110001010011101111110001001011110 0000001110100000010101111011010001110000110001010001000000000011010100000110111101101000011101110000111111001110101100010011000100000010010010100100010100010111001100010100000100011100010000111101100111101110010111001000010001110001110110000010000011101010110111010111101011110001101000100110111110011000010000000100000110011010111101101110101011111001010100100000100110111011111010000101101011101011 0011110110101111111111100111011011000100001110010110111110100100100111011100101111111110110101101010111110110111100101100011011110111010101100110110110000011011001101010110010001111100101101110110010010100100100111000111001010100001000100101110101111010000111011000111000101011100101011010000111111101000100111110101001011101101101000010100000011011001101001010111100010110111101011001100111001111110 0100010100111010010101000111101110010000110100010011000011000001101111101000111110101101011110111111110101111100101011101111110110101100110011000101110110011110011110010011101110101111100110100111001001010111101010110101101010100001110010000010111111110010000111101001100001011011011001111000010010011101010000001111011001101110110010000001010000000011010101011010000110110001101000010001011100100011 0111010010101000010000011101010111001101000010000110000000011001110010000111111001110100000010011110010111000111101111001000000011101011010111100110010001110010100000111010111100010100100001000101101010011100000111110010101000010001101110011011010110111011111011000110111010010100000110100011011010000011001000010001010110000100001101000101000101111111001011100111000010110010010110101110100000011101 1100111100101000100110110110100110001111100010100100101011000001100010100110111101000110000010011000101100010001110101011010111001100110110001111110101010111000110010001111110111110101110101010010010011110110011011011100001101111101001011111001001111010001011100010111001010010111010000100000101100001000001010010010011001100011101001110101111110001111110001110000101100011010011111011111001011100001 1110101101111010101101101011100000001000100101011100111110001101000111001111111100001111010001001101101000111001101101111101100111111101110110111000101111101101001010001100111110011011001010010010110001100001111010000100001100000010110010101101110101000100101000101010001110011101000101001011111110110011000010010001101000001111110011101011000111101011010110100011001100000110000100101000000011001010 0010110000010000001101111010110110000100000011110000000001100000101001101101001111110110010011011011001101001000001100100101110010001110100000101101011101000010001101101001001011110010110011010000011100111111100110110110110000110111101011101011101101011100111110111101011101001010001001110111010010011001000110001000011101100010010010110100100110101111101011101010010101000101010001110001101010111100 0010101001100101110101111111111101111001110100111001011010110001110101111011101110101011001000001010001010000000011111010000000000110010000001100100001110000010011110000111111110010001001100110110111001110111011000001011010000100001010001100111111110111101010010101101001110011001101110100110011010100010011101011011101111100011010101100001001111010001001011011101111101111011001001010000101101101010 1010100011110001111100101001010001100110101100100111101110110001110100000111101010101001010010100100001111101000100010101101011111111001110000110011111000111000011000000010110010100010001000001010111110001100111000110111110010010011111010000000100010101010011111001010000001110010100111000101111001100110010011011110101010101000000000110011101001101000101100111001111011011111010010000001000110110101 0100100100011110110000001110011001011111111110111010101000011111011010100100100011101001000000010101110110001000100111010010000000101111110100110101100100110110111101001101011110101110101100000110000100010010100011100011001010100001100011111010010100011111001001101001000111110000011111001001101010001111001000010000110111010101110111111001110110101011100001100111101011100111000010101111111011010110 0101100111101011100001110001000110111010011011000010001101101011011100100001010101100100100010011011000000110111011011011100001000111001110100011000110001110000111000011011011111010101001001110110010101010111100001000000000101010010100111101000000110000101001111111001101000101010011111000001100111001011000100110111000011111011000010110101011110001110010101110000000000101011110010000010010011100101 1111111111010100010110101001001111000000010101001001011010111001100100111011010110011101001101110011001100110001101010101011110101011000011000101110001110010001001100100000100111111111110100110100110001010001000011100000010010110000101100001010011101000111100111100111100100010101011101010010011111011011111011000100101101010101101011011010000111000100111011010010111110110111111101000011010000100101 1111011001000010110100000101011111111101100111000111000110111000011000010110010101011001000110101001011100010101101001011011010110001010000100110010000100111110101111101101110101111000100000011010100101111001111111001100010110000101010011001100110011011000000111100001011100011000010000000001011110110110110110110100000111000010111101100111000000001101110001010010100001101010111000110001011100011011 1111000000010010110011001100111000001110001001110011001101111010101100011111010010001001011101111110111110011001110011010111101000110000001000110010111111100011100100001110011011111001000100101001111110000001110111000100100010101110111000110110101101111111101000111111110101110101010100101100001101101001000010110011100010101110001110111010001110111110111000001101010011011010000110010100110001101101 0010110110000111010100010000011011010100111011001100100101011001111111111101001011000110011111111010000101111001101100011011011110111011001110011110101011110011111001111111111000001011001111011100110000000110011000101101010101011000001000001010010100100100111011010101100000011011001000001010111010001011101100001110110101111101011101101111101011100001100000010011100000011100011110110001011000010110 1111101111000011000101000000111100011010000100001100111000100011100010111001010011101001010001001100110110101111101010011100101110100010011000100011001110001011110001101011001000001010101001110101001101010011101000001100111010110011111001011101011101101110001001000101101000110001111111111101001110011000010000110000001110000001101011100110110100111101111110011100110001100111000001000010010101110100 1101011011001101101100000101111110100011100110111101000110101110101000111011011100111100110111100000001110110110110110110111000110111011111011000100111000010000111001011010111001110010010000000110100010000101000001010000011100111011010000110000001011110101000000001110101011011100011011010110111101100100100010101001110010101111000010101011011111100111010011111100010011000110100100111110000101000010 1101011010010101110100011111001100110000011010110001100110110111100101100100100010011000011101010101000010000110011001001101111110101011111000101000001111100010000110100000100101010000110110110011001010000111011110001000000001101100111010101101010101001110001010111000101001111000111011011000100100111100110111000011100111110011011101001011001100001001000111111001011011100101101111100111110100001101 1010111101101000100001001011110011100100111110100010000000100010000010101010100001000101001010110001001010001100110111001101001001101011110010100011101011110101011101101110011100101101110101000111101011000100001111100100111100000001101001111101100101101010001000011001111101111111010101001111011001001110001101001001011000111101001011100000101101001000001000011000011010110101010000000011110111011001 1100110101010110111110010000011100001010111101000001111100110111011110001001101000111101111001101101111000010000001010110000000100010011101011111000111111111111110011011110100101011111111010111101000011011001010000101011010100010101011010010011110100100010011101111010101110110101010100110011001000001000110001010110001110110111111111011010001100110111100010111010000111100100101001100100101000001100 1000001010111110011100111100011111000100000001110101000110100110010000010110101001011001011100010001000010000101101101111011111000101100111110000000111110001100011000010011011111100010101111010010101111111111100100100010110100000111110111011101110110110000010011100100101011011001110110011001000010011100000011011101011010010100111101100010011100101010110001111110010011111000110011001011011010100110 0001100101010010011111011001101111100101011000101011011100000001001011110000100001001101111101111001110111111111010110001001010011100100101100111011000010111011011101101001001000101011110101101001000100001000110111101010011011111011000100100001110000111001110101100000011000101100001111011110111110011001001011110001111100000100011001010100110010110111011101010000001100101011001111101110000000111101 1101111111111001111101011010100001001111011111111111100110100001000110101001000000000101001011010001111000101100000111000001100000110100010110100011000111100001111000011011101110101000000100001110000010010100010111000001000011000011110001011010100001100110011000111111010111101111100000001001010000100110001111010000011011000010001110110100011100111011000101011111000000110101110001100000010010101111 0001001001010111010001110100110100111011010011100001111000111000110110101011000010010011100011101011010111111001110111001011100000101000111011001101001011100010111010101001111111011100001100000111100101011100101101111110010000011001110010000100011101000001110011010111011110110000001000110111010110010001100110011011011001010010101000110001010001111010000010111001101000010010011101010110011111011001 1111100110101101010100101010000010011001101111100011111011011011100010100111011011110111001010000010001011101001000101001000000010110000110010110001100001100111110000110101111000100010001100110010111111010000010001011011011101011110010011000100011110001010000101011010110111010100101011110011110110101000010110100100001011110011010011111101111110000111011001001001001011001010000011101001000111001001 1010000011100100001101111010101111111001011100000001011011111011011010011101011110000100101100001010111111000110011001101100111010000010010110101000100000010101110000010111110101110111101000010000011110101111000110111111110111110101100010001111010000000011010011001111011111100011001011101110110001110011010001110001111111100000010011110100111111110000101001000010001001011010101100000011100110101100 1101000010000010000101111001010010100001100111000010010000010011100101100000001111101001111010010001000000100101001011100001011110111110000110111110101111001011010100100101110101000011111110001100010110001111011101101111011101001010111000001011110111000110001011000100101101010101110011000000101111111001110000111011001011001001100110010111001000010100100100010101011000100011000111001110001111111100 1000000011110100110001101111110111100000011111011011010111101010000111010011000001011000001100101111101010011001011001110100100110001011110101011110100011001011101011000100110111000010000110000000110010011111101011010111000010100110110011000011100110110010111001010010111011000010011011001110111100110000111001110011111011011010111010011010111110010101111001001011110111001100010011001011111001010100 1110101110111101011011010111011110111001111001110001101001001011001100010100101010110011111110001111100100110011011100001100101111110001100001110100110100110000001111110110101100110011010101000110110111000110001001101110001100011101001001110100100100011001111011111000100000000000100010001001111100101010010000100110010110111000001101110010100010001001010110010101110100011011111000101101111100110001 1101000011011011001111110011111010111101101101011010000101010110010001100000000111011011101110100001001000011011011000111101100111010001010010100111000110001100010110010110100100101011011100101001100110111100000110101100010011110110110111011100111111111101001111010011011001010010000011111001000111011010110001100001100000001000101000110001110010111000010001011011110101111010111111101001001011100100 1010000110010010001100010111110000101110101010111001001101001011111111100001110101001100101001000110101111010011000110110000110011011000011110111111101010110010110110010010100101111111111011010000000100101010101111000001100111100000011100111001100111011011100111111011010001010100011110101101010111110111011101011010101110000101100001100010110101100011110100000101101101011001000011100010000011000111 1000011010000100100001001101100001101100011010001000111011000110010101110101000001111010101111011100010111011111001110010111100001010001001111011001000001101001101011000011000001001011011101000010011110011001000111010011011011111110010111111000010101110110101101111100100110111100000101001000101001010010100101010000110000011001100011010001000011000000111000100011011000100100000101000111001101000101 0100111100101001101110101011100110010111100000010101010000110101110111010010100111110010111100011101101001101100111100100101111001001011110011100110111100100111110001011011100111000101111000000000001111011100001001110100111100001000011101100100000010011010101111111111010001001001000100010000101111011100001100110010111110110111100100000010000111010001111110101110001000011010001000000001000101110111 1100100010010011110110011101011100100100110111101010100100010011100111101001111110011101101011110010101001001001001100001111111010001011101110011100010001101010010010111100010100100001000011001001110110100111100001101011110010110101010110101000001001101100000101001100000110011101010110010101100110101001100010111001100011110000110001110101110001101100000011001110100110101100110010111101100001101110 1010100011011110000110101100000110001100011011100000011101000111111010100001001101100010001101011001001011110101000000101101001011111000011111101000111101011010011010101000111000110100000100101001000111100111000110000110000100010111110100100110110001001001011111111011000111101111000101110111011001111011111000101110010001000010011110111001100011111011110110101001101100111111001100011100110101011100
cTrader Algo

【cAlgo】LocalStorage【API】

5/18/2023

2年以上前の記事です。内容が古くなっている可能性があります。

変数の値をcTraderに保存する

インジケーターやcBotで使った変数などをプログラム停止後も保持しておくことができる機能です。cTrader4.6でやっとできるようになりました

これによりインジケーター間の連携や、時間足切り替え時のデータ引き継ぎなどがより自然に行えるようになりました。

インジケーターやcBot同士でデータを共有するには「ローカルストレージ」という機能を利用します。

ブラウザで使うローカルストレージとは全くの別物です。cTrader専用のローカルストレージで、MyDocument\cAlgo\LocalStorageというフォルダにファイルとして保存されるようになっています。

 

LocalStorageインターフェイス

public interface LocalStorage

 

cTrader用ローカルストレージに対する操作はすべてこのLocalStorageインターフェイスを介して行います。

 

メソッド
(void) SetString(string key, string value, [LocalStorageScope localStorageScope]);

文字列をローカルストレージに保存します。LocalStorageScopeはデフォルトでInstanceのため、特に指定しない場合、保存したデータは同じインジケーターからしか利用できません。

(void) SetObject(string key, object obj, [LocalStorageScope localStorageScope]);

オブジェクトをローカルストレージに保存します。LocalStorageScopeはデフォルトでInstance

(string) GetString(string key, [LocalStorageScope localStorageScope]);

指定したキーの文字列データをローカルストレージから取得します。LocalStorageScopeを指定しなかった場合は、Instance、Type、Deviceの順に探して最初に見つかったものが取得されます。見つからなければ空文字列が返ります。

(T) GetObject<T>(string key, [LocalStorageScope localStorageScope]);

指定したキーのオブジェクトデータをローカルストレージから取得します。Tは「保存されてる型」です。LocalStorageScopeを指定しなかった場合は、Instance、Type、Deviceの順に探して最初に見つかったものが取得されます。見つからなければnullが返ります。

(void) Remove(string key, [LocalStorageScope localStorageScope]);

指定したキーのデータをローカルストレージから削除します。LocalStorageScopeを指定しなかった場合は、Instance、Type、Deviceの順に探して最初に見つかったものが削除されます。

(void) Flush(LocalStorageScope localStorageScope);

指定したスコープのローカルストレージデータを保存します。(基本的にローカルストレージのデータは自動的に1分ごとに保存されます。このメソッドはすぐにLocalStorageに反映させたいときに使用します)

(void) Reload(LocalStorageScope localStorageScope);

指定したスコープのローカルストレージデータを再読込します。このときに未保存のデータがあると消えてしまうため、事前にSetStringなどしてる場合は先にFlushを呼んでからReloadを呼び出しましょう。

 

補足

ローカルストレージ機能ではSetStringやGetStringするごとにファイル入出力を行っているわけではなく、一定間隔でためたデータを保存、読み込みをするようになっています

そのため、遅延なくインジケーター間でデータ共有したい場合は必要に応じてFlushとReloadというメソッドを呼んでやる必要があります。

オブジェクトを保存したい場合は構造体(struct)が無難です。SetObjectはなんでも保存できちゃうんですが、GetObjectは自作クラスだと結構失敗します。TimeFrameなども取得できません。(cTrader4.6.3~cTrader4.7.9で確認)

keyは最大50文字で基本は半角英数字で一部記号も利用できます。/や%などファイル名に使用できない記号は使えません。あとなぜか_(アンダスコア)もエラーが出ます。スペースは最初と最後でなければ利用できるようです。

データはすべて平文でjsonで保存されるため、パスワードなど見られたらまずいデータを保存してはいけません

SetObjectでもバイナリで保存されるわけではなくすべてjsonで保存されるため、「とりあえずオブジェクトごと保存しといたら実は中に機密データ持ってて丸見えに」なんてことないように気をつけましょう。

 

 

LocalStorageScope列挙型

ローカルストレージに保存されるデータのスコープ(アクセスできる範囲)を表します。

Instance 同じインスタンスでのみデータを読み出せます。
Type 同じインジケーター/cBotでのみデータを読み出せます。
Device 同じPC内すべてのcBot/Instanceからデータを読み出せます。

狭い順にInstance->Type->Deviceです。スコープは必要最小限のものを使用する方が良いでしょう。

再起動時や時間足切り替え時にデータを持ち越したいだけであればInstance, 別のチャートで動く同じインジケーター間で連携させたいならType, 別のインジケーター/cBot間で連携したいならDeviceといった具合に選択します。


まだコメントはありません

新しいコメント

コメントは承認後に公開されます。承認まで次のコメントは投稿できません。

cTrader's Life

© 2025 ajinori