wt_attack = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
               0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1,
               -1, -1, -1, -1, -1, -1, -1, -2, -2, -2, -2, -2, -2, -2, -2, -2,
               -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3,
               -3, -3, -3, -3, -3, -3, -3, -3, -2, -2, -2, -2, -2, -2, -2, -2,
               -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0,
               0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
               0, 0, -1, -1, -1, -1, -1, -1, -1, -2, -2, -2, -2, -2, -2, -2,
               -3, -3, -3, -3, -3, -3, -3, -4, -4, -4, -4, -4, -4, -4, -4, -4,
               -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -3, -3,
               -3, -3, -3, -3, -2, -2, -2, -2, -2, -2, -1, -1, -1, -1, -1, -1,
               0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
               1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0,
               0, 0, -1, -1, -1, -1, -1, -2, -2, -2, -2, -2, -2, -2, -3, -3,
               -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3,
               -3, -3, -3, -2, -2, -2, -2, -2, -1, -1, -1, -1, 0, 0, 0, 0,
               1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5,
               5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5,
               5, 5, 5, 5, 5, 4, 4, 4, 4, 3, 3, 3, 3, 2, 2, 2,
               1, 1, 1, 0, 0, 0, -1, -1, -1, -2, -2, -2, -2, -3, -3, -3,
               -3, -3, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4,
               -4, -4, -3, -3, -3, -3, -3, -2, -2, -2, -2, -1, -1, -1, 0, 0,
               0, 0, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3,
               3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 1, 1, 1, 0,
               0, -1, -1, -2, -2, -3, -3, -4, -5, -5, -6, -7, -7, -8, -9, -9,
               -10, -11, -11, -12, -13, -13, -14, -14, -15, -16, -16, -17, -17, -18, -18, -18,
               -19, -19, -19, -19, -20, -20, -20, -20, -20, -20, -20, -19, -19, -19, -19, -18,
               -18, -17, -17, -16, -16, -15, -14, -14, -13, -12, -11, -10, -9, -8, -7, -6,
               -5, -4, -3, -2, -1, 0, 1, 2, 3, 5, 6, 7, 8, 9, 10, 11,
               12, 13, 14, 15, 16, 16, 17, 18, 19, 19, 20, 21, 21, 22, 22, 23,
               23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 23, 23,
               22, 22, 22, 21, 21, 20, 20, 19, 19, 18, 18, 17, 17, 16, 15, 15,
               14, 14, 13, 13, 12, 12, 11, 11, 10, 10, 9, 9, 9, 8, 8, 8,
               7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
               8, 8, 8, 9, 9, 9, 10, 10, 10, 11, 11, 12, 12, 12, 13, 13,
               14, 14, 15, 15, 15, 16, 16, 17, 17, 17, 18, 18, 18, 19, 19, 19,
               19, 20, 20, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 21, 21,
               21, 20, 20, 20, 20, 20, 20, 20, 20, 20, 19, 19, 19, 19, 19, 19,
               19, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
               18, 19, 19, 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 22, 22,
               22, 23, 23, 23, 24, 24, 24, 25, 25, 25, 26, 26, 26, 27, 27, 27,
               27, 28, 28, 28, 28, 28, 28, 28, 29, 29, 29, 28, 28, 28, 28, 28,
               28, 28, 27, 27, 27, 26, 26, 25, 25, 24, 24, 23, 23, 22, 21, 21,
               20, 19, 19, 18, 17, 16, 15, 14, 14, 13, 12, 11, 10, 9, 8, 7,
               6, 5, 4, 4, 3, 2, 1, 0, -1, -2, -3, -3, -4, -5, -6, -6,
               -7, -8, -8, -9, -9, -10, -10, -11, -11, -12, -12, -13, -13, -13, -13, -13,
               -14, -14, -14, -14, -14, -14, -14, -14, -14, -13, -13, -13, -13, -12, -12, -12,
               -11, -11, -11, -10, -10, -9, -9, -8, -8, -7, -7, -6, -5, -5, -4, -4,
               -3, -3, -2, -1, -1, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 4,
               5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
               5, 5, 5, 4, 4, 3, 3, 2, 2, 1, 0, -1, -1, -2, -3, -4,
               -5, -6, -7, -8, -9, -10, -12, -13, -14, -15, -17, -18, -19, -21, -22, -23,
               -25, -26, -27, -29, -30, -32, -33, -35, -36, -37, -39, -40, -42, -43, -44, -46,
               -47, -48, -49, -51, -52, -53, -54, -55, -56, -57, -58, -59, -60, -61, -62, -63,
               -63, -64, -65, -66, -66, -67, -67, -68, -68, -69, -69, -69, -70, -70, -70, -70,
               -70, -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, -71,
               -71, -71, -71, -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, -71, -71, -71,
               -71, -71, -71, -71, -71, -72, -72, -72, -72, -73, -73, -73, -74, -74, -74, -75,
               -75, -75, -76, -76, -76, -77, -77, -77, -78, -78, -78, -79, -79, -79, -79, -80,
               -80, -80, -80, -80, -80, -80, -80, -80, -80, -79, -79, -79, -79, -78, -78, -77,
               -77, -76, -75, -74, -74, -73, -72, -71, -70, -69, -67, -66, -65, -63, -62, -61,
               -59, -58, -56, -54, -53, -51, -49, -47, -46, -44, -42, -40, -38, -36, -34, -32,
               -30, -29, -27, -25, -23, -21, -19, -17, -15, -13, -12, -10, -8, -6, -5, -3,
               -1, 0, 2, 3, 5, 6, 8, 9, 10, 11, 13, 14, 15, 16, 17, 18,
               19, 19, 20, 21, 22, 22, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28,
               28, 28, 29, 29, 30, 30, 30, 31, 31, 31, 32, 32, 32, 33, 33, 34,
               34, 35, 35, 36, 36, 37, 37, 38, 38, 39, 40, 40, 41, 42, 42, 43,
               44, 45, 45, 46, 47, 48, 48, 49, 50, 51, 52, 52, 53, 54, 55, 55,
               56, 57, 57, 58, 59, 59, 60, 60, 61, 61, 61, 62, 62, 62, 62, 63,
               63, 63, 62, 62, 62, 62, 62, 61, 61, 60, 60, 59, 59, 58, 57, 57,
               56, 55, 54, 53, 52, 51, 50, 49, 48, 47, 45, 44, 43, 42, 41, 39,
               38, 37, 36, 35, 34, 33, 32, 30, 29, 28, 28, 27, 26, 25, 24, 24,
               23, 23, 22, 22, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22,
               23, 24, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 35, 36, 37, 39,
               40, 42, 43, 45, 46, 48, 50, 51, 53, 54, 56, 58, 59, 61, 62, 64,
               65, 67, 68, 70, 71, 73, 74, 75, 76, 78, 79, 80, 81, 82, 83, 84,
               85, 85, 86, 87, 87, 88, 88, 89, 89, 89, 90, 90, 90, 90, 90, 90,
               90, 90, 90, 90, 90, 90, 90, 89, 89, 89, 88, 88, 88, 87, 87, 86,
               86, 86, 85, 85, 84, 84, 83, 83, 83, 82, 82, 81, 81, 81, 80, 80,
               79, 79, 79, 78, 78, 78, 77, 77, 77, 77, 76, 76, 76, 76, 75, 75,
               75, 75, 74, 74, 74, 74, 73, 73, 73, 73, 72, 72, 72, 71, 71, 71,
               70, 70, 69, 69, 68, 68, 67, 67, 66, 65, 65, 64, 63, 62, 62, 61,
               60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, 49, 48, 46, 45, 44,
               43, 41, 40, 39, 38, 36, 35, 34, 32, 31, 30, 28, 27, 26, 24, 23,
               22, 20, 19, 18, 17, 15, 14, 13, 12, 10, 9, 8, 7, 6, 5, 4,
               3, 2, 1, 0, -1, -2, -3, -4, -5, -5, -6, -7, -8, -8, -9, -10,
               -10, -11, -12, -12, -13, -13, -14, -15, -15, -16, -16, -17, -17, -17, -18, -18,
               -19, -19, -19, -20, -20, -21, -21, -21, -22, -22, -22, -23, -23, -23, -24, -24,
               -24, -24, -25, -25, -25, -26, -26, -26, -26, -27, -27, -27, -27, -28, -28, -28,
               -28, -29, -29, -29, -29, -30, -30, -30, -30, -30, -31, -31, -31, -31, -31, -31,
               -32, -32, -32, -32, -32, -32, -33, -33, -33, -33, -33, -33, -33, -33, -34, -34,
               -34, -34, -34, -34, -34, -34, -34, -35, -35, -35, -35, -35, -35, -35, -36, -36,
               -36, -36, -36, -36, -37, -37, -37, -37, -37, -38, -38, -38, -38, -39, -39, -39,
               -39, -40, -40, -40, -41, -41, -41, -42, -42, -43, -43, -44, -44, -45, -45, -46,
               -46, -47, -47, -48, -48, -49, -50, -50, -51, -52, -52, -53, -54, -54, -55, -56,
               -57, -58, -58, -59, -60, -61, -62, -63, -64, -65, -66, -67, -68, -69, -70, -71,
               -72, -73, -74, -76, -77, -78, -79, -80, -82, -83, -84, -85, -86, -88, -89, -90,
               -92, -93, -94, -95, -97, -98, -99, -100, -102, -103, -104, -105, -106, -108, -109, -110,
               -111, -112, -113, -114, -115, -116, -117, -118, -118, -119, -120, -121, -121, -122, -122, -123,
               -123, -124, -124, -124, -124, -125, -125, -125, -125, -124, -124, -124, -124, -123, -123, -122,
               -122, -121, -121, -120, -119, -118, -117, -116, -115, -114, -113, -112, -111, -109, -108, -107,
               -105, -104, -102, -101, -99, -98, -96, -95, -93, -92, -90, -88, -87, -85, -84, -82,
               -80, -79, -77, -76, -74, -73, -71, -70, -68, -67, -65, -64, -63, -62, -60, -59,
               -58, -57, -56, -55, -54, -53, -52, -51, -51, -50, -49, -48, -48, -47, -47, -46,
               -46, -45, -45, -45, -45, -44, -44, -44, -44, -44, -43, -43, -43, -43, -43, -43,
               -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -42,
               -42, -42, -42, -42, -42, -41, -41, -41, -41, -40, -40, -39, -39, -39, -38, -38,
               -37, -37, -36, -36, -35, -35, -34, -34, -33, -32, -32, -31, -31, -30, -29, -29,
               -28, -28, -27, -26, -26, -25, -25, -24, -24, -23, -23, -22, -22, -21, -21, -20,
               -20, -20, -19, -19, -19, -18, -18, -18, -18, -17, -17, -17, -17, -17, -17, -16,
               -16, -16, -16, -16, -16, -16, -16, -15, -15, -15, -15, -15, -14, -14, -14, -14,
               -13, -13, -13, -12, -12, -11, -11, -10, -10, -9, -8, -8, -7, -6, -5, -4,
               -3, -2, -1, 0, 1, 2, 3, 4, 6, 7, 9, 10, 11, 13, 15, 16,
               18, 19, 21, 23, 25, 26, 28, 30, 32, 33, 35, 37, 39, 41, 42, 44,
               46, 48, 50, 51, 53, 55, 56, 58, 60, 61, 63, 64, 66, 67, 68, 70,
               71, 72, 73, 74, 76, 77, 78, 78, 79, 80, 81, 82, 82, 83, 84, 84,
               85, 85, 85, 86, 86, 86, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
               87, 87, 87, 87, 87, 87, 87, 87, 86, 86, 86, 86, 86, 86, 86, 86,
               86, 86, 86, 86, 85, 85, 85, 85, 85, 85, 85, 85, 86, 86, 86, 86,
               86, 86, 86, 86, 86, 86, 86, 86, 87, 87, 87, 87, 87, 87, 87, 87,
               87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 86, 86, 86, 86, 86, 85,
               85, 85, 84, 84, 83, 83, 82, 82, 81, 81, 80, 80, 79, 78, 78, 77,
               77, 76, 75, 74, 74, 73, 72, 71, 71, 70, 69, 69, 68, 67, 66, 66,
               65, 64, 64, 63, 63, 62, 61, 61, 60, 60, 60, 59, 59, 58, 58, 58,
               58, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 58, 58, 58,
               59, 59, 59, 60, 60, 61, 61, 62, 62, 63, 63, 64, 64, 65, 66, 66,
               67, 68, 68, 69, 70, 70, 71, 72, 72, 73, 74, 74, 75, 76, 76, 77,
               78, 78, 79, 79, 80, 81, 81, 82, 82, 83, 84, 84, 85, 85, 86, 86,
               86, 87, 87, 88, 88, 89, 89, 89, 90, 90, 90, 91, 91, 91, 91, 92,
               92, 92, 92, 92, 92, 92, 93, 93, 93, 93, 93, 93, 93, 93, 93, 92,
               92, 92, 92, 92, 91, 91, 91, 90, 90, 89, 89, 88, 88, 87, 87, 86,
               85, 84, 84, 83, 82, 81, 80, 79, 78, 76, 75, 74, 73, 71, 70, 68,
               67, 65, 64, 62, 60, 58, 57, 55, 53, 51, 49, 47, 45, 43, 41, 39,
               37, 34, 32, 30, 28, 25, 23, 21, 19, 16, 14, 12, 9, 7, 5, 3,
               0, -2, -4, -6, -8, -11, -13, -15, -17, -19, -21, -23, -25, -27, -29, -30,
               -32, -34, -36, -37, -39, -40, -42, -43, -45, -46, -47, -48, -50, -51, -52, -53,
               -54, -55, -56, -57, -58, -58, -59, -60, -60, -61, -62, -62, -63, -63, -64, -64,
               -64, -65, -65, -66, -66, -66, -66, -67, -67, -67, -67, -67, -68, -68, -68, -68,
               -68, -68, -68, -68, -68, -68, -68, -69, -69, -69, -69, -69, -69, -69, -69, -69,
               -69, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -67, -67, -67, -67, -66,
               -66, -66, -66, -65, -65, -64, -64, -64, -63, -63, -62, -62, -61, -61, -60, -59,
               -59, -58, -57, -57, -56, -55, -55, -54, -53, -52, -51, -51, -50, -49, -48, -47,
               -46, -46, -45, -44, -43, -42, -41, -41, -40, -39, -38, -38, -37, -36, -35, -35,
               -34, -33, -33, -32, -32, -31, -31, -30, -30, -30, -29, -29, -29, -29, -28, -28,
               -28, -28, -28, -28, -28, -28, -28, -29, -29, -29, -29, -30, -30, -30, -31, -31,
               -32, -32, -33, -34, -34, -35, -35, -36, -37, -38, -38, -39, -40, -41, -42, -42,
               -43, -44, -45, -46, -47, -48, -49, -49, -50, -51, -52, -53, -54, -55, -56, -57,
               -58, -59, -60, -60, -61, -62, -63, -64, -65, -66, -67, -68, -68, -69, -70, -71,
               -72, -73, -74, -74, -75, -76, -77, -78, -79, -79, -80, -81, -82, -83, -84, -84,
               -85, -86, -87, -88, -88, -89, -90, -91, -92, -92, -93, -94, -95, -95, -96, -97,
               -98, -98, -99, -100, -100, -101, -102, -102, -103, -103, -104, -105, -105, -106, -106, -106,
               -107, -107, -108, -108, -108, -108, -109, -109, -109, -109, -109, -109, -109, -109, -109, -109,
               -109, -108, -108, -108, -107, -107, -107, -106, -106, -105, -104, -104, -103, -102, -102, -101,
               -100, -99, -98, -97, -96, -95, -94, -93, -92, -91, -90, -89, -88, -87, -85, -84,
               -83, -82, -80, -79, -78, -76, -75, -74, -72, -71, -70, -68, -67, -66, -64, -63,
               -62, -60, -59, -57, -56, -55, -53, -52, -51, -49, -48, -47, -45, -44, -43, -42,
               -40, -39, -38, -36, -35, -34, -33, -31, -30, -29, -28, -27, -25, -24, -23, -22,
               -21, -19, -18, -17, -16, -15, -13, -12, -11, -10, -9, -8, -7, -5, -4, -3,
               -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 12,
               13, 14, 15, 16, 16, 17, 17, 18, 19, 19, 20, 20, 21, 21, 21, 22,
               22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 22, 22, 22, 22, 22, 21,
               21, 21, 20, 20, 19, 19, 18, 18, 17, 17, 16, 15, 15, 14, 13, 13,
               12, 11, 11, 10, 9, 9, 8, 7, 7, 6, 5, 5, 4, 3, 3, 2,
               2, 1, 1, 0, 0, -1, -1, -2, -2, -2, -3, -3, -3, -3, -3, -4,
               -4, -4, -4, -4, -4, -4, -4, -3, -3, -3, -3, -3, -2, -2, -2, -1,
               -1, -1, 0, 0, 1, 1, 1, 2, 2, 3, 3, 4, 4, 5, 6, 6,
               7, 7, 8, 8, 9, 9, 10, 11, 11, 12, 12, 13, 13, 14, 15, 15,
               16, 16, 17, 17, 18, 19, 19, 20, 20, 21, 21, 22, 23, 23, 24, 25,
               25, 26, 27, 27, 28, 29, 29, 30, 31, 32, 33, 33, 34, 35, 36, 37,
               38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 49, 50, 51, 52, 54, 55,
               56, 57, 59, 60, 61, 63, 64, 65, 67, 68, 69, 71, 72, 73, 75, 76,
               77, 79, 80, 81, 83, 84, 85, 86, 87, 89, 90, 91, 92, 93, 94, 95,
               96, 97, 98, 99, 100, 100, 101, 102, 103, 103, 104, 104, 105, 105, 106, 106,
               107, 107, 107, 108, 108, 108, 108, 109, 109, 109, 109, 109, 109, 109, 109, 109,
               109, 109, 108, 108, 108, 108, 108, 108, 107, 107, 107, 107, 106, 106, 106, 106,
               105, 105, 105, 105, 104, 104, 104, 103, 103, 103, 102, 102, 102, 102, 101, 101,
               101, 100, 100, 100, 100, 99, 99, 99, 98, 98, 98, 97, 97, 97, 97, 96,
               96, 96, 95, 95, 94, 94, 94, 93, 93, 93, 92, 92, 91, 91, 90, 90,
               89, 89, 88, 88, 87, 87, 86, 85, 85, 84, 84, 83, 82, 82, 81, 81,
               80, 79, 79, 78, 77, 76, 76, 75, 74, 74, 73, 72, 72, 71, 70, 70,
               69, 68, 68, 67, 67, 66, 65, 65, 64, 64, 63, 63, 62, 62, 61, 61,
               60, 60, 59, 59, 58, 58, 58, 57, 57, 57, 56, 56, 56, 55, 55, 55,
               55, 54, 54, 54, 54, 54, 53, 53, 53, 53, 53, 52, 52, 52, 52, 52,
               52, 51, 51, 51, 51, 51, 51, 50, 50, 50, 50, 50, 49, 49, 49, 49,
               48, 48, 48, 48, 47, 47, 47, 47, 46, 46, 46, 45, 45, 45, 44, 44,
               44, 43, 43, 42, 42, 42, 41, 41, 41, 40, 40, 39, 39, 39, 38, 38,
               37, 37, 37, 36, 36, 35, 35, 34, 34, 34, 33, 33, 32, 32, 31, 31,
               30, 30, 29, 29, 28, 28, 27, 27, 26, 26, 25, 25, 24, 23, 23, 22,
               22, 21, 20, 20, 19, 18, 17, 17, 16, 15, 14, 13, 12, 12, 11, 10,
               9, 8, 7, 6, 5, 4, 3, 1, 0, -1, -2, -3, -4, -6, -7, -8,
               -9, -11, -12, -13, -15, -16, -17, -19, -20, -21, -23, -24, -26, -27, -29, -30,
               -31, -33, -34, -36, -37, -38, -40, -41, -43, -44, -45, -47, -48, -50, -51, -52,
               -54, -55, -56, -57, -59, -60, -61, -62, -64, -65, -66, -67, -68, -69, -70, -71,
               -73, -74, -75, -76, -77, -78, -79, -80, -80, -81, -82, -83, -84, -85, -86, -87,
               -87, -88, -89, -90, -91, -91, -92, -93, -93, -94, -95, -96, -96, -97, -98, -98,
               -99, -99, -100, -101, -101, -102, -102, -103, -103, -104, -104, -105, -105, -106, -106, -107,
               -107, -108, -108, -108, -109, -109, -109, -110, -110, -110, -111, -111, -111, -111, -112, -112,
               -112, -112, -112, -112, -112, -112, -113, -113, -113, -113, -113, -113, -113, -113, -113, -112,
               -112, -112, -112, -112, -112, -112, -112, -112, -111, -111, -111, -111, -111, -110, -110, -110,
               -110, -110, -109, -109, -109, -109, -109, -108, -108, -108, -108, -108, -107, -107, -107, -107,
               -107, -107, -106, -106, -106, -106, -106, -106, -106, -105, -105, -105, -105, -105, -105, -105,
               -105, -105, -105, -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, -103, -103,
               -103, -103, -103, -103, -103, -102, -102, -102, -102, -101, -101, -101, -101, -100, -100, -100,
               -99, -99, -99, -98, -98, -97, -97, -96, -96, -96, -95, -95, -94, -93, -93, -92,
               -92, -91, -91, -90, -89, -89, -88, -88, -87, -86, -86, -85, -84, -84, -83, -83,
               -82, -81, -81, -80, -80, -79, -78, -78, -77, -77, -76, -76, -75, -75, -74, -74,
               -73, -73, -72, -72, -72, -71, -71, -70, -70, -70, -69, -69, -69, -68, -68, -68,
               -68, -67, -67, -67, -67, -66, -66, -66, -65, -65, -65, -65, -64, -64, -64, -63,
               -63, -63, -62, -62, -62, -61, -61, -60, -60, -59, -59, -59, -58, -57, -57, -56,
               -56, -55, -54, -54, -53, -52, -52, -51, -50, -49, -48, -47, -47, -46, -45, -44,
               -43, -42, -41, -40, -39, -38, -37, -36, -35, -34, -33, -32, -31, -29, -28, -27,
               -26, -25, -24, -23, -22, -21, -20, -19, -18, -17, -15, -14, -13, -12, -11, -10,
               -10, -9, -8, -7, -6, -5, -4, -3, -2, -1, -1, 0, 1, 2, 2, 3,
               4, 5, 5, 6, 7, 7, 8, 9, 9, 10, 11, 11, 12, 13, 13, 14,
               15, 15, 16, 16, 17, 18, 18, 19, 20, 20, 21, 22, 22, 23, 24, 24,
               25, 26, 26, 27, 28, 29, 29, 30, 31, 32, 32, 33, 34, 35, 36, 36,
               37, 38, 39, 40, 41, 41, 42, 43, 44, 45, 46, 46, 47, 48, 49, 50,
               51, 51, 52, 53, 54, 55, 55, 56, 57, 58, 58, 59, 60, 60, 61, 62,
               62, 63, 64, 64, 65, 65, 66, 67, 67, 68, 68, 69, 69, 69, 70, 70,
               71, 71, 72, 72, 72, 73, 73, 73, 74, 74, 74, 75, 75, 75, 76, 76,
               76, 77, 77, 77, 78, 78, 78, 78, 79, 79, 79, 80, 80, 80, 80, 81,
               81, 81, 82, 82, 82, 83, 83, 83, 84, 84, 85, 85, 85, 86, 86, 86,
               87, 87, 88, 88, 88, 89, 89, 90, 90, 91, 91, 91, 92, 92, 93, 93,
               93, 94, 94, 95, 95, 96, 96, 96, 97, 97, 98, 98, 98, 99, 99, 100,
               100, 100, 101, 101, 101, 102, 102, 103, 103, 103, 104, 104, 104, 104, 105, 105,
               105, 106, 106, 106, 107, 107, 107, 107, 108, 108, 108, 108, 109, 109, 109, 109,
               110, 110, 110, 110, 110, 111, 111, 111, 111, 111, 111, 112, 112, 112, 112, 112,
               112, 112, 112, 112, 112, 112, 113, 113, 113, 113, 113, 113, 112, 112, 112, 112,
               112, 112, 112, 112, 112, 111, 111, 111, 111, 111, 110, 110, 110, 110, 109, 109,
               109, 108, 108, 107, 107, 107, 106, 106, 105, 105, 104, 104, 103, 103, 102, 102,
               101, 101, 100, 99, 99, 98, 98, 97, 96, 96, 95, 95, 94, 93, 93, 92,
               91, 91, 90, 89, 89, 88, 87, 87, 86, 85, 85, 84, 83, 83, 82, 81,
               81, 80, 79, 79, 78, 77, 77, 76, 75, 75, 74, 73, 73, 72, 71, 70,
               70, 69, 68, 68, 67, 66, 65, 65, 64, 63, 62, 62, 61, 60, 59, 58,
               58, 57, 56, 55, 54, 53, 52, 52, 51, 50, 49, 48, 47, 46, 45, 44,
               43, 42, 41, 40, 39, 38, 37, 37, 36, 35, 34, 33, 32, 31, 30, 29,
               28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 17, 16, 15, 14,
               13, 12, 12, 11, 10, 9, 9, 8, 7, 7, 6, 5, 5, 4, 3, 3,
               2, 2, 1, 0, 0, -1, -1, -2, -2, -3, -3, -3, -4, -4, -5, -5,
               -6, -6, -6, -7, -7, -8, -8, -8, -9, -9, -10, -10, -10, -11, -11, -11,
               -12, -12, -13, -13, -14, -14, -14, -15, -15, -16, -16, -17, -17, -18, -18, -19,
               -19, -20, -20, -21, -21, -22, -23, -23, -24, -24, -25, -25, -26, -27, -27, -28,
               -29, -29, -30, -31, -31, -32, -33, -33, -34, -35, -35, -36, -37, -37, -38, -39,
               -40, -40, -41, -42, -42, -43, -44, -44, -45, -46, -46, -47, -48, -49, -49, -50,
               -51, -51, -52, -53, -53, -54, -55, -55, -56, -57, -57, -58, -58, -59, -60, -60,
               -61, -62, -62, -63, -64, -64, -65, -65, -66, -67, -67, -68, -68, -69, -70, -70,
               -71, -71, -72, -73, -73, -74, -74, -75, -75, -76, -77, -77, -78, -78, -79, -79,
               -80, -80, -81, -81, -82, -82, -83, -83, -84, -84, -85, -85, -86, -86, -87, -87,
               -88, -88, -89, -89, -89, -90, -90, -91, -91, -91, -92, -92, -92, -93, -93, -93,
               -94, -94, -94, -95, -95, -95, -96, -96, -96, -96, -97, -97, -97, -97, -98, -98,
               -98, -98, -99, -99, -99, -99, -99, -100, -100, -100, -100, -101, -101, -101, -101, -101,
               -102, -102, -102, -102, -102, -102, -103, -103, -103, -103, -103, -103, -103, -104, -104, -104,
               -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, -104,
               -104, -104, -104, -104, -104, -104, -103, -103, -103, -103, -103, -102, -102, -102, -102, -101,
               -101, -101, -100, -100, -100, -99, -99, -98, -98, -98, -97, -97, -96, -96, -95, -95,
               -94, -94, -93, -93, -92, -92, -91, -91, -90, -90, -89, -89, -88, -88, -87, -87,
               -86, -86, -85, -85, -84, -84, -83, -83, -82, -82, -81, -81, -81, -80, -80, -80,
               -79, -79, -79, -78, -78, -78, -77, -77, -77, -77, -76, -76, -76, -76, -76, -75,
               -75, -75, -75, -75, -75, -75, -74, -74, -74, -74, -74, -74, -74, -74, -73, -73,
               -73, -73, -73, -73, -73, -73, -72, -72, -72, -72, -72, -72, -71, -71, -71, -71,
               -71, -70, -70, -70, -70, -69, -69, -69, -68, -68, -68, -67, -67, -67, -66, -66,
               -65, -65, -65, -64, -64, -63, -63, -62, -62, -61, -61, -60, -60, -59, -59, -58,
               -58, -57, -57, -56, -55, -55, -54, -54, -53, -53, -52, -51, -51, -50, -50, -49,
               -48, -48, -47, -47, -46, -45, -45, -44, -43, -43, -42, -41, -41, -40, -39, -39,
               -38, -37, -37, -36, -35, -34, -34, -33, -32, -31, -31, -30, -29, -28, -27, -26,
               -25, -25, -24, -23, -22, -21, -20, -19, -18, -17, -16, -15, -14, -13, -12, -10,
               -9, -8, -7, -6, -5, -4, -2, -1, 0, 1, 2, 3, 5, 6, 7, 8,
               10, 11, 12, 13, 15, 16, 17, 18, 19, 21, 22, 23, 24, 25, 27, 28,
               29, 30, 31, 32, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
               46, 47, 48, 49, 49, 50, 51, 52, 53, 54, 54, 55, 56, 57, 57, 58,
               59, 60, 60, 61, 62, 62, 63, 64, 64, 65, 66, 66, 67, 68, 68, 69,
               69, 70, 71, 71, 72, 72, 73, 74, 74, 75, 75, 76, 77, 77, 78, 78,
               79, 79, 80, 80, 81, 82, 82, 83, 83, 84, 84, 85, 85, 86, 86, 87,
               87, 88, 88, 89, 89, 90, 90, 90, 91, 91, 92, 92, 92, 93, 93, 93,
               94, 94, 94, 95, 95, 95, 95, 96, 96, 96, 96, 96, 97, 97, 97, 97,
               97, 97, 97, 97, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98,
               98, 98, 98, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 100, 100, 100,
               100, 100, 100, 101, 101, 101, 101, 102, 102, 102, 102, 103, 103, 103, 104, 104,
               104, 105, 105, 105, 106, 106, 107, 107, 107, 108, 108, 109, 109, 109, 110, 110,
               110, 111, 111, 112, 112, 112, 113, 113, 113, 114, 114, 114, 114, 115, 115, 115,
               115, 115, 115, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 115,
               115, 115, 115, 115, 114, 114, 114, 113, 113, 113, 112, 112, 112, 111, 111, 110,
               110, 109, 109, 108, 108, 107, 107, 106, 106, 105, 105, 104, 103, 103, 102, 102,
               101, 100, 100, 99, 98, 98, 97, 97, 96, 95, 95, 94, 94, 93, 92, 92,
               91, 90, 90, 89, 89, 88, 87, 87, 86, 86, 85, 84, 84, 83, 83, 82,
               81, 81, 80, 79, 79, 78, 77, 77, 76, 75, 75, 74, 73, 73, 72, 71,
               71, 70, 69, 68, 68, 67, 66, 65, 64, 64, 63, 62, 61, 60, 59, 59,
               58, 57, 56, 55, 54, 53, 52, 51, 50, 50, 49, 48, 47, 46, 45, 44,
               43, 42, 41, 40, 39, 38, 37, 36, 35, 35, 34, 33, 32, 31, 30, 29,
               28, 28, 27, 26, 25, 24, 24, 23, 22, 21, 21, 20, 19, 18, 18, 17,
               16, 16, 15, 15, 14, 13, 13, 12, 12, 11, 11, 10, 9, 9, 8, 8,
               7, 7, 7, 6, 6, 5, 5, 4, 4, 3, 3, 2, 2, 1, 1, 0,
               0, -1, -1, -2, -2, -3, -3, -4, -4, -5, -6, -6, -7, -7, -8, -9,
               -9, -10, -11, -11, -12, -13, -13, -14, -15, -16, -17, -17, -18, -19, -20, -21,
               -21, -22, -23, -24, -25, -26, -27, -28, -29, -30, -31, -31, -32, -33, -34, -35,
               -36, -37, -38, -39, -40, -41, -42, -43, -44, -45, -46, -47, -48, -49, -50, -51,
               -52, -53, -54, -55, -56, -57, -57, -58, -59, -60, -61, -62, -63, -64, -65, -65,
               -66, -67, -68, -69, -70, -71, -71, -72, -73, -74, -75, -75, -76, -77, -78, -78,
               -79, -80, -81, -81, -82, -83, -84, -84, -85, -86, -86, -87, -88, -89, -89, -90,
               -91, -91, -92, -93, -93, -94, -95, -95, -96, -97, -97, -98, -99, -99, -100, -101,
               -101, -102, -102, -103, -104, -104, -105, -105, -106, -107, -107, -108, -108, -109, -109, -110,
               -110, -111, -111, -112, -112, -113, -113, -114, -114, -115, -115, -116, -116, -116, -117, -117,
               -117, -118, -118, -118, -119, -119, -119, -119, -120, -120, -120, -120, -120, -121, -121, -121,
               -121, -121, -121, -121, -121, -121, -121, -121, -121, -121, -121, -121, -121, -121, -121, -120,
               -120, -120, -120, -120, -120, -119, -119, -119, -119, -118, -118, -118, -118, -117, -117, -117,
               -116, -116, -116, -115, -115, -115, -114, -114, -114, -113, -113, -113, -112, -112, -111, -111,
               -111, -110, -110, -110, -109, -109, -108, -108, -108, -107, -107, -106, -106, -106, -105, -105,
               -104, -104, -104, -103, -103, -103, -102, -102, -101, -101, -101, -100, -100, -100, -99, -99,
               -98, -98, -98, -97, -97, -96, -96, -96, -95, -95, -94, -94, -94, -93, -93, -92,
               -92, -92, -91, -91, -90, -90, -89, -89, -88, -88, -87, -87, -87, -86, -86, -85,
               -85, -84, -83, -83, -82, -82, -81, -81, -80, -80, -79, -79, -78, -77, -77, -76,
               -76, -75, -74, -74, -73, -73, -72, -71, -71, -70, -70, -69, -68, -68, -67, -66,
               -66, -65, -65, -64, -63, -63, -62, -61, -61, -60, -59, -59, -58, -58, -57, -56,
               -56, -55, -54, -54, -53, -53, -52, -51, -51, -50, -49, -49, -48, -48, -47, -46,
               -46, -45, -44, -44, -43, -43, -42, -41, -41, -40, -39, -39, -38, -37, -37, -36,
               -35, -35, -34, -33, -32, -32, -31, -30, -29, -29, -28, -27, -26, -26, -25, -24,
               -23, -22, -21, -21, -20, -19, -18, -17, -16, -15, -15, -14, -13, -12, -11, -10,
               -9, -8, -7, -6, -5, -4, -3, -2, -2, -1, 0, 1, 2, 3, 4, 5,
               6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 16, 17, 18, 19, 20,
               21, 22, 23, 24, 24, 25, 26, 27, 28, 29, 29, 30, 31, 32, 33, 34,
               34, 35, 36, 37, 37, 38, 39, 40, 40, 41, 42, 43, 43, 44, 45, 45,
               46, 47, 48, 48, 49, 50, 50, 51, 52, 53, 53, 54, 55, 55, 56, 57,
               58, 58, 59, 60, 60, 61, 62, 62, 63, 64, 65, 65, 66, 67, 67, 68,
               69, 69, 70, 71, 71, 72, 73, 73, 74, 75, 75, 76, 77, 77, 78, 78,
               79, 80, 80, 81, 81, 82, 82, 83, 83, 84, 85, 85, 86, 86, 86, 87,
               87, 88, 88, 89, 89, 90, 90, 90, 91, 91, 91, 92, 92, 93, 93, 93,
               94, 94, 94, 95, 95, 95, 95, 96, 96, 96, 97, 97, 97, 98, 98, 98,
               98, 99, 99, 99, 100, 100, 100, 101, 101, 101, 102, 102, 102, 103, 103, 103,
               104, 104, 105, 105, 105, 106, 106, 107, 107, 108, 108, 108, 109, 109, 110, 110,
               111, 111, 112, 112, 113, 113, 114, 114, 114, 115, 115, 116, 116, 117, 117, 118,
               118, 119, 119, 119, 120, 120, 121, 121, 121, 122, 122, 122, 123, 123, 123, 124,
               124, 124, 124, 125, 125, 125, 125, 125, 126, 126, 126, 126, 126, 126, 126, 126,
               126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 125, 125, 125,
               125, 125, 124, 124, 124, 124, 124, 123, 123, 123, 123, 122, 122, 122, 121, 121,
               121, 121, 120, 120, 120, 119, 119, 119, 118, 118, 118, 117, 117, 117, 116, 116,
               115, 115, 115, 114, 114, 114, 113, 113, 112, 112, 112, 111, 111, 110, 110, 109,
               109, 108, 108, 107, 107, 106, 106, 105, 105, 104, 104, 103, 102, 102, 101, 101,
               100, 99, 99, 98, 97, 97, 96, 95, 94, 94, 93, 92, 91, 90, 89, 89,
               88, 87, 86, 85, 84, 83, 82, 81, 80, 79, 78, 77, 76, 75, 74, 73,
               72, 71, 70, 69, 68, 66, 65, 64, 63, 62, 61, 60, 58, 57, 56, 55,
               54, 53, 51, 50, 49, 48, 47, 46, 44, 43, 42, 41, 40, 38, 37, 36,
               35, 34, 33, 32, 30, 29, 28, 27, 26, 25, 23, 22, 21, 20, 19, 18,
               17, 16, 15, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 2, 1, 0,
               -1, -2, -3, -4, -5, -6, -7, -8, -9, -10, -11, -12, -13, -14, -15, -17,
               -18, -19, -20, -21, -22, -23, -24, -25, -26, -27, -28, -29, -30, -31, -32, -33,
               -34, -35, -36, -37, -38, -39, -40, -41, -42, -43, -44, -45, -46, -47, -47, -48,
               -49, -50, -51, -52, -53, -54, -55, -56, -57, -58, -59, -59, -60, -61, -62, -63,
               -64, -65, -65, -66, -67, -68, -69, -70, -70, -71, -72, -73, -74, -74, -75, -76,
               -77, -78, -78, -79, -80, -81, -82, -82, -83, -84, -85, -85, -86, -87, -87, -88,
               -89, -90, -90, -91, -92, -92, -93, -94, -95, -95, -96, -97, -97, -98, -99, -99,
               -100, -101, -101, -102, -102, -103, -104, -104, -105, -106, -106, -107, -107, -108, -108, -109,
               -110, -110, -111, -111, -112, -112, -113, -113, -114, -114, -115, -115, -116, -116, -116, -117,
               -117, -118, -118, -119, -119, -119, -120, -120, -120, -121, -121, -121, -122, -122, -122, -123,
               -123, -123, -123, -124, -124, -124, -124, -124, -125, -125, -125, -125, -125, -126, -126, -126,
               -126, -126, -126, -126, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127,
               -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127,
               -127, -127, -127, -127, -127, -127, -127, -127, -126, -126, -126, -126, -126, -126, -126, -126,
               -126, -125, -125, -125, -125, -125, -125, -124, -124, -124, -124, -124, -124, -123, -123, -123,
               -123, -122, -122, -122, -122, -122, -121, -121, -121, -120, -120, -120, -120, -119, -119, -119,
               -118, -118, -118, -117, -117, -116, -116, -116, -115, -115, -115, -114, -114, -113, -113, -112,
               -112, -111, -111, -111, -110, -110, -109, -109, -108, -107, -107, -106, -106, -105, -105, -104,
               -104, -103, -102, -102, -101, -100, -100, -99, -99, -98, -97, -97, -96, -95, -94, -94,
               -93, -92, -92, -91, -90, -89, -89, -88, -87, -86, -86, -85, -84, -83, -82, -82,
               -81, -80, -79, -78, -77, -77, -76, -75, -74, -73, -72, -71, -71, -70, -69, -68,
               -67, -66, -65, -64, -64, -63, -62, -61, -60, -59, -58, -57, -56, -56, -55, -54,
               -53, -52, -51, -50, -49, -48, -47, -46, -46, -45, -44, -43, -42, -41, -40, -39,
               -38, -37, -36, -36, -35, -34, -33, -32, -31, -30, -29, -28, -27, -26, -26, -25,
               -24, -23, -22, -21, -20, -19, -18, -17, -16, -16, -15, -14, -13, -12, -11, -10,
               -9, -8, -7, -6, -5, -4, -4, -3, -2, -1 ]

tune_still_alive = [
    0, 91,
    48, 90,
    96, 88,
    144, 88,
    192, 69,
    192, 90,
    240, 74,
    288, 78,
    336, 74,
    384, 71,
    432, 74,
    480, 78,
    528, 74,
    576, 69,
    624, 74,
    672, 78,
    720, 74,
    720, 81,
    768, 71,
    768, 91,
    816, 74,
    816, 90,
    864, 78,
    864, 88,
    912, 74,
    912, 88,
    960, 69,
    1008, 74,
    1008, 90,
    1056, 78,
    1104, 74,
    1152, 71,
    1152, 86,
    1200, 74,
    1248, 78,
    1248, 88,
    1296, 74,
    1296, 81,
    1344, 69,
    1392, 74,
    1440, 78,
    1488, 74,
    1536, 71,
    1584, 74,
    1632, 78,
    1680, 74,
    1680, 81,
    1728, 71,
    1728, 88,
    1776, 76,
    1824, 79,
    1824, 90,
    1872, 76,
    1872, 91,
    1920, 71,
    1968, 76,
    2016, 79,
    2016, 88,
    2064, 76,
    2064, 85,
    2112, 69,
    2160, 73,
    2160, 86,
    2208, 79,
    2256, 73,
    2304, 69,
    2304, 88,
    2352, 73,
    2400, 79,
    2400, 81,
    2448, 73,
    2448, 81,
    2496, 69,
    2544, 74,
    2544, 90,
    2592, 78,
    2640, 74,
    2688, 71,
    2736, 74,
    2784, 78,
    2832, 74,
    2880, 69,
    2928, 74,
    2976, 78,
    3024, 74,
    3072, 71,
    3072, 91,
    3120, 74,
    3120, 90,
    3168, 78,
    3168, 88,
    3216, 74,
    3216, 88,
    3264, 69,
    3264, 90,
    3312, 74,
    3360, 78,
    3408, 74,
    3456, 71,
    3504, 74,
    3552, 78,
    3600, 74,
    3648, 69,
    3696, 74,
    3744, 78,
    3792, 74,
    3792, 81,
    3840, 71,
    3840, 91,
    3888, 74,
    3888, 90,
    3936, 78,
    3936, 88,
    3984, 74,
    3984, 88,
    4032, 69,
    4080, 74,
    4128, 78,
    4128, 90,
    4176, 74,
    4176, 86,
    4224, 71,
    4272, 74,
    4320, 78,
    4320, 88,
    4368, 74,
    4368, 81,
    4416, 69,
    4464, 74,
    4512, 78,
    4560, 74,
    4608, 71,
    4656, 74,
    4704, 78,
    4752, 74,
    4800, 71,
    4800, 88,
    4848, 76,
    4896, 79,
    4896, 90,
    4944, 76,
    4944, 91,
    4992, 71,
    5040, 76,
    5088, 79,
    5088, 88,
    5136, 76,
    5136, 85,
    5184, 69,
    5232, 73,
    5280, 79,
    5280, 86,
    5328, 73,
    5328, 88,
    5376, 69,
    5424, 73,
    5424, 81,
    5472, 79,
    5472, 86,
    5520, 73,
    5520, 88,
    5568, 70,
    5568, 89,
    5616, 74,
    5616, 88,
    5664, 77,
    5664, 86,
    5712, 81,
    5712, 84,
    5856, 81,
    5904, 82,
    5949, 89,
    5952, 105,
    5952, 72,
    5952, 77,
    5952, 84,
    6000, 81,
    6000, 96,
    6048, 108,
    6048, 72,
    6048, 77,
    6048, 89,
    6096, 96,
    6144, 103,
    6144, 72,
    6144, 76,
    6144, 88,
    6144, 88,
    6192, 79,
    6192, 86,
    6192, 96,
    6240, 108,
    6240, 72,
    6240, 76,
    6240, 86,
    6288, 84,
    6288, 96,
    6336, 106,
    6336, 70,
    6336, 74,
    6336, 86,
    6336, 86,
    6384, 105,
    6384, 82,
    6384, 84,
    6384, 96,
    6432, 103,
    6432, 70,
    6432, 74,
    6432, 84,
    6480, 76,
    6480, 96,
    6528, 105,
    6528, 72,
    6528, 77,
    6528, 84,
    6528, 89,
    6576, 81,
    6576, 96,
    6624, 101,
    6624, 72,
    6624, 77,
    6624, 81,
    6672, 82,
    6672, 96,
    6717, 89,
    6720, 105,
    6720, 72,
    6720, 77,
    6720, 84,
    6768, 81,
    6768, 96,
    6816, 108,
    6816, 72,
    6816, 77,
    6816, 89,
    6864, 96,
    6912, 103,
    6912, 72,
    6912, 76,
    6912, 88,
    6912, 91,
    6960, 79,
    6960, 89,
    6960, 96,
    7008, 108,
    7008, 72,
    7008, 76,
    7008, 88,
    7056, 86,
    7056, 96,
    7104, 106,
    7104, 70,
    7104, 74,
    7104, 86,
    7104, 86,
    7152, 105,
    7152, 82,
    7152, 88,
    7152, 96,
    7200, 103,
    7200, 70,
    7200, 74,
    7200, 89,
    7248, 76,
    7248, 96,
    7296, 105,
    7296, 72,
    7296, 77,
    7296, 89,
    7296, 89,
    7344, 81,
    7344, 96,
    7392, 101,
    7392, 72,
    7392, 77,
    7392, 91,
    7440, 93,
    7440, 96,
    7488, 103,
    7488, 70,
    7488, 74,
    7488, 91,
    7488, 94,
    7536, 106,
    7536, 79,
    7536, 94,
    7584, 105,
    7584, 70,
    7584, 74,
    7584, 93,
    7632, 103,
    7632, 79,
    7680, 100,
    7680, 72,
    7680, 76,
    7680, 91,
    7680, 91,
    7728, 101,
    7728, 79,
    7776, 103,
    7776, 72,
    7776, 76,
    7776, 89,
    7824, 108,
    7824, 79,
    7824, 91,
    7872, 105,
    7872, 72,
    7872, 77,
    7872, 89,
    7872, 93,
    7920, 108,
    7920, 81,
    7920, 93,
    7968, 103,
    7968, 72,
    7968, 77,
    7968, 88,
    7968, 91,
    8016, 108,
    8016, 81,
    8064, 101,
    8064, 74,
    8064, 77,
    8064, 86,
    8064, 89,
    8112, 81,
    8112, 93,
    8160, 105,
    8160, 74,
    8160, 77,
    8160, 86,
    8208, 81,
    8208, 84,
    8253, 89,
    8256, 106,
    8256, 70,
    8256, 74,
    8256, 86,
    8304, 79,
    8304, 89,
    8304, 98,
    8352, 101,
    8352, 70,
    8352, 74,
    8352, 89,
    8400, 79,
    8400, 88,
    8400, 98,
    8448, 105,
    8448, 69,
    8448, 73,
    8448, 88,
    8496, 79,
    8496, 88,
    8496, 97,
    8544, 103,
    8544, 69,
    8544, 73,
    8544, 74,
    8544, 90,
    8592, 102,
    8592, 79,
    8592, 90,
    8640, 62,
    8640, 69,
    8688, 74,
    8736, 78,
    8784, 62,
    8784, 74,
    8832, 59,
    8832, 71,
    8880, 74,
    8928, 78,
    8976, 59,
    8976, 74,
    9024, 62,
    9024, 69,
    9072, 74,
    9120, 78,
    9168, 62,
    9168, 74,
    9216, 59,
    9216, 71,
    9264, 74,
    9312, 78,
    9360, 59,
    9360, 74,
    9408, 62,
    9408, 69,
    9456, 74,
    9504, 78,
    9552, 62,
    9552, 74,
    9600, 59,
    9600, 71,
    9648, 74,
    9696, 78,
    9744, 59,
    9744, 74,
    9792, 62,
    9792, 69,
    9840, 74,
    9888, 78,
    9936, 62,
    9936, 74,
    9936, 81,
    9984, 71,
    9984, 71,
    9984, 91,
    10032, 74,
    10032, 90,
    10080, 71,
    10080, 78,
    10080, 88,
    10128, 69,
    10128, 74,
    10128, 88,
    10176, 62,
    10176, 69,
    10176, 90,
    10224, 74,
    10272, 78,
    10320, 62,
    10320, 74,
    10368, 59,
    10368, 71,
    10416, 74,
    10464, 78,
    10512, 59,
    10512, 74,
    10560, 62,
    10560, 69,
    10608, 74,
    10656, 78,
    10704, 62,
    10704, 74,
    10752, 59,
    10752, 71,
    10752, 91,
    10800, 74,
    10800, 90,
    10848, 78,
    10848, 88,
    10896, 59,
    10896, 74,
    10896, 88,
    10944, 62,
    10944, 69,
    10992, 74,
    11040, 78,
    11040, 90,
    11088, 62,
    11088, 74,
    11088, 86,
    11136, 59,
    11136, 71,
    11184, 74,
    11184, 88,
    11232, 78,
    11280, 59,
    11280, 74,
    11280, 81,
    11328, 62,
    11328, 69,
    11376, 74,
    11424, 78,
    11472, 62,
    11472, 74,
    11520, 59,
    11520, 71,
    11568, 74,
    11616, 78,
    11664, 59,
    11664, 74,
    11712, 64,
    11712, 71,
    11712, 88,
    11760, 76,
    11808, 79,
    11808, 90,
    11856, 64,
    11856, 76,
    11856, 91,
    11904, 64,
    11904, 71,
    11952, 66,
    11952, 76,
    12000, 67,
    12000, 79,
    12000, 88,
    12048, 76,
    12096, 57,
    12096, 69,
    12096, 85,
    12144, 73,
    12192, 79,
    12192, 86,
    12240, 57,
    12240, 73,
    12240, 88,
    12288, 57,
    12288, 69,
    12336, 59,
    12336, 73,
    12384, 61,
    12384, 79,
    12384, 81,
    12432, 73,
    12432, 81,
    12480, 62,
    12480, 69,
    12528, 74,
    12528, 90,
    12576, 78,
    12624, 62,
    12624, 74,
    12672, 59,
    12672, 71,
    12720, 74,
    12768, 78,
    12816, 59,
    12816, 74,
    12864, 62,
    12864, 69,
    12912, 74,
    12960, 78,
    13008, 62,
    13008, 74,
    13008, 81,
    13008, 86,
    13056, 71,
    13056, 71,
    13056, 91,
    13056, 95,
    13104, 74,
    13104, 90,
    13104, 93,
    13152, 71,
    13152, 78,
    13152, 88,
    13152, 91,
    13200, 69,
    13200, 74,
    13200, 88,
    13200, 91,
    13248, 62,
    13248, 69,
    13248, 90,
    13248, 93,
    13296, 74,
    13344, 78,
    13392, 62,
    13392, 74,
    13440, 59,
    13440, 71,
    13488, 74,
    13536, 78,
    13584, 59,
    13584, 74,
    13632, 62,
    13632, 69,
    13680, 74,
    13728, 78,
    13776, 62,
    13776, 74,
    13776, 81,
    13776, 86,
    13824, 59,
    13824, 71,
    13824, 91,
    13824, 95,
    13872, 74,
    13872, 90,
    13872, 93,
    13920, 78,
    13920, 88,
    13920, 91,
    13968, 59,
    13968, 74,
    13968, 88,
    13968, 91,
    14016, 62,
    14016, 69,
    14064, 74,
    14112, 78,
    14112, 90,
    14112, 93,
    14160, 62,
    14160, 74,
    14160, 86,
    14160, 90,
    14208, 59,
    14208, 71,
    14256, 74,
    14304, 78,
    14304, 88,
    14304, 91,
    14352, 59,
    14352, 74,
    14352, 81,
    14352, 86,
    14400, 62,
    14400, 69,
    14448, 74,
    14496, 78,
    14544, 62,
    14544, 74,
    14592, 59,
    14592, 71,
    14640, 74,
    14688, 78,
    14736, 59,
    14736, 74,
    14784, 64,
    14784, 71,
    14784, 88,
    14832, 76,
    14880, 79,
    14880, 90,
    14928, 64,
    14928, 76,
    14928, 91,
    14976, 64,
    14976, 71,
    15024, 66,
    15024, 76,
    15072, 67,
    15072, 79,
    15072, 88,
    15120, 76,
    15168, 57,
    15168, 69,
    15168, 85,
    15216, 73,
    15264, 79,
    15264, 86,
    15312, 57,
    15312, 73,
    15312, 88,
    15360, 57,
    15360, 69,
    15408, 59,
    15408, 73,
    15408, 81,
    15456, 61,
    15456, 79,
    15456, 86,
    15504, 57,
    15504, 73,
    15504, 88,
    15552, 58,
    15552, 70,
    15552, 89,
    15600, 74,
    15600, 88,
    15648, 81,
    15648, 86,
    15696, 70,
    15696, 77,
    15696, 84,
    15744, 81,
    15792, 77,
    15840, 70,
    15840, 77,
    15840, 81,
    15840, 81,
    15888, 57,
    15888, 77,
    15888, 79,
    15888, 82,
    15936, 65,
    15936, 72,
    15936, 77,
    15936, 81,
    15936, 84,
    15984, 81,
    16032, 72,
    16032, 77,
    16032, 84,
    16032, 89,
    16080, 65,
    16128, 60,
    16128, 72,
    16128, 76,
    16128, 84,
    16128, 88,
    16176, 79,
    16176, 86,
    16224, 72,
    16224, 76,
    16224, 82,
    16224, 86,
    16272, 60,
    16272, 81,
    16272, 84,
    16320, 58,
    16320, 70,
    16320, 74,
    16320, 82,
    16320, 86,
    16368, 81,
    16368, 82,
    16368, 84,
    16416, 70,
    16416, 74,
    16416, 81,
    16416, 84,
    16464, 58,
    16464, 76,
    16512, 65,
    16512, 72,
    16512, 77,
    16512, 81,
    16512, 84,
    16560, 81,
    16608, 72,
    16608, 77,
    16608, 79,
    16608, 81,
    16656, 77,
    16656, 82,
    16704, 65,
    16704, 72,
    16704, 77,
    16704, 77,
    16704, 84,
    16752, 81,
    16800, 72,
    16800, 77,
    16800, 81,
    16800, 89,
    16848, 65,
    16896, 60,
    16896, 72,
    16896, 76,
    16896, 82,
    16896, 91,
    16944, 79,
    16944, 81,
    16944, 89,
    16992, 72,
    16992, 76,
    16992, 79,
    16992, 88,
    17040, 60,
    17040, 77,
    17040, 86,
    17088, 58,
    17088, 70,
    17088, 74,
    17088, 77,
    17088, 86,
    17136, 79,
    17136, 82,
    17136, 88,
    17184, 70,
    17184, 74,
    17184, 81,
    17184, 89,
    17232, 58,
    17232, 76,
    17280, 65,
    17280, 72,
    17280, 77,
    17280, 81,
    17280, 89,
    17328, 81,
    17376, 65,
    17376, 72,
    17376, 77,
    17376, 82,
    17376, 91,
    17424, 60,
    17424, 84,
    17424, 93,
    17472, 58,
    17472, 70,
    17472, 74,
    17472, 86,
    17472, 94,
    17520, 79,
    17520, 86,
    17520, 94,
    17568, 58,
    17568, 70,
    17568, 74,
    17568, 84,
    17568, 93,
    17616, 79,
    17664, 60,
    17664, 72,
    17664, 76,
    17664, 84,
    17664, 91,
    17712, 79,
    17760, 60,
    17760, 72,
    17760, 76,
    17760, 81,
    17760, 89,
    17808, 79,
    17808, 82,
    17808, 91,
    17856, 65,
    17856, 72,
    17856, 77,
    17856, 84,
    17856, 93,
    17904, 81,
    17904, 84,
    17904, 93,
    17952, 64,
    17952, 72,
    17952, 77,
    17952, 82,
    17952, 91,
    18000, 81,
    18000, 89,
    18048, 62,
    18048, 74,
    18048, 77,
    18048, 81,
    18048, 89,
    18096, 81,
    18144, 60,
    18144, 74,
    18144, 77,
    18144, 79,
    18144, 86,
    18192, 77,
    18192, 81,
    18192, 84,
    18240, 58,
    18240, 70,
    18240, 74,
    18240, 77,
    18240, 86,
    18288, 79,
    18288, 79,
    18288, 89,
    18336, 65,
    18336, 70,
    18336, 74,
    18336, 81,
    18336, 89,
    18384, 79,
    18384, 79,
    18384, 88,
    18432, 57,
    18432, 69,
    18432, 73,
    18480, 79,
    18480, 79,
    18480, 88,
    18528, 64,
    18528, 69,
    18528, 73,
    18528, 81,
    18528, 90,
    18576, 79,
    18576, 81,
    18576, 90,
    18624, 62,
    18624, 69,
    18672, 74,
    18720, 78,
    18768, 62,
    18768, 74,
    18816, 59,
    18816, 71,
    18864, 74,
    18912, 78,
    18960, 59,
    18960, 74,
    19008, 62,
    19008, 69,
    19056, 74,
    19104, 78,
    19152, 62,
    19152, 74,
    19200, 59,
    19200, 71,
    19248, 74,
    19296, 78,
    19344, 59,
    19344, 74,
    19392, 62,
    19392, 69,
    19440, 74,
    19488, 78,
    19536, 62,
    19536, 74,
    19584, 59,
    19584, 71,
    19632, 74,
    19680, 78,
    19728, 59,
    19728, 74,
    19776, 62,
    19776, 69,
    19824, 74,
    19872, 78,
    19920, 62,
    19920, 74,
    19968, 71,
    19968, 71,
    19968, 91,
    19992, 91,
    20016, 74,
    20016, 90,
    20064, 71,
    20064, 78,
    20064, 88,
    20112, 69,
    20112, 74,
    20112, 88,
    20160, 69,
    20184, 90,
    20208, 74,
    20256, 78,
    20304, 74,
    20352, 71,
    20400, 74,
    20448, 78,
    20496, 74,
    20544, 69,
    20592, 74,
    20640, 78,
    20688, 74,
    20688, 81,
    20736, 71,
    20736, 91,
    20784, 74,
    20784, 90,
    20832, 78,
    20832, 88,
    20880, 74,
    20880, 88,
    20928, 69,
    20976, 74,
    21024, 78,
    21024, 90,
    21072, 74,
    21072, 86,
    21120, 71,
    21168, 74,
    21216, 78,
    21216, 88,
    21264, 74,
    21264, 81,
    21312, 69,
    21360, 74,
    21408, 78,
    21456, 74,
    21504, 71,
    21552, 74,
    21600, 78,
    21648, 74,
    21696, 71,
    21696, 88,
    21744, 76,
    21792, 79,
    21792, 90,
    21840, 76,
    21840, 91,
    21888, 71,
    21936, 76,
    21984, 79,
    21984, 88,
    22032, 76,
    22080, 69,
    22080, 85,
    22128, 73,
    22176, 79,
    22176, 86,
    22224, 73,
    22224, 88,
    22272, 69,
    22320, 73,
    22368, 79,
    22368, 81,
    22416, 73,
    22416, 81,
    22464, 69,
    22512, 74,
    22512, 90,
    22560, 78,
    22608, 74,
    22656, 71,
    22704, 74,
    22752, 78,
    22800, 74,
    22848, 69,
    22896, 74,
    22944, 78,
    22992, 74,
    23040, 71,
    23040, 91,
    23040, 95,
    23088, 74,
    23088, 90,
    23088, 93,
    23136, 78,
    23136, 88,
    23136, 91,
    23184, 74,
    23184, 88,
    23184, 91,
    23232, 62,
    23232, 69,
    23244, 90,
    23244, 93,
    23280, 74,
    23328, 78,
    23376, 62,
    23376, 74,
    23424, 59,
    23424, 71,
    23472, 74,
    23520, 78,
    23568, 59,
    23568, 74,
    23616, 62,
    23616, 69,
    23664, 74,
    23712, 78,
    23760, 62,
    23760, 74,
    23808, 59,
    23808, 71,
    23808, 91,
    23808, 95,
    23856, 74,
    23856, 90,
    23856, 93,
    23904, 78,
    23904, 88,
    23904, 91,
    23952, 59,
    23952, 74,
    23952, 88,
    23952, 91,
    24000, 62,
    24000, 69,
    24048, 74,
    24096, 78,
    24096, 90,
    24096, 93,
    24144, 62,
    24144, 74,
    24144, 86,
    24144, 90,
    24192, 59,
    24192, 71,
    24240, 74,
    24288, 78,
    24288, 88,
    24288, 91,
    24336, 59,
    24336, 74,
    24336, 81,
    24336, 86,
    24384, 62,
    24384, 69,
    24432, 74,
    24480, 78,
    24528, 62,
    24528, 74,
    24576, 59,
    24576, 71,
    24624, 74,
    24672, 78,
    24720, 59,
    24720, 74,
    24768, 64,
    24768, 71,
    24768, 88,
    24816, 76,
    24864, 79,
    24864, 90,
    24912, 64,
    24912, 76,
    24912, 91,
    24960, 64,
    24960, 71,
    25008, 66,
    25008, 76,
    25056, 67,
    25056, 79,
    25056, 88,
    25104, 76,
    25152, 57,
    25152, 69,
    25152, 85,
    25200, 73,
    25248, 79,
    25248, 86,
    25296, 57,
    25296, 73,
    25296, 88,
    25344, 57,
    25344, 69,
    25392, 59,
    25392, 73,
    25392, 81,
    25440, 61,
    25440, 79,
    25440, 86,
    25488, 57,
    25488, 73,
    25488, 88,
    25536, 58,
    25536, 70,
    25536, 89,
    25584, 74,
    25584, 88,
    25632, 81,
    25632, 86,
    25680, 70,
    25680, 77,
    25680, 84,
    25728, 81,
    25776, 77,
    25824, 70,
    25824, 77,
    25824, 81,
    25824, 81,
    25872, 57,
    25872, 77,
    25872, 79,
    25872, 82,
    25920, 65,
    25920, 72,
    25920, 77,
    25920, 81,
    25920, 84,
    25968, 81,
    26016, 72,
    26016, 77,
    26016, 84,
    26016, 89,
    26064, 65,
    26112, 60,
    26112, 72,
    26112, 76,
    26112, 84,
    26112, 88,
    26160, 79,
    26160, 86,
    26208, 72,
    26208, 76,
    26208, 82,
    26208, 86,
    26256, 60,
    26256, 81,
    26256, 84,
    26304, 58,
    26304, 70,
    26304, 74,
    26304, 82,
    26304, 86,
    26352, 81,
    26352, 82,
    26352, 84,
    26400, 70,
    26400, 74,
    26400, 81,
    26400, 84,
    26448, 58,
    26448, 76,
    26496, 65,
    26496, 72,
    26496, 77,
    26496, 81,
    26496, 84,
    26544, 81,
    26592, 72,
    26592, 77,
    26592, 79,
    26592, 81,
    26640, 65,
    26640, 77,
    26640, 82,
    26688, 65,
    26688, 72,
    26688, 77,
    26688, 77,
    26688, 84,
    26736, 81,
    26784, 72,
    26784, 77,
    26784, 81,
    26784, 89,
    26832, 65,
    26880, 60,
    26880, 72,
    26880, 76,
    26880, 82,
    26880, 91,
    26928, 79,
    26928, 81,
    26928, 89,
    26976, 72,
    26976, 76,
    26976, 79,
    26976, 88,
    27024, 60,
    27024, 77,
    27024, 86,
    27072, 58,
    27072, 70,
    27072, 74,
    27072, 77,
    27072, 86,
    27120, 79,
    27120, 82,
    27120, 88,
    27168, 70,
    27168, 74,
    27168, 81,
    27168, 89,
    27216, 58,
    27216, 76,
    27264, 65,
    27264, 72,
    27264, 77,
    27264, 81,
    27264, 89,
    27312, 81,
    27360, 65,
    27360, 72,
    27360, 77,
    27360, 82,
    27360, 91,
    27408, 60,
    27408, 84,
    27408, 93,
    27456, 58,
    27456, 70,
    27456, 74,
    27456, 86,
    27456, 94,
    27504, 79,
    27504, 86,
    27504, 94,
    27552, 58,
    27552, 70,
    27552, 74,
    27552, 84,
    27552, 93,
    27600, 79,
    27600, 91,
    27648, 60,
    27648, 72,
    27648, 76,
    27648, 84,
    27648, 91,
    27696, 79,
    27744, 60,
    27744, 72,
    27744, 76,
    27744, 81,
    27744, 89,
    27792, 79,
    27792, 82,
    27792, 91,
    27840, 65,
    27840, 72,
    27840, 77,
    27840, 84,
    27840, 93,
    27888, 81,
    27888, 84,
    27888, 93,
    27936, 64,
    27936, 72,
    27936, 77,
    27936, 82,
    27936, 91,
    27984, 81,
    27984, 89,
    28032, 62,
    28032, 74,
    28032, 77,
    28032, 81,
    28032, 89,
    28080, 81,
    28128, 60,
    28128, 74,
    28128, 77,
    28128, 79,
    28128, 86,
    28176, 77,
    28176, 81,
    28176, 84,
    28224, 58,
    28224, 70,
    28224, 74,
    28224, 77,
    28224, 86,
    28272, 79,
    28272, 79,
    28272, 89,
    28320, 65,
    28320, 70,
    28320, 74,
    28320, 81,
    28320, 89,
    28368, 79,
    28368, 79,
    28368, 88,
    28416, 57,
    28416, 69,
    28416, 73,
    28464, 79,
    28464, 79,
    28464, 88,
    28512, 64,
    28512, 69,
    28512, 73,
    28512, 81,
    28512, 90,
    28560, 79,
    28560, 81,
    28560, 90,
    28608, 62,
    28608, 69,
    28656, 74,
    28704, 78,
    28752, 62,
    28752, 74,
    28800, 59,
    28800, 71,
    28848, 74,
    28896, 78,
    28896, 93,
    28944, 59,
    28944, 74,
    28944, 93,
    28992, 62,
    28992, 69,
    28992, 95,
    29040, 74,
    29040, 93,
    29088, 78,
    29088, 90,
    29136, 62,
    29136, 74,
    29136, 86,
    29184, 59,
    29184, 71,
    29232, 74,
    29232, 88,
    29232, 91,
    29280, 78,
    29280, 90,
    29280, 93,
    29328, 59,
    29328, 74,
    29328, 90,
    29328, 93,
    29376, 62,
    29376, 69,
    29424, 74,
    29472, 78,
    29520, 62,
    29520, 74,
    29568, 59,
    29568, 71,
    29616, 74,
    29616, 93,
    29664, 78,
    29664, 93,
    29712, 59,
    29712, 74,
    29712, 93,
    29760, 62,
    29760, 69,
    29760, 95,
    29808, 74,
    29808, 93,
    29856, 78,
    29856, 90,
    29904, 62,
    29904, 74,
    29904, 86,
    29952, 59,
    29952, 71,
    30000, 74,
    30000, 88,
    30000, 91,
    30048, 78,
    30048, 90,
    30048, 93,
    30096, 59,
    30096, 74,
    30096, 90,
    30096, 93,
    30144, 62,
    30144, 69,
    30192, 74,
    30240, 78,
    30288, 62,
    30288, 74,
    30336, 59,
    30336, 71,
    30384, 74,
    30384, 93,
    30432, 78,
    30432, 93,
    30480, 59,
    30480, 74,
    30480, 93,
    30528, 62,
    30528, 69,
    30528, 95,
    30576, 74,
    30576, 93,
    30624, 78,
    30624, 90,
    30672, 62,
    30672, 74,
    30672, 86,
    30720, 59,
    30720, 71,
    30768, 74,
    30768, 88,
    30768, 91,
    30816, 78,
    30816, 90,
    30816, 93,
    30864, 59,
    30864, 74,
    30864, 90,
    30864, 93,
    30912, 62,
    30912, 69,
    30960, 74,
    31008, 78,
    31056, 62,
    31056, 74,
    31104, 59,
    31104, 71,
    31152, 74,
    31200, 78,
    31200, 93,
    31248, 59,
    31248, 74,
    31248, 93,
    31296, 62,
    31296, 69,
    31296, 95,
    31344, 74,
    31344, 93,
    31392, 78,
    31392, 90,
    31440, 62,
    31440, 74,
    31440, 86,
    31488, 59,
    31488, 71,
    31536, 74,
    31536, 88,
    31536, 91,
    31584, 78,
    31584, 90,
    31584, 93,
    31632, 59,
    31632, 74,
    31632, 90,
    31632, 93,
    31680, 62,
    31680, 69,
    31728, 74,
    31776, 78,
    31824, 62,
    31824, 74,
    31872, 59,
    31872, 71,
    31920, 74,
    31920, 93,
    31968, 78,
    31968, 93,
    32016, 59,
    32016, 74,
    32016, 93,
    32064, 62,
    32064, 69,
    32064, 95,
    32112, 74,
    32112, 93,
    32160, 78,
    32160, 90,
    32208, 62,
    32208, 74,
    32208, 86,
    32256, 59,
    32256, 71,
    32304, 74,
    32304, 88,
    32304, 91,
    32352, 78,
    32352, 90,
    32352, 93,
    32400, 59,
    32400, 74,
    32400, 90,
    32400, 93,
    32448, 62,
    32448, 69,
    32496, 74,
    32544, 78,
    32592, 62,
    32592, 74,
    32640, 59,
    32640, 71,
    32688, 74,
    32688, 91,
    32736, 78,
    32736, 93,
    32784, 59,
    32784, 74,
    32784, 93,
    32832, 62,
    32832, 69,
    32880, 74,
    32928, 78,
    32976, 62,
    32976, 74,
    33024, 71,
    33024, 71,
    33072, 74,
    33072, 91,
    33120, 71,
    33120, 78,
    33120, 90,
    33168, 69,
    33168, 74,
    33168, 90,
    ]

print 'Attack:', len( wt_attack ), 'Bytes'

import math, struct, winsound

sample_rate = 39062 # 80e6 / 2048
wavetable_fundamental_frequency = sample_rate / ( 256 * math.pi ) # leads to single amplitude steps
print 'Fundamental_f:', wavetable_fundamental_frequency, 'Hz'

wt_sustain = [ 0 ] * int( sample_rate / wavetable_fundamental_frequency )
print 'Sustain:', len( wt_sustain ), 'Bytes'
for i in range( len( wt_sustain ) ):
    wt_sustain[ i ] = int( round( 127 * math.sin( 2 * math.pi * i / len( wt_sustain ) ) ) )
##    if i % 16 == 0:
##        print
##    print '%s,' % wt_sustain[ i ],
##print

wt = wt_attack + wt_sustain

envelope_byte_count = 1024 # should be long enough for small decay steps
envelope_table = [ 0 ] * envelope_byte_count
print 'Envelope:', len( envelope_table ), 'Bytes'
summ = 0
for i in range( envelope_byte_count ):
    envelope_table[ i ] = int( round( 255. / math.exp( i / 163. ) ) ) # should match output bit-depth for single amplitude steps at the end
    ##envelope_table[ i ] = int( round( 65535. / math.exp( i / 86. ) ) ) # should match output bit-depth for single amplitude steps at the end
##    if i % 16 == 0:
##        print
##    print '%s,' % envelope_table[ i ],
##print

data = ''

pot = 8 # power of two
env_pot = 7

oscillator_count = 16 # 64 for no note truncating
increments = [ 0 ] * oscillator_count
phase_accu_ints = [ 0 ] * oscillator_count
envelope_positions = [ 0 ] * oscillator_count

# http://tonalsoft.com/pub/news/pitch-bend.aspx
scale = []
for i in range( -6 * 12 + 3, 4 * 12 + 3 + 7 ):
    f = 440 * 2 ** ( i / 12. )
    scale.append( int( round( ( 1 << pot ) * f / wavetable_fundamental_frequency ) ) )
##    if ( i - 3 ) % 12 == 0:
##        print
##    print '%s,' % scale[ -1 ],
scale.append( 0 ) # To be able to place a silent note at the end if desired to delay looping
##print scale[ -1 ]
print 'Scale:', len( scale )

ticks = 0
time = 0
event_index = 0
next_osc = 0
for i in range( sample_rate * 2 ): # 175 seconds
    while event_index < len( tune_still_alive ) and time >= tune_still_alive[ event_index ]:
        increments[ next_osc ] = scale[ tune_still_alive[ event_index + 1 ] ]
        phase_accu_ints[ next_osc ] = 0
        ##if 0 < envelope_table[ envelope_positions[ next_osc ] >> env_pot ] < 255:
        ##    print 'trunc at env level %s' % envelope_table[ envelope_positions[ next_osc ] >> env_pot ]
        envelope_positions[ next_osc ] = 0
        next_osc += 1
        if next_osc >= oscillator_count:
            next_osc = 0
        event_index += 2
    value = 0
    for osc in range( oscillator_count ):
        phase_accu_ints[ osc ] += increments[ osc ]
        if phase_accu_ints[ osc ] >= len( wt ) << pot:
            phase_accu_ints[ osc ] -= len( wt_sustain ) << pot
        phase_accu = phase_accu_ints[ osc ] >> pot
        value += ( envelope_table[ envelope_positions[ osc ] >> env_pot ] * wt[ phase_accu ] )
        if ( phase_accu_ints[ osc ] >= len( wt_attack ) << pot and
             envelope_positions[ osc ] < ( len( envelope_table ) << env_pot ) - 1 ):
            envelope_positions[ osc ] += 1
    value >>= 8
    if value > 1016:
        print 'clip'
        value = 1016
    elif value < -1016:
        print 'clip'
        value = -1016
    data += struct.pack( '<h', value << 5 )
    ticks += 1
    if ticks >= sample_rate / 192:
        ticks = 0
        time += 1

def __header( samplesPerSec, dataSize ):
    headerSize = 44
    RIFFChunkID = 'RIFF'
    RIFFChunkSize = dataSize + headerSize - 8
    RIFFType = 'WAVE'
    fmtChunkID = 'fmt '
    fmtChunkSize = 16 # 16 Byte
    wFormatTag = 0x0001 # WAVE_FORMAT_PCM
    wChannels = 1
    dwSamplesPerSec = samplesPerSec
    nBitsPerSample = 16
    wBlockAlign = wChannels * ( ( nBitsPerSample + 7 ) // 8 )
    dwAvgBytesPerSec = samplesPerSec * wBlockAlign
    dataChunkID = 'data'
    dataChunkSize = dataSize
    header = struct.pack( '<4sL4s4s', RIFFChunkID, RIFFChunkSize, RIFFType, fmtChunkID )
    header += struct.pack( '<LHHLL', fmtChunkSize, wFormatTag, wChannels, dwSamplesPerSec, dwAvgBytesPerSec )
    header += struct.pack( '<HH4sL', wBlockAlign, nBitsPerSample, dataChunkID, dataChunkSize )
    assert len( header ) == headerSize, 'Error: Actual headerSize (%s) differs from assumed one (%s).' % ( len( header ), headerSize )
    return header

header = __header( sample_rate, len( data ) )
f = open( 'dds.wav', 'wb' ); f.write( header + data ); f.close()
winsound.PlaySound( header + data, winsound.SND_MEMORY | winsound.SND_NOWAIT )

7a2fd87f7882ea7fbd0cffab12a0e7ee60f57fcf
wt_attack = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
               0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1,
               -1, -1, -1, -1, -1, -1, -1, -2, -2, -2, -2, -2, -2, -2, -2, -2,
               -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3,
               -3, -3, -3, -3, -3, -3, -3, -3, -2, -2, -2, -2, -2, -2, -2, -2,
               -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0,
               0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
               0, 0, -1, -1, -1, -1, -1, -1, -1, -2, -2, -2, -2, -2, -2, -2,
               -3, -3, -3, -3, -3, -3, -3, -4, -4, -4, -4, -4, -4, -4, -4, -4,
               -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -3, -3,
               -3, -3, -3, -3, -2, -2, -2, -2, -2, -2, -1, -1, -1, -1, -1, -1,
               0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
               1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0,
               0, 0, -1, -1, -1, -1, -1, -2, -2, -2, -2, -2, -2, -2, -3, -3,
               -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3,
               -3, -3, -3, -2, -2, -2, -2, -2, -1, -1, -1, -1, 0, 0, 0, 0,
               1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5,
               5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5,
               5, 5, 5, 5, 5, 4, 4, 4, 4, 3, 3, 3, 3, 2, 2, 2,
               1, 1, 1, 0, 0, 0, -1, -1, -1, -2, -2, -2, -2, -3, -3, -3,
               -3, -3, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4,
               -4, -4, -3, -3, -3, -3, -3, -2, -2, -2, -2, -1, -1, -1, 0, 0,
               0, 0, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3,
               3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 1, 1, 1, 0,
               0, -1, -1, -2, -2, -3, -3, -4, -5, -5, -6, -7, -7, -8, -9, -9,
               -10, -11, -11, -12, -13, -13, -14, -14, -15, -16, -16, -17, -17, -18, -18, -18,
               -19, -19, -19, -19, -20, -20, -20, -20, -20, -20, -20, -19, -19, -19, -19, -18,
               -18, -17, -17, -16, -16, -15, -14, -14, -13, -12, -11, -10, -9, -8, -7, -6,
               -5, -4, -3, -2, -1, 0, 1, 2, 3, 5, 6, 7, 8, 9, 10, 11,
               12, 13, 14, 15, 16, 16, 17, 18, 19, 19, 20, 21, 21, 22, 22, 23,
               23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 23, 23,
               22, 22, 22, 21, 21, 20, 20, 19, 19, 18, 18, 17, 17, 16, 15, 15,
               14, 14, 13, 13, 12, 12, 11, 11, 10, 10, 9, 9, 9, 8, 8, 8,
               7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
               8, 8, 8, 9, 9, 9, 10, 10, 10, 11, 11, 12, 12, 12, 13, 13,
               14, 14, 15, 15, 15, 16, 16, 17, 17, 17, 18, 18, 18, 19, 19, 19,
               19, 20, 20, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 21, 21,
               21, 20, 20, 20, 20, 20, 20, 20, 20, 20, 19, 19, 19, 19, 19, 19,
               19, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
               18, 19, 19, 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 22, 22,
               22, 23, 23, 23, 24, 24, 24, 25, 25, 25, 26, 26, 26, 27, 27, 27,
               27, 28, 28, 28, 28, 28, 28, 28, 29, 29, 29, 28, 28, 28, 28, 28,
               28, 28, 27, 27, 27, 26, 26, 25, 25, 24, 24, 23, 23, 22, 21, 21,
               20, 19, 19, 18, 17, 16, 15, 14, 14, 13, 12, 11, 10, 9, 8, 7,
               6, 5, 4, 4, 3, 2, 1, 0, -1, -2, -3, -3, -4, -5, -6, -6,
               -7, -8, -8, -9, -9, -10, -10, -11, -11, -12, -12, -13, -13, -13, -13, -13,
               -14, -14, -14, -14, -14, -14, -14, -14, -14, -13, -13, -13, -13, -12, -12, -12,
               -11, -11, -11, -10, -10, -9, -9, -8, -8, -7, -7, -6, -5, -5, -4, -4,
               -3, -3, -2, -1, -1, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 4,
               5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
               5, 5, 5, 4, 4, 3, 3, 2, 2, 1, 0, -1, -1, -2, -3, -4,
               -5, -6, -7, -8, -9, -10, -12, -13, -14, -15, -17, -18, -19, -21, -22, -23,
               -25, -26, -27, -29, -30, -32, -33, -35, -36, -37, -39, -40, -42, -43, -44, -46,
               -47, -48, -49, -51, -52, -53, -54, -55, -56, -57, -58, -59, -60, -61, -62, -63,
               -63, -64, -65, -66, -66, -67, -67, -68, -68, -69, -69, -69, -70, -70, -70, -70,
               -70, -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, -71, -71,
               -71, -71, -71, -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, -71, -71, -71,
               -71, -71, -71, -71, -71, -72, -72, -72, -72, -73, -73, -73, -74, -74, -74, -75,
               -75, -75, -76, -76, -76, -77, -77, -77, -78, -78, -78, -79, -79, -79, -79, -80,
               -80, -80, -80, -80, -80, -80, -80, -80, -80, -79, -79, -79, -79, -78, -78, -77,
               -77, -76, -75, -74, -74, -73, -72, -71, -70, -69, -67, -66, -65, -63, -62, -61,
               -59, -58, -56, -54, -53, -51, -49, -47, -46, -44, -42, -40, -38, -36, -34, -32,
               -30, -29, -27, -25, -23, -21, -19, -17, -15, -13, -12, -10, -8, -6, -5, -3,
               -1, 0, 2, 3, 5, 6, 8, 9, 10, 11, 13, 14, 15, 16, 17, 18,
               19, 19, 20, 21, 22, 22, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28,
               28, 28, 29, 29, 30, 30, 30, 31, 31, 31, 32, 32, 32, 33, 33, 34,
               34, 35, 35, 36, 36, 37, 37, 38, 38, 39, 40, 40, 41, 42, 42, 43,
               44, 45, 45, 46, 47, 48, 48, 49, 50, 51, 52, 52, 53, 54, 55, 55,
               56, 57, 57, 58, 59, 59, 60, 60, 61, 61, 61, 62, 62, 62, 62, 63,
               63, 63, 62, 62, 62, 62, 62, 61, 61, 60, 60, 59, 59, 58, 57, 57,
               56, 55, 54, 53, 52, 51, 50, 49, 48, 47, 45, 44, 43, 42, 41, 39,
               38, 37, 36, 35, 34, 33, 32, 30, 29, 28, 28, 27, 26, 25, 24, 24,
               23, 23, 22, 22, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22,
               23, 24, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 35, 36, 37, 39,
               40, 42, 43, 45, 46, 48, 50, 51, 53, 54, 56, 58, 59, 61, 62, 64,
               65, 67, 68, 70, 71, 73, 74, 75, 76, 78, 79, 80, 81, 82, 83, 84,
               85, 85, 86, 87, 87, 88, 88, 89, 89, 89, 90, 90, 90, 90, 90, 90,
               90, 90, 90, 90, 90, 90, 90, 89, 89, 89, 88, 88, 88, 87, 87, 86,
               86, 86, 85, 85, 84, 84, 83, 83, 83, 82, 82, 81, 81, 81, 80, 80,
               79, 79, 79, 78, 78, 78, 77, 77, 77, 77, 76, 76, 76, 76, 75, 75,
               75, 75, 74, 74, 74, 74, 73, 73, 73, 73, 72, 72, 72, 71, 71, 71,
               70, 70, 69, 69, 68, 68, 67, 67, 66, 65, 65, 64, 63, 62, 62, 61,
               60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, 49, 48, 46, 45, 44,
               43, 41, 40, 39, 38, 36, 35, 34, 32, 31, 30, 28, 27, 26, 24, 23,
               22, 20, 19, 18, 17, 15, 14, 13, 12, 10, 9, 8, 7, 6, 5, 4,
               3, 2, 1, 0, -1, -2, -3, -4, -5, -5, -6, -7, -8, -8, -9, -10,
               -10, -11, -12, -12, -13, -13, -14, -15, -15, -16, -16, -17, -17, -17, -18, -18,
               -19, -19, -19, -20, -20, -21, -21, -21, -22, -22, -22, -23, -23, -23, -24, -24,
               -24, -24, -25, -25, -25, -26, -26, -26, -26, -27, -27, -27, -27, -28, -28, -28,
               -28, -29, -29, -29, -29, -30, -30, -30, -30, -30, -31, -31, -31, -31, -31, -31,
               -32, -32, -32, -32, -32, -32, -33, -33, -33, -33, -33, -33, -33, -33, -34, -34,
               -34, -34, -34, -34, -34, -34, -34, -35, -35, -35, -35, -35, -35, -35, -36, -36,
               -36, -36, -36, -36, -37, -37, -37, -37, -37, -38, -38, -38, -38, -39, -39, -39,
               -39, -40, -40, -40, -41, -41, -41, -42, -42, -43, -43, -44, -44, -45, -45, -46,
               -46, -47, -47, -48, -48, -49, -50, -50, -51, -52, -52, -53, -54, -54, -55, -56,
               -57, -58, -58, -59, -60, -61, -62, -63, -64, -65, -66, -67, -68, -69, -70, -71,
               -72, -73, -74, -76, -77, -78, -79, -80, -82, -83, -84, -85, -86, -88, -89, -90,
               -92, -93, -94, -95, -97, -98, -99, -100, -102, -103, -104, -105, -106, -108, -109, -110,
               -111, -112, -113, -114, -115, -116, -117, -118, -118, -119, -120, -121, -121, -122, -122, -123,
               -123, -124, -124, -124, -124, -125, -125, -125, -125, -124, -124, -124, -124, -123, -123, -122,
               -122, -121, -121, -120, -119, -118, -117, -116, -115, -114, -113, -112, -111, -109, -108, -107,
               -105, -104, -102, -101, -99, -98, -96, -95, -93, -92, -90, -88, -87, -85, -84, -82,
               -80, -79, -77, -76, -74, -73, -71, -70, -68, -67, -65, -64, -63, -62, -60, -59,
               -58, -57, -56, -55, -54, -53, -52, -51, -51, -50, -49, -48, -48, -47, -47, -46,
               -46, -45, -45, -45, -45, -44, -44, -44, -44, -44, -43, -43, -43, -43, -43, -43,
               -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -43, -42,
               -42, -42, -42, -42, -42, -41, -41, -41, -41, -40, -40, -39, -39, -39, -38, -38,
               -37, -37, -36, -36, -35, -35, -34, -34, -33, -32, -32, -31, -31, -30, -29, -29,
               -28, -28, -27, -26, -26, -25, -25, -24, -24, -23, -23, -22, -22, -21, -21, -20,
               -20, -20, -19, -19, -19, -18, -18, -18, -18, -17, -17, -17, -17, -17, -17, -16,
               -16, -16, -16, -16, -16, -16, -16, -15, -15, -15, -15, -15, -14, -14, -14, -14,
               -13, -13, -13, -12, -12, -11, -11, -10, -10, -9, -8, -8, -7, -6, -5, -4,
               -3, -2, -1, 0, 1, 2, 3, 4, 6, 7, 9, 10, 11, 13, 15, 16,
               18, 19, 21, 23, 25, 26, 28, 30, 32, 33, 35, 37, 39, 41, 42, 44,
               46, 48, 50, 51, 53, 55, 56, 58, 60, 61, 63, 64, 66, 67, 68, 70,
               71, 72, 73, 74, 76, 77, 78, 78, 79, 80, 81, 82, 82, 83, 84, 84,
               85, 85, 85, 86, 86, 86, 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
               87, 87, 87, 87, 87, 87, 87, 87, 86, 86, 86, 86, 86, 86, 86, 86,
               86, 86, 86, 86, 85, 85, 85, 85, 85, 85, 85, 85, 86, 86, 86, 86,
               86, 86, 86, 86, 86, 86, 86, 86, 87, 87, 87, 87, 87, 87, 87, 87,
               87, 87, 87, 87, 87, 87, 87, 87, 87, 87, 86, 86, 86, 86, 86, 85,
               85, 85, 84, 84, 83, 83, 82, 82, 81, 81, 80, 80, 79, 78, 78, 77,
               77, 76, 75, 74, 74, 73, 72, 71, 71, 70, 69, 69, 68, 67, 66, 66,
               65, 64, 64, 63, 63, 62, 61, 61, 60, 60, 60, 59, 59, 58, 58, 58,
               58, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 58, 58, 58,
               59, 59, 59, 60, 60, 61, 61, 62, 62, 63, 63, 64, 64, 65, 66, 66,
               67, 68, 68, 69, 70, 70, 71, 72, 72, 73, 74, 74, 75, 76, 76, 77,
               78, 78, 79, 79, 80, 81, 81, 82, 82, 83, 84, 84, 85, 85, 86, 86,
               86, 87, 87, 88, 88, 89, 89, 89, 90, 90, 90, 91, 91, 91, 91, 92,
               92, 92, 92, 92, 92, 92, 93, 93, 93, 93, 93, 93, 93, 93, 93, 92,
               92, 92, 92, 92, 91, 91, 91, 90, 90, 89, 89, 88, 88, 87, 87, 86,
               85, 84, 84, 83, 82, 81, 80, 79, 78, 76, 75, 74, 73, 71, 70, 68,
               67, 65, 64, 62, 60, 58, 57, 55, 53, 51, 49, 47, 45, 43, 41, 39,
               37, 34, 32, 30, 28, 25, 23, 21, 19, 16, 14, 12, 9, 7, 5, 3,
               0, -2, -4, -6, -8, -11, -13, -15, -17, -19, -21, -23, -25, -27, -29, -30,
               -32, -34, -36, -37, -39, -40, -42, -43, -45, -46, -47, -48, -50, -51, -52, -53,
               -54, -55, -56, -57, -58, -58, -59, -60, -60, -61, -62, -62, -63, -63, -64, -64,
               -64, -65, -65, -66, -66, -66, -66, -67, -67, -67, -67, -67, -68, -68, -68, -68,
               -68, -68, -68, -68, -68, -68, -68, -69, -69, -69, -69, -69, -69, -69, -69, -69,
               -69, -68, -68, -68, -68, -68, -68, -68, -68, -68, -68, -67, -67, -67, -67, -66,
               -66, -66, -66, -65, -65, -64, -64, -64, -63, -63, -62, -62, -61, -61, -60, -59,
               -59, -58, -57, -57, -56, -55, -55, -54, -53, -52, -51, -51, -50, -49, -48, -47,
               -46, -46, -45, -44, -43, -42, -41, -41, -40, -39, -38, -38, -37, -36, -35, -35,
               -34, -33, -33, -32, -32, -31, -31, -30, -30, -30, -29, -29, -29, -29, -28, -28,
               -28, -28, -28, -28, -28, -28, -28, -29, -29, -29, -29, -30, -30, -30, -31, -31,
               -32, -32, -33, -34, -34, -35, -35, -36, -37, -38, -38, -39, -40, -41, -42, -42,
               -43, -44, -45, -46, -47, -48, -49, -49, -50, -51, -52, -53, -54, -55, -56, -57,
               -58, -59, -60, -60, -61, -62, -63, -64, -65, -66, -67, -68, -68, -69, -70, -71,
               -72, -73, -74, -74, -75, -76, -77, -78, -79, -79, -80, -81, -82, -83, -84, -84,
               -85, -86, -87, -88, -88, -89, -90, -91, -92, -92, -93, -94, -95, -95, -96, -97,
               -98, -98, -99, -100, -100, -101, -102, -102, -103, -103, -104, -105, -105, -106, -106, -106,
               -107, -107, -108, -108, -108, -108, -109, -109, -109, -109, -109, -109, -109, -109, -109, -109,
               -109, -108, -108, -108, -107, -107, -107, -106, -106, -105, -104, -104, -103, -102, -102, -101,
               -100, -99, -98, -97, -96, -95, -94, -93, -92, -91, -90, -89, -88, -87, -85, -84,
               -83, -82, -80, -79, -78, -76, -75, -74, -72, -71, -70, -68, -67, -66, -64, -63,
               -62, -60, -59, -57, -56, -55, -53, -52, -51, -49, -48, -47, -45, -44, -43, -42,
               -40, -39, -38, -36, -35, -34, -33, -31, -30, -29, -28, -27, -25, -24, -23, -22,
               -21, -19, -18, -17, -16, -15, -13, -12, -11, -10, -9, -8, -7, -5, -4, -3,
               -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 12,
               13, 14, 15, 16, 16, 17, 17, 18, 19, 19, 20, 20, 21, 21, 21, 22,
               22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 22, 22, 22, 22, 22, 21,
               21, 21, 20, 20, 19, 19, 18, 18, 17, 17, 16, 15, 15, 14, 13, 13,
               12, 11, 11, 10, 9, 9, 8, 7, 7, 6, 5, 5, 4, 3, 3, 2,
               2, 1, 1, 0, 0, -1, -1, -2, -2, -2, -3, -3, -3, -3, -3, -4,
               -4, -4, -4, -4, -4, -4, -4, -3, -3, -3, -3, -3, -2, -2, -2, -1,
               -1, -1, 0, 0, 1, 1, 1, 2, 2, 3, 3, 4, 4, 5, 6, 6,
               7, 7, 8, 8, 9, 9, 10, 11, 11, 12, 12, 13, 13, 14, 15, 15,
               16, 16, 17, 17, 18, 19, 19, 20, 20, 21, 21, 22, 23, 23, 24, 25,
               25, 26, 27, 27, 28, 29, 29, 30, 31, 32, 33, 33, 34, 35, 36, 37,
               38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 49, 50, 51, 52, 54, 55,
               56, 57, 59, 60, 61, 63, 64, 65, 67, 68, 69, 71, 72, 73, 75, 76,
               77, 79, 80, 81, 83, 84, 85, 86, 87, 89, 90, 91, 92, 93, 94, 95,
               96, 97, 98, 99, 100, 100, 101, 102, 103, 103, 104, 104, 105, 105, 106, 106,
               107, 107, 107, 108, 108, 108, 108, 109, 109, 109, 109, 109, 109, 109, 109, 109,
               109, 109, 108, 108, 108, 108, 108, 108, 107, 107, 107, 107, 106, 106, 106, 106,
               105, 105, 105, 105, 104, 104, 104, 103, 103, 103, 102, 102, 102, 102, 101, 101,
               101, 100, 100, 100, 100, 99, 99, 99, 98, 98, 98, 97, 97, 97, 97, 96,
               96, 96, 95, 95, 94, 94, 94, 93, 93, 93, 92, 92, 91, 91, 90, 90,
               89, 89, 88, 88, 87, 87, 86, 85, 85, 84, 84, 83, 82, 82, 81, 81,
               80, 79, 79, 78, 77, 76, 76, 75, 74, 74, 73, 72, 72, 71, 70, 70,
               69, 68, 68, 67, 67, 66, 65, 65, 64, 64, 63, 63, 62, 62, 61, 61,
               60, 60, 59, 59, 58, 58, 58, 57, 57, 57, 56, 56, 56, 55, 55, 55,
               55, 54, 54, 54, 54, 54, 53, 53, 53, 53, 53, 52, 52, 52, 52, 52,
               52, 51, 51, 51, 51, 51, 51, 50, 50, 50, 50, 50, 49, 49, 49, 49,
               48, 48, 48, 48, 47, 47, 47, 47, 46, 46, 46, 45, 45, 45, 44, 44,
               44, 43, 43, 42, 42, 42, 41, 41, 41, 40, 40, 39, 39, 39, 38, 38,
               37, 37, 37, 36, 36, 35, 35, 34, 34, 34, 33, 33, 32, 32, 31, 31,
               30, 30, 29, 29, 28, 28, 27, 27, 26, 26, 25, 25, 24, 23, 23, 22,
               22, 21, 20, 20, 19, 18, 17, 17, 16, 15, 14, 13, 12, 12, 11, 10,
               9, 8, 7, 6, 5, 4, 3, 1, 0, -1, -2, -3, -4, -6, -7, -8,
               -9, -11, -12, -13, -15, -16, -17, -19, -20, -21, -23, -24, -26, -27, -29, -30,
               -31, -33, -34, -36, -37, -38, -40, -41, -43, -44, -45, -47, -48, -50, -51, -52,
               -54, -55, -56, -57, -59, -60, -61, -62, -64, -65, -66, -67, -68, -69, -70, -71,
               -73, -74, -75, -76, -77, -78, -79, -80, -80, -81, -82, -83, -84, -85, -86, -87,
               -87, -88, -89, -90, -91, -91, -92, -93, -93, -94, -95, -96, -96, -97, -98, -98,
               -99, -99, -100, -101, -101, -102, -102, -103, -103, -104, -104, -105, -105, -106, -106, -107,
               -107, -108, -108, -108, -109, -109, -109, -110, -110, -110, -111, -111, -111, -111, -112, -112,
               -112, -112, -112, -112, -112, -112, -113, -113, -113, -113, -113, -113, -113, -113, -113, -112,
               -112, -112, -112, -112, -112, -112, -112, -112, -111, -111, -111, -111, -111, -110, -110, -110,
               -110, -110, -109, -109, -109, -109, -109, -108, -108, -108, -108, -108, -107, -107, -107, -107,
               -107, -107, -106, -106, -106, -106, -106, -106, -106, -105, -105, -105, -105, -105, -105, -105,
               -105, -105, -105, -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, -103, -103,
               -103, -103, -103, -103, -103, -102, -102, -102, -102, -101, -101, -101, -101, -100, -100, -100,
               -99, -99, -99, -98, -98, -97, -97, -96, -96, -96, -95, -95, -94, -93, -93, -92,
               -92, -91, -91, -90, -89, -89, -88, -88, -87, -86, -86, -85, -84, -84, -83, -83,
               -82, -81, -81, -80, -80, -79, -78, -78, -77, -77, -76, -76, -75, -75, -74, -74,
               -73, -73, -72, -72, -72, -71, -71, -70, -70, -70, -69, -69, -69, -68, -68, -68,
               -68, -67, -67, -67, -67, -66, -66, -66, -65, -65, -65, -65, -64, -64, -64, -63,
               -63, -63, -62, -62, -62, -61, -61, -60, -60, -59, -59, -59, -58, -57, -57, -56,
               -56, -55, -54, -54, -53, -52, -52, -51, -50, -49, -48, -47, -47, -46, -45, -44,
               -43, -42, -41, -40, -39, -38, -37, -36, -35, -34, -33, -32, -31, -29, -28, -27,
               -26, -25, -24, -23, -22, -21, -20, -19, -18, -17, -15, -14, -13, -12, -11, -10,
               -10, -9, -8, -7, -6, -5, -4, -3, -2, -1, -1, 0, 1, 2, 2, 3,
               4, 5, 5, 6, 7, 7, 8, 9, 9, 10, 11, 11, 12, 13, 13, 14,
               15, 15, 16, 16, 17, 18, 18, 19, 20, 20, 21, 22, 22, 23, 24, 24,
               25, 26, 26, 27, 28, 29, 29, 30, 31, 32, 32, 33, 34, 35, 36, 36,
               37, 38, 39, 40, 41, 41, 42, 43, 44, 45, 46, 46, 47, 48, 49, 50,
               51, 51, 52, 53, 54, 55, 55, 56, 57, 58, 58, 59, 60, 60, 61, 62,
               62, 63, 64, 64, 65, 65, 66, 67, 67, 68, 68, 69, 69, 69, 70, 70,
               71, 71, 72, 72, 72, 73, 73, 73, 74, 74, 74, 75, 75, 75, 76, 76,
               76, 77, 77, 77, 78, 78, 78, 78, 79, 79, 79, 80, 80, 80, 80, 81,
               81, 81, 82, 82, 82, 83, 83, 83, 84, 84, 85, 85, 85, 86, 86, 86,
               87, 87, 88, 88, 88, 89, 89, 90, 90, 91, 91, 91, 92, 92, 93, 93,
               93, 94, 94, 95, 95, 96, 96, 96, 97, 97, 98, 98, 98, 99, 99, 100,
               100, 100, 101, 101, 101, 102, 102, 103, 103, 103, 104, 104, 104, 104, 105, 105,
               105, 106, 106, 106, 107, 107, 107, 107, 108, 108, 108, 108, 109, 109, 109, 109,
               110, 110, 110, 110, 110, 111, 111, 111, 111, 111, 111, 112, 112, 112, 112, 112,
               112, 112, 112, 112, 112, 112, 113, 113, 113, 113, 113, 113, 112, 112, 112, 112,
               112, 112, 112, 112, 112, 111, 111, 111, 111, 111, 110, 110, 110, 110, 109, 109,
               109, 108, 108, 107, 107, 107, 106, 106, 105, 105, 104, 104, 103, 103, 102, 102,
               101, 101, 100, 99, 99, 98, 98, 97, 96, 96, 95, 95, 94, 93, 93, 92,
               91, 91, 90, 89, 89, 88, 87, 87, 86, 85, 85, 84, 83, 83, 82, 81,
               81, 80, 79, 79, 78, 77, 77, 76, 75, 75, 74, 73, 73, 72, 71, 70,
               70, 69, 68, 68, 67, 66, 65, 65, 64, 63, 62, 62, 61, 60, 59, 58,
               58, 57, 56, 55, 54, 53, 52, 52, 51, 50, 49, 48, 47, 46, 45, 44,
               43, 42, 41, 40, 39, 38, 37, 37, 36, 35, 34, 33, 32, 31, 30, 29,
               28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 17, 16, 15, 14,
               13, 12, 12, 11, 10, 9, 9, 8, 7, 7, 6, 5, 5, 4, 3, 3,
               2, 2, 1, 0, 0, -1, -1, -2, -2, -3, -3, -3, -4, -4, -5, -5,
               -6, -6, -6, -7, -7, -8, -8, -8, -9, -9, -10, -10, -10, -11, -11, -11,
               -12, -12, -13, -13, -14, -14, -14, -15, -15, -16, -16, -17, -17, -18, -18, -19,
               -19, -20, -20, -21, -21, -22, -23, -23, -24, -24, -25, -25, -26, -27, -27, -28,
               -29, -29, -30, -31, -31, -32, -33, -33, -34, -35, -35, -36, -37, -37, -38, -39,
               -40, -40, -41, -42, -42, -43, -44, -44, -45, -46, -46, -47, -48, -49, -49, -50,
               -51, -51, -52, -53, -53, -54, -55, -55, -56, -57, -57, -58, -58, -59, -60, -60,
               -61, -62, -62, -63, -64, -64, -65, -65, -66, -67, -67, -68, -68, -69, -70, -70,
               -71, -71, -72, -73, -73, -74, -74, -75, -75, -76, -77, -77, -78, -78, -79, -79,
               -80, -80, -81, -81, -82, -82, -83, -83, -84, -84, -85, -85, -86, -86, -87, -87,
               -88, -88, -89, -89, -89, -90, -90, -91, -91, -91, -92, -92, -92, -93, -93, -93,
               -94, -94, -94, -95, -95, -95, -96, -96, -96, -96, -97, -97, -97, -97, -98, -98,
               -98, -98, -99, -99, -99, -99, -99, -100, -100, -100, -100, -101, -101, -101, -101, -101,
               -102, -102, -102, -102, -102, -102, -103, -103, -103, -103, -103, -103, -103, -104, -104, -104,
               -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, -104,
               -104, -104, -104, -104, -104, -104, -103, -103, -103, -103, -103, -102, -102, -102, -102, -101,
               -101, -101, -100, -100, -100, -99, -99, -98, -98, -98, -97, -97, -96, -96, -95, -95,
               -94, -94, -93, -93, -92, -92, -91, -91, -90, -90, -89, -89, -88, -88, -87, -87,
               -86, -86, -85, -85, -84, -84, -83, -83, -82, -82, -81, -81, -81, -80, -80, -80,
               -79, -79, -79, -78, -78, -78, -77, -77, -77, -77, -76, -76, -76, -76, -76, -75,
               -75, -75, -75, -75, -75, -75, -74, -74, -74, -74, -74, -74, -74, -74, -73, -73,
               -73, -73, -73, -73, -73, -73, -72, -72, -72, -72, -72, -72, -71, -71, -71, -71,
               -71, -70, -70, -70, -70, -69, -69, -69, -68, -68, -68, -67, -67, -67, -66, -66,
               -65, -65, -65, -64, -64, -63, -63, -62, -62, -61, -61, -60, -60, -59, -59, -58,
               -58, -57, -57, -56, -55, -55, -54, -54, -53, -53, -52, -51, -51, -50, -50, -49,
               -48, -48, -47, -47, -46, -45, -45, -44, -43, -43, -42, -41, -41, -40, -39, -39,
               -38, -37, -37, -36, -35, -34, -34, -33, -32, -31, -31, -30, -29, -28, -27, -26,
               -25, -25, -24, -23, -22, -21, -20, -19, -18, -17, -16, -15, -14, -13, -12, -10,
               -9, -8, -7, -6, -5, -4, -2, -1, 0, 1, 2, 3, 5, 6, 7, 8,
               10, 11, 12, 13, 15, 16, 17, 18, 19, 21, 22, 23, 24, 25, 27, 28,
               29, 30, 31, 32, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
               46, 47, 48, 49, 49, 50, 51, 52, 53, 54, 54, 55, 56, 57, 57, 58,
               59, 60, 60, 61, 62, 62, 63, 64, 64, 65, 66, 66, 67, 68, 68, 69,
               69, 70, 71, 71, 72, 72, 73, 74, 74, 75, 75, 76, 77, 77, 78, 78,
               79, 79, 80, 80, 81, 82, 82, 83, 83, 84, 84, 85, 85, 86, 86, 87,
               87, 88, 88, 89, 89, 90, 90, 90, 91, 91, 92, 92, 92, 93, 93, 93,
               94, 94, 94, 95, 95, 95, 95, 96, 96, 96, 96, 96, 97, 97, 97, 97,
               97, 97, 97, 97, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98,
               98, 98, 98, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 100, 100, 100,
               100, 100, 100, 101, 101, 101, 101, 102, 102, 102, 102, 103, 103, 103, 104, 104,
               104, 105, 105, 105, 106, 106, 107, 107, 107, 108, 108, 109, 109, 109, 110, 110,
               110, 111, 111, 112, 112, 112, 113, 113, 113, 114, 114, 114, 114, 115, 115, 115,
               115, 115, 115, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 115,
               115, 115, 115, 115, 114, 114, 114, 113, 113, 113, 112, 112, 112, 111, 111, 110,
               110, 109, 109, 108, 108, 107, 107, 106, 106, 105, 105, 104, 103, 103, 102, 102,
               101, 100, 100, 99, 98, 98, 97, 97, 96, 95, 95, 94, 94, 93, 92, 92,
               91, 90, 90, 89, 89, 88, 87, 87, 86, 86, 85, 84, 84, 83, 83, 82,
               81, 81, 80, 79, 79, 78, 77, 77, 76, 75, 75, 74, 73, 73, 72, 71,
               71, 70, 69, 68, 68, 67, 66, 65, 64, 64, 63, 62, 61, 60, 59, 59,
               58, 57, 56, 55, 54, 53, 52, 51, 50, 50, 49, 48, 47, 46, 45, 44,
               43, 42, 41, 40, 39, 38, 37, 36, 35, 35, 34, 33, 32, 31, 30, 29,
               28, 28, 27, 26, 25, 24, 24, 23, 22, 21, 21, 20, 19, 18, 18, 17,
               16, 16, 15, 15, 14, 13, 13, 12, 12, 11, 11, 10, 9, 9, 8, 8,
               7, 7, 7, 6, 6, 5, 5, 4, 4, 3, 3, 2, 2, 1, 1, 0,
               0, -1, -1, -2, -2, -3, -3, -4, -4, -5, -6, -6, -7, -7, -8, -9,
               -9, -10, -11, -11, -12, -13, -13, -14, -15, -16, -17, -17, -18, -19, -20, -21,
               -21, -22, -23, -24, -25, -26, -27, -28, -29, -30, -31, -31, -32, -33, -34, -35,
               -36, -37, -38, -39, -40, -41, -42, -43, -44, -45, -46, -47, -48, -49, -50, -51,
               -52, -53, -54, -55, -56, -57, -57, -58, -59, -60, -61, -62, -63, -64, -65, -65,
               -66, -67, -68, -69, -70, -71, -71, -72, -73, -74, -75, -75, -76, -77, -78, -78,
               -79, -80, -81, -81, -82, -83, -84, -84, -85, -86, -86, -87, -88, -89, -89, -90,
               -91, -91, -92, -93, -93, -94, -95, -95, -96, -97, -97, -98, -99, -99, -100, -101,
               -101, -102, -102, -103, -104, -104, -105, -105, -106, -107, -107, -108, -108, -109, -109, -110,
               -110, -111, -111, -112, -112, -113, -113, -114, -114, -115, -115, -116, -116, -116, -117, -117,
               -117, -118, -118, -118, -119, -119, -119, -119, -120, -120, -120, -120, -120, -121, -121, -121,
               -121, -121, -121, -121, -121, -121, -121, -121, -121, -121, -121, -121, -121, -121, -121, -120,
               -120, -120, -120, -120, -120, -119, -119, -119, -119, -118, -118, -118, -118, -117, -117, -117,
               -116, -116, -116, -115, -115, -115, -114, -114, -114, -113, -113, -113, -112, -112, -111, -111,
               -111, -110, -110, -110, -109, -109, -108, -108, -108, -107, -107, -106, -106, -106, -105, -105,
               -104, -104, -104, -103, -103, -103, -102, -102, -101, -101, -101, -100, -100, -100, -99, -99,
               -98, -98, -98, -97, -97, -96, -96, -96, -95, -95, -94, -94, -94, -93, -93, -92,
               -92, -92, -91, -91, -90, -90, -89, -89, -88, -88, -87, -87, -87, -86, -86, -85,
               -85, -84, -83, -83, -82, -82, -81, -81, -80, -80, -79, -79, -78, -77, -77, -76,
               -76, -75, -74, -74, -73, -73, -72, -71, -71, -70, -70, -69, -68, -68, -67, -66,
               -66, -65, -65, -64, -63, -63, -62, -61, -61, -60, -59, -59, -58, -58, -57, -56,
               -56, -55, -54, -54, -53, -53, -52, -51, -51, -50, -49, -49, -48, -48, -47, -46,
               -46, -45, -44, -44, -43, -43, -42, -41, -41, -40, -39, -39, -38, -37, -37, -36,
               -35, -35, -34, -33, -32, -32, -31, -30, -29, -29, -28, -27, -26, -26, -25, -24,
               -23, -22, -21, -21, -20, -19, -18, -17, -16, -15, -15, -14, -13, -12, -11, -10,
               -9, -8, -7, -6, -5, -4, -3, -2, -2, -1, 0, 1, 2, 3, 4, 5,
               6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 16, 17, 18, 19, 20,
               21, 22, 23, 24, 24, 25, 26, 27, 28, 29, 29, 30, 31, 32, 33, 34,
               34, 35, 36, 37, 37, 38, 39, 40, 40, 41, 42, 43, 43, 44, 45, 45,
               46, 47, 48, 48, 49, 50, 50, 51, 52, 53, 53, 54, 55, 55, 56, 57,
               58, 58, 59, 60, 60, 61, 62, 62, 63, 64, 65, 65, 66, 67, 67, 68,
               69, 69, 70, 71, 71, 72, 73, 73, 74, 75, 75, 76, 77, 77, 78, 78,
               79, 80, 80, 81, 81, 82, 82, 83, 83, 84, 85, 85, 86, 86, 86, 87,
               87, 88, 88, 89, 89, 90, 90, 90, 91, 91, 91, 92, 92, 93, 93, 93,
               94, 94, 94, 95, 95, 95, 95, 96, 96, 96, 97, 97, 97, 98, 98, 98,
               98, 99, 99, 99, 100, 100, 100, 101, 101, 101, 102, 102, 102, 103, 103, 103,
               104, 104, 105, 105, 105, 106, 106, 107, 107, 108, 108, 108, 109, 109, 110, 110,
               111, 111, 112, 112, 113, 113, 114, 114, 114, 115, 115, 116, 116, 117, 117, 118,
               118, 119, 119, 119, 120, 120, 121, 121, 121, 122, 122, 122, 123, 123, 123, 124,
               124, 124, 124, 125, 125, 125, 125, 125, 126, 126, 126, 126, 126, 126, 126, 126,
               126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 125, 125, 125,
               125, 125, 124, 124, 124, 124, 124, 123, 123, 123, 123, 122, 122, 122, 121, 121,
               121, 121, 120, 120, 120, 119, 119, 119, 118, 118, 118, 117, 117, 117, 116, 116,
               115, 115, 115, 114, 114, 114, 113, 113, 112, 112, 112, 111, 111, 110, 110, 109,
               109, 108, 108, 107, 107, 106, 106, 105, 105, 104, 104, 103, 102, 102, 101, 101,
               100, 99, 99, 98, 97, 97, 96, 95, 94, 94, 93, 92, 91, 90, 89, 89,
               88, 87, 86, 85, 84, 83, 82, 81, 80, 79, 78, 77, 76, 75, 74, 73,
               72, 71, 70, 69, 68, 66, 65, 64, 63, 62, 61, 60, 58, 57, 56, 55,
               54, 53, 51, 50, 49, 48, 47, 46, 44, 43, 42, 41, 40, 38, 37, 36,
               35, 34, 33, 32, 30, 29, 28, 27, 26, 25, 23, 22, 21, 20, 19, 18,
               17, 16, 15, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 2, 1, 0,
               -1, -2, -3, -4, -5, -6, -7, -8, -9, -10, -11, -12, -13, -14, -15, -17,
               -18, -19, -20, -21, -22, -23, -24, -25, -26, -27, -28, -29, -30, -31, -32, -33,
               -34, -35, -36, -37, -38, -39, -40, -41, -42, -43, -44, -45, -46, -47, -47, -48,
               -49, -50, -51, -52, -53, -54, -55, -56, -57, -58, -59, -59, -60, -61, -62, -63,
               -64, -65, -65, -66, -67, -68, -69, -70, -70, -71, -72, -73, -74, -74, -75, -76,
               -77, -78, -78, -79, -80, -81, -82, -82, -83, -84, -85, -85, -86, -87, -87, -88,
               -89, -90, -90, -91, -92, -92, -93, -94, -95, -95, -96, -97, -97, -98, -99, -99,
               -100, -101, -101, -102, -102, -103, -104, -104, -105, -106, -106, -107, -107, -108, -108, -109,
               -110, -110, -111, -111, -112, -112, -113, -113, -114, -114, -115, -115, -116, -116, -116, -117,
               -117, -118, -118, -119, -119, -119, -120, -120, -120, -121, -121, -121, -122, -122, -122, -123,
               -123, -123, -123, -124, -124, -124, -124, -124, -125, -125, -125, -125, -125, -126, -126, -126,
               -126, -126, -126, -126, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127,
               -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127,
               -127, -127, -127, -127, -127, -127, -127, -127, -126, -126, -126, -126, -126, -126, -126, -126,
               -126, -125, -125, -125, -125, -125, -125, -124, -124, -124, -124, -124, -124, -123, -123, -123,
               -123, -122, -122, -122, -122, -122, -121, -121, -121, -120, -120, -120, -120, -119, -119, -119,
               -118, -118, -118, -117, -117, -116, -116, -116, -115, -115, -115, -114, -114, -113, -113, -112,
               -112, -111, -111, -111, -110, -110, -109, -109, -108, -107, -107, -106, -106, -105, -105, -104,
               -104, -103, -102, -102, -101, -100, -100, -99, -99, -98, -97, -97, -96, -95, -94, -94,
               -93, -92, -92, -91, -90, -89, -89, -88, -87, -86, -86, -85, -84, -83, -82, -82,
               -81, -80, -79, -78, -77, -77, -76, -75, -74, -73, -72, -71, -71, -70, -69, -68,
               -67, -66, -65, -64, -64, -63, -62, -61, -60, -59, -58, -57, -56, -56, -55, -54,
               -53, -52, -51, -50, -49, -48, -47, -46, -46, -45, -44, -43, -42, -41, -40, -39,
               -38, -37, -36, -36, -35, -34, -33, -32, -31, -30, -29, -28, -27, -26, -26, -25,
               -24, -23, -22, -21, -20, -19, -18, -17, -16, -16, -15, -14, -13, -12, -11, -10,
               -9, -8, -7, -6, -5, -4, -4, -3, -2, -1 ]

tune_still_alive = [
    0, 91,
    48, 90,
    96, 88,
    144, 88,
    192, 69,
    192, 90,
    240, 74,
    288, 78,
    336, 74,
    384, 71,
    432, 74,
    480, 78,
    528, 74,
    576, 69,
    624, 74,
    672, 78,
    720, 74,
    720, 81,
    768, 71,
    768, 91,
    816, 74,
    816, 90,
    864, 78,
    864, 88,
    912, 74,
    912, 88,
    960, 69,
    1008, 74,
    1008, 90,
    1056, 78,
    1104, 74,
    1152, 71,
    1152, 86,
    1200, 74,
    1248, 78,
    1248, 88,
    1296, 74,
    1296, 81,
    1344, 69,
    1392, 74,
    1440, 78,
    1488, 74,
    1536, 71,
    1584, 74,
    1632, 78,
    1680, 74,
    1680, 81,
    1728, 71,
    1728, 88,
    1776, 76,
    1824, 79,
    1824, 90,
    1872, 76,
    1872, 91,
    1920, 71,
    1968, 76,
    2016, 79,
    2016, 88,
    2064, 76,
    2064, 85,
    2112, 69,
    2160, 73,
    2160, 86,
    2208, 79,
    2256, 73,
    2304, 69,
    2304, 88,
    2352, 73,
    2400, 79,
    2400, 81,
    2448, 73,
    2448, 81,
    2496, 69,
    2544, 74,
    2544, 90,
    2592, 78,
    2640, 74,
    2688, 71,
    2736, 74,
    2784, 78,
    2832, 74,
    2880, 69,
    2928, 74,
    2976, 78,
    3024, 74,
    3072, 71,
    3072, 91,
    3120, 74,
    3120, 90,
    3168, 78,
    3168, 88,
    3216, 74,
    3216, 88,
    3264, 69,
    3264, 90,
    3312, 74,
    3360, 78,
    3408, 74,
    3456, 71,
    3504, 74,
    3552, 78,
    3600, 74,
    3648, 69,
    3696, 74,
    3744, 78,
    3792, 74,
    3792, 81,
    3840, 71,
    3840, 91,
    3888, 74,
    3888, 90,
    3936, 78,
    3936, 88,
    3984, 74,
    3984, 88,
    4032, 69,
    4080, 74,
    4128, 78,
    4128, 90,
    4176, 74,
    4176, 86,
    4224, 71,
    4272, 74,
    4320, 78,
    4320, 88,
    4368, 74,
    4368, 81,
    4416, 69,
    4464, 74,
    4512, 78,
    4560, 74,
    4608, 71,
    4656, 74,
    4704, 78,
    4752, 74,
    4800, 71,
    4800, 88,
    4848, 76,
    4896, 79,
    4896, 90,
    4944, 76,
    4944, 91,
    4992, 71,
    5040, 76,
    5088, 79,
    5088, 88,
    5136, 76,
    5136, 85,
    5184, 69,
    5232, 73,
    5280, 79,
    5280, 86,
    5328, 73,
    5328, 88,
    5376, 69,
    5424, 73,
    5424, 81,
    5472, 79,
    5472, 86,
    5520, 73,
    5520, 88,
    5568, 70,
    5568, 89,
    5616, 74,
    5616, 88,
    5664, 77,
    5664, 86,
    5712, 81,
    5712, 84,
    5856, 81,
    5904, 82,
    5949, 89,
    5952, 105,
    5952, 72,
    5952, 77,
    5952, 84,
    6000, 81,
    6000, 96,
    6048, 108,
    6048, 72,
    6048, 77,
    6048, 89,
    6096, 96,
    6144, 103,
    6144, 72,
    6144, 76,
    6144, 88,
    6144, 88,
    6192, 79,
    6192, 86,
    6192, 96,
    6240, 108,
    6240, 72,
    6240, 76,
    6240, 86,
    6288, 84,
    6288, 96,
    6336, 106,
    6336, 70,
    6336, 74,
    6336, 86,
    6336, 86,
    6384, 105,
    6384, 82,
    6384, 84,
    6384, 96,
    6432, 103,
    6432, 70,
    6432, 74,
    6432, 84,
    6480, 76,
    6480, 96,
    6528, 105,
    6528, 72,
    6528, 77,
    6528, 84,
    6528, 89,
    6576, 81,
    6576, 96,
    6624, 101,
    6624, 72,
    6624, 77,
    6624, 81,
    6672, 82,
    6672, 96,
    6717, 89,
    6720, 105,
    6720, 72,
    6720, 77,
    6720, 84,
    6768, 81,
    6768, 96,
    6816, 108,
    6816, 72,
    6816, 77,
    6816, 89,
    6864, 96,
    6912, 103,
    6912, 72,
    6912, 76,
    6912, 88,
    6912, 91,
    6960, 79,
    6960, 89,
    6960, 96,
    7008, 108,
    7008, 72,
    7008, 76,
    7008, 88,
    7056, 86,
    7056, 96,
    7104, 106,
    7104, 70,
    7104, 74,
    7104, 86,
    7104, 86,
    7152, 105,
    7152, 82,
    7152, 88,
    7152, 96,
    7200, 103,
    7200, 70,
    7200, 74,
    7200, 89,
    7248, 76,
    7248, 96,
    7296, 105,
    7296, 72,
    7296, 77,
    7296, 89,
    7296, 89,
    7344, 81,
    7344, 96,
    7392, 101,
    7392, 72,
    7392, 77,
    7392, 91,
    7440, 93,
    7440, 96,
    7488, 103,
    7488, 70,
    7488, 74,
    7488, 91,
    7488, 94,
    7536, 106,
    7536, 79,
    7536, 94,
    7584, 105,
    7584, 70,
    7584, 74,
    7584, 93,
    7632, 103,
    7632, 79,
    7680, 100,
    7680, 72,
    7680, 76,
    7680, 91,
    7680, 91,
    7728, 101,
    7728, 79,
    7776, 103,
    7776, 72,
    7776, 76,
    7776, 89,
    7824, 108,
    7824, 79,
    7824, 91,
    7872, 105,
    7872, 72,
    7872, 77,
    7872, 89,
    7872, 93,
    7920, 108,
    7920, 81,
    7920, 93,
    7968, 103,
    7968, 72,
    7968, 77,
    7968, 88,
    7968, 91,
    8016, 108,
    8016, 81,
    8064, 101,
    8064, 74,
    8064, 77,
    8064, 86,
    8064, 89,
    8112, 81,
    8112, 93,
    8160, 105,
    8160, 74,
    8160, 77,
    8160, 86,
    8208, 81,
    8208, 84,
    8253, 89,
    8256, 106,
    8256, 70,
    8256, 74,
    8256, 86,
    8304, 79,
    8304, 89,
    8304, 98,
    8352, 101,
    8352, 70,
    8352, 74,
    8352, 89,
    8400, 79,
    8400, 88,
    8400, 98,
    8448, 105,
    8448, 69,
    8448, 73,
    8448, 88,
    8496, 79,
    8496, 88,
    8496, 97,
    8544, 103,
    8544, 69,
    8544, 73,
    8544, 74,
    8544, 90,
    8592, 102,
    8592, 79,
    8592, 90,
    8640, 62,
    8640, 69,
    8688, 74,
    8736, 78,
    8784, 62,
    8784, 74,
    8832, 59,
    8832, 71,
    8880, 74,
    8928, 78,
    8976, 59,
    8976, 74,
    9024, 62,
    9024, 69,
    9072, 74,
    9120, 78,
    9168, 62,
    9168, 74,
    9216, 59,
    9216, 71,
    9264, 74,
    9312, 78,
    9360, 59,
    9360, 74,
    9408, 62,
    9408, 69,
    9456, 74,
    9504, 78,
    9552, 62,
    9552, 74,
    9600, 59,
    9600, 71,
    9648, 74,
    9696, 78,
    9744, 59,
    9744, 74,
    9792, 62,
    9792, 69,
    9840, 74,
    9888, 78,
    9936, 62,
    9936, 74,
    9936, 81,
    9984, 71,
    9984, 71,
    9984, 91,
    10032, 74,
    10032, 90,
    10080, 71,
    10080, 78,
    10080, 88,
    10128, 69,
    10128, 74,
    10128, 88,
    10176, 62,
    10176, 69,
    10176, 90,
    10224, 74,
    10272, 78,
    10320, 62,
    10320, 74,
    10368, 59,
    10368, 71,
    10416, 74,
    10464, 78,
    10512, 59,
    10512, 74,
    10560, 62,
    10560, 69,
    10608, 74,
    10656, 78,
    10704, 62,
    10704, 74,
    10752, 59,
    10752, 71,
    10752, 91,
    10800, 74,
    10800, 90,
    10848, 78,
    10848, 88,
    10896, 59,
    10896, 74,
    10896, 88,
    10944, 62,
    10944, 69,
    10992, 74,
    11040, 78,
    11040, 90,
    11088, 62,
    11088, 74,
    11088, 86,
    11136, 59,
    11136, 71,
    11184, 74,
    11184, 88,
    11232, 78,
    11280, 59,
    11280, 74,
    11280, 81,
    11328, 62,
    11328, 69,
    11376, 74,
    11424, 78,
    11472, 62,
    11472, 74,
    11520, 59,
    11520, 71,
    11568, 74,
    11616, 78,
    11664, 59,
    11664, 74,
    11712, 64,
    11712, 71,
    11712, 88,
    11760, 76,
    11808, 79,
    11808, 90,
    11856, 64,
    11856, 76,
    11856, 91,
    11904, 64,
    11904, 71,
    11952, 66,
    11952, 76,
    12000, 67,
    12000, 79,
    12000, 88,
    12048, 76,
    12096, 57,
    12096, 69,
    12096, 85,
    12144, 73,
    12192, 79,
    12192, 86,
    12240, 57,
    12240, 73,
    12240, 88,
    12288, 57,
    12288, 69,
    12336, 59,
    12336, 73,
    12384, 61,
    12384, 79,
    12384, 81,
    12432, 73,
    12432, 81,
    12480, 62,
    12480, 69,
    12528, 74,
    12528, 90,
    12576, 78,
    12624, 62,
    12624, 74,
    12672, 59,
    12672, 71,
    12720, 74,
    12768, 78,
    12816, 59,
    12816, 74,
    12864, 62,
    12864, 69,
    12912, 74,
    12960, 78,
    13008, 62,
    13008, 74,
    13008, 81,
    13008, 86,
    13056, 71,
    13056, 71,
    13056, 91,
    13056, 95,
    13104, 74,
    13104, 90,
    13104, 93,
    13152, 71,
    13152, 78,
    13152, 88,
    13152, 91,
    13200, 69,
    13200, 74,
    13200, 88,
    13200, 91,
    13248, 62,
    13248, 69,
    13248, 90,
    13248, 93,
    13296, 74,
    13344, 78,
    13392, 62,
    13392, 74,
    13440, 59,
    13440, 71,
    13488, 74,
    13536, 78,
    13584, 59,
    13584, 74,
    13632, 62,
    13632, 69,
    13680, 74,
    13728, 78,
    13776, 62,
    13776, 74,
    13776, 81,
    13776, 86,
    13824, 59,
    13824, 71,
    13824, 91,
    13824, 95,
    13872, 74,
    13872, 90,
    13872, 93,
    13920, 78,
    13920, 88,
    13920, 91,
    13968, 59,
    13968, 74,
    13968, 88,
    13968, 91,
    14016, 62,
    14016, 69,
    14064, 74,
    14112, 78,
    14112, 90,
    14112, 93,
    14160, 62,
    14160, 74,
    14160, 86,
    14160, 90,
    14208, 59,
    14208, 71,
    14256, 74,
    14304, 78,
    14304, 88,
    14304, 91,
    14352, 59,
    14352, 74,
    14352, 81,
    14352, 86,
    14400, 62,
    14400, 69,
    14448, 74,
    14496, 78,
    14544, 62,
    14544, 74,
    14592, 59,
    14592, 71,
    14640, 74,
    14688, 78,
    14736, 59,
    14736, 74,
    14784, 64,
    14784, 71,
    14784, 88,
    14832, 76,
    14880, 79,
    14880, 90,
    14928, 64,
    14928, 76,
    14928, 91,
    14976, 64,
    14976, 71,
    15024, 66,
    15024, 76,
    15072, 67,
    15072, 79,
    15072, 88,
    15120, 76,
    15168, 57,
    15168, 69,
    15168, 85,
    15216, 73,
    15264, 79,
    15264, 86,
    15312, 57,
    15312, 73,
    15312, 88,
    15360, 57,
    15360, 69,
    15408, 59,
    15408, 73,
    15408, 81,
    15456, 61,
    15456, 79,
    15456, 86,
    15504, 57,
    15504, 73,
    15504, 88,
    15552, 58,
    15552, 70,
    15552, 89,
    15600, 74,
    15600, 88,
    15648, 81,
    15648, 86,
    15696, 70,
    15696, 77,
    15696, 84,
    15744, 81,
    15792, 77,
    15840, 70,
    15840, 77,
    15840, 81,
    15840, 81,
    15888, 57,
    15888, 77,
    15888, 79,
    15888, 82,
    15936, 65,
    15936, 72,
    15936, 77,
    15936, 81,
    15936, 84,
    15984, 81,
    16032, 72,
    16032, 77,
    16032, 84,
    16032, 89,
    16080, 65,
    16128, 60,
    16128, 72,
    16128, 76,
    16128, 84,
    16128, 88,
    16176, 79,
    16176, 86,
    16224, 72,
    16224, 76,
    16224, 82,
    16224, 86,
    16272, 60,
    16272, 81,
    16272, 84,
    16320, 58,
    16320, 70,
    16320, 74,
    16320, 82,
    16320, 86,
    16368, 81,
    16368, 82,
    16368, 84,
    16416, 70,
    16416, 74,
    16416, 81,
    16416, 84,
    16464, 58,
    16464, 76,
    16512, 65,
    16512, 72,
    16512, 77,
    16512, 81,
    16512, 84,
    16560, 81,
    16608, 72,
    16608, 77,
    16608, 79,
    16608, 81,
    16656, 77,
    16656, 82,
    16704, 65,
    16704, 72,
    16704, 77,
    16704, 77,
    16704, 84,
    16752, 81,
    16800, 72,
    16800, 77,
    16800, 81,
    16800, 89,
    16848, 65,
    16896, 60,
    16896, 72,
    16896, 76,
    16896, 82,
    16896, 91,
    16944, 79,
    16944, 81,
    16944, 89,
    16992, 72,
    16992, 76,
    16992, 79,
    16992, 88,
    17040, 60,
    17040, 77,
    17040, 86,
    17088, 58,
    17088, 70,
    17088, 74,
    17088, 77,
    17088, 86,
    17136, 79,
    17136, 82,
    17136, 88,
    17184, 70,
    17184, 74,
    17184, 81,
    17184, 89,
    17232, 58,
    17232, 76,
    17280, 65,
    17280, 72,
    17280, 77,
    17280, 81,
    17280, 89,
    17328, 81,
    17376, 65,
    17376, 72,
    17376, 77,
    17376, 82,
    17376, 91,
    17424, 60,
    17424, 84,
    17424, 93,
    17472, 58,
    17472, 70,
    17472, 74,
    17472, 86,
    17472, 94,
    17520, 79,
    17520, 86,
    17520, 94,
    17568, 58,
    17568, 70,
    17568, 74,
    17568, 84,
    17568, 93,
    17616, 79,
    17664, 60,
    17664, 72,
    17664, 76,
    17664, 84,
    17664, 91,
    17712, 79,
    17760, 60,
    17760, 72,
    17760, 76,
    17760, 81,
    17760, 89,
    17808, 79,
    17808, 82,
    17808, 91,
    17856, 65,
    17856, 72,
    17856, 77,
    17856, 84,
    17856, 93,
    17904, 81,
    17904, 84,
    17904, 93,
    17952, 64,
    17952, 72,
    17952, 77,
    17952, 82,
    17952, 91,
    18000, 81,
    18000, 89,
    18048, 62,
    18048, 74,
    18048, 77,
    18048, 81,
    18048, 89,
    18096, 81,
    18144, 60,
    18144, 74,
    18144, 77,
    18144, 79,
    18144, 86,
    18192, 77,
    18192, 81,
    18192, 84,
    18240, 58,
    18240, 70,
    18240, 74,
    18240, 77,
    18240, 86,
    18288, 79,
    18288, 79,
    18288, 89,
    18336, 65,
    18336, 70,
    18336, 74,
    18336, 81,
    18336, 89,
    18384, 79,
    18384, 79,
    18384, 88,
    18432, 57,
    18432, 69,
    18432, 73,
    18480, 79,
    18480, 79,
    18480, 88,
    18528, 64,
    18528, 69,
    18528, 73,
    18528, 81,
    18528, 90,
    18576, 79,
    18576, 81,
    18576, 90,
    18624, 62,
    18624, 69,
    18672, 74,
    18720, 78,
    18768, 62,
    18768, 74,
    18816, 59,
    18816, 71,
    18864, 74,
    18912, 78,
    18960, 59,
    18960, 74,
    19008, 62,
    19008, 69,
    19056, 74,
    19104, 78,
    19152, 62,
    19152, 74,
    19200, 59,
    19200, 71,
    19248, 74,
    19296, 78,
    19344, 59,
    19344, 74,
    19392, 62,
    19392, 69,
    19440, 74,
    19488, 78,
    19536, 62,
    19536, 74,
    19584, 59,
    19584, 71,
    19632, 74,
    19680, 78,
    19728, 59,
    19728, 74,
    19776, 62,
    19776, 69,
    19824, 74,
    19872, 78,
    19920, 62,
    19920, 74,
    19968, 71,
    19968, 71,
    19968, 91,
    19992, 91,
    20016, 74,
    20016, 90,
    20064, 71,
    20064, 78,
    20064, 88,
    20112, 69,
    20112, 74,
    20112, 88,
    20160, 69,
    20184, 90,
    20208, 74,
    20256, 78,
    20304, 74,
    20352, 71,
    20400, 74,
    20448, 78,
    20496, 74,
    20544, 69,
    20592, 74,
    20640, 78,
    20688, 74,
    20688, 81,
    20736, 71,
    20736, 91,
    20784, 74,
    20784, 90,
    20832, 78,
    20832, 88,
    20880, 74,
    20880, 88,
    20928, 69,
    20976, 74,
    21024, 78,
    21024, 90,
    21072, 74,
    21072, 86,
    21120, 71,
    21168, 74,
    21216, 78,
    21216, 88,
    21264, 74,
    21264, 81,
    21312, 69,
    21360, 74,
    21408, 78,
    21456, 74,
    21504, 71,
    21552, 74,
    21600, 78,
    21648, 74,
    21696, 71,
    21696, 88,
    21744, 76,
    21792, 79,
    21792, 90,
    21840, 76,
    21840, 91,
    21888, 71,
    21936, 76,
    21984, 79,
    21984, 88,
    22032, 76,
    22080, 69,
    22080, 85,
    22128, 73,
    22176, 79,
    22176, 86,
    22224, 73,
    22224, 88,
    22272, 69,
    22320, 73,
    22368, 79,
    22368, 81,
    22416, 73,
    22416, 81,
    22464, 69,
    22512, 74,
    22512, 90,
    22560, 78,
    22608, 74,
    22656, 71,
    22704, 74,
    22752, 78,
    22800, 74,
    22848, 69,
    22896, 74,
    22944, 78,
    22992, 74,
    23040, 71,
    23040, 91,
    23040, 95,
    23088, 74,
    23088, 90,
    23088, 93,
    23136, 78,
    23136, 88,
    23136, 91,
    23184, 74,
    23184, 88,
    23184, 91,
    23232, 62,
    23232, 69,
    23244, 90,
    23244, 93,
    23280, 74,
    23328, 78,
    23376, 62,
    23376, 74,
    23424, 59,
    23424, 71,
    23472, 74,
    23520, 78,
    23568, 59,
    23568, 74,
    23616, 62,
    23616, 69,
    23664, 74,
    23712, 78,
    23760, 62,
    23760, 74,
    23808, 59,
    23808, 71,
    23808, 91,
    23808, 95,
    23856, 74,
    23856, 90,
    23856, 93,
    23904, 78,
    23904, 88,
    23904, 91,
    23952, 59,
    23952, 74,
    23952, 88,
    23952, 91,
    24000, 62,
    24000, 69,
    24048, 74,
    24096, 78,
    24096, 90,
    24096, 93,
    24144, 62,
    24144, 74,
    24144, 86,
    24144, 90,
    24192, 59,
    24192, 71,
    24240, 74,
    24288, 78,
    24288, 88,
    24288, 91,
    24336, 59,
    24336, 74,
    24336, 81,
    24336, 86,
    24384, 62,
    24384, 69,
    24432, 74,
    24480, 78,
    24528, 62,
    24528, 74,
    24576, 59,
    24576, 71,
    24624, 74,
    24672, 78,
    24720, 59,
    24720, 74,
    24768, 64,
    24768, 71,
    24768, 88,
    24816, 76,
    24864, 79,
    24864, 90,
    24912, 64,
    24912, 76,
    24912, 91,
    24960, 64,
    24960, 71,
    25008, 66,
    25008, 76,
    25056, 67,
    25056, 79,
    25056, 88,
    25104, 76,
    25152, 57,
    25152, 69,
    25152, 85,
    25200, 73,
    25248, 79,
    25248, 86,
    25296, 57,
    25296, 73,
    25296, 88,
    25344, 57,
    25344, 69,
    25392, 59,
    25392, 73,
    25392, 81,
    25440, 61,
    25440, 79,
    25440, 86,
    25488, 57,
    25488, 73,
    25488, 88,
    25536, 58,
    25536, 70,
    25536, 89,
    25584, 74,
    25584, 88,
    25632, 81,
    25632, 86,
    25680, 70,
    25680, 77,
    25680, 84,
    25728, 81,
    25776, 77,
    25824, 70,
    25824, 77,
    25824, 81,
    25824, 81,
    25872, 57,
    25872, 77,
    25872, 79,
    25872, 82,
    25920, 65,
    25920, 72,
    25920, 77,
    25920, 81,
    25920, 84,
    25968, 81,
    26016, 72,
    26016, 77,
    26016, 84,
    26016, 89,
    26064, 65,
    26112, 60,
    26112, 72,
    26112, 76,
    26112, 84,
    26112, 88,
    26160, 79,
    26160, 86,
    26208, 72,
    26208, 76,
    26208, 82,
    26208, 86,
    26256, 60,
    26256, 81,
    26256, 84,
    26304, 58,
    26304, 70,
    26304, 74,
    26304, 82,
    26304, 86,
    26352, 81,
    26352, 82,
    26352, 84,
    26400, 70,
    26400, 74,
    26400, 81,
    26400, 84,
    26448, 58,
    26448, 76,
    26496, 65,
    26496, 72,
    26496, 77,
    26496, 81,
    26496, 84,
    26544, 81,
    26592, 72,
    26592, 77,
    26592, 79,
    26592, 81,
    26640, 65,
    26640, 77,
    26640, 82,
    26688, 65,
    26688, 72,
    26688, 77,
    26688, 77,
    26688, 84,
    26736, 81,
    26784, 72,
    26784, 77,
    26784, 81,
    26784, 89,
    26832, 65,
    26880, 60,
    26880, 72,
    26880, 76,
    26880, 82,
    26880, 91,
    26928, 79,
    26928, 81,
    26928, 89,
    26976, 72,
    26976, 76,
    26976, 79,
    26976, 88,
    27024, 60,
    27024, 77,
    27024, 86,
    27072, 58,
    27072, 70,
    27072, 74,
    27072, 77,
    27072, 86,
    27120, 79,
    27120, 82,
    27120, 88,
    27168, 70,
    27168, 74,
    27168, 81,
    27168, 89,
    27216, 58,
    27216, 76,
    27264, 65,
    27264, 72,
    27264, 77,
    27264, 81,
    27264, 89,
    27312, 81,
    27360, 65,
    27360, 72,
    27360, 77,
    27360, 82,
    27360, 91,
    27408, 60,
    27408, 84,
    27408, 93,
    27456, 58,
    27456, 70,
    27456, 74,
    27456, 86,
    27456, 94,
    27504, 79,
    27504, 86,
    27504, 94,
    27552, 58,
    27552, 70,
    27552, 74,
    27552, 84,
    27552, 93,
    27600, 79,
    27600, 91,
    27648, 60,
    27648, 72,
    27648, 76,
    27648, 84,
    27648, 91,
    27696, 79,
    27744, 60,
    27744, 72,
    27744, 76,
    27744, 81,
    27744, 89,
    27792, 79,
    27792, 82,
    27792, 91,
    27840, 65,
    27840, 72,
    27840, 77,
    27840, 84,
    27840, 93,
    27888, 81,
    27888, 84,
    27888, 93,
    27936, 64,
    27936, 72,
    27936, 77,
    27936, 82,
    27936, 91,
    27984, 81,
    27984, 89,
    28032, 62,
    28032, 74,
    28032, 77,
    28032, 81,
    28032, 89,
    28080, 81,
    28128, 60,
    28128, 74,
    28128, 77,
    28128, 79,
    28128, 86,
    28176, 77,
    28176, 81,
    28176, 84,
    28224, 58,
    28224, 70,
    28224, 74,
    28224, 77,
    28224, 86,
    28272, 79,
    28272, 79,
    28272, 89,
    28320, 65,
    28320, 70,
    28320, 74,
    28320, 81,
    28320, 89,
    28368, 79,
    28368, 79,
    28368, 88,
    28416, 57,
    28416, 69,
    28416, 73,
    28464, 79,
    28464, 79,
    28464, 88,
    28512, 64,
    28512, 69,
    28512, 73,
    28512, 81,
    28512, 90,
    28560, 79,
    28560, 81,
    28560, 90,
    28608, 62,
    28608, 69,
    28656, 74,
    28704, 78,
    28752, 62,
    28752, 74,
    28800, 59,
    28800, 71,
    28848, 74,
    28896, 78,
    28896, 93,
    28944, 59,
    28944, 74,
    28944, 93,
    28992, 62,
    28992, 69,
    28992, 95,
    29040, 74,
    29040, 93,
    29088, 78,
    29088, 90,
    29136, 62,
    29136, 74,
    29136, 86,
    29184, 59,
    29184, 71,
    29232, 74,
    29232, 88,
    29232, 91,
    29280, 78,
    29280, 90,
    29280, 93,
    29328, 59,
    29328, 74,
    29328, 90,
    29328, 93,
    29376, 62,
    29376, 69,
    29424, 74,
    29472, 78,
    29520, 62,
    29520, 74,
    29568, 59,
    29568, 71,
    29616, 74,
    29616, 93,
    29664, 78,
    29664, 93,
    29712, 59,
    29712, 74,
    29712, 93,
    29760, 62,
    29760, 69,
    29760, 95,
    29808, 74,
    29808, 93,
    29856, 78,
    29856, 90,
    29904, 62,
    29904, 74,
    29904, 86,
    29952, 59,
    29952, 71,
    30000, 74,
    30000, 88,
    30000, 91,
    30048, 78,
    30048, 90,
    30048, 93,
    30096, 59,
    30096, 74,
    30096, 90,
    30096, 93,
    30144, 62,
    30144, 69,
    30192, 74,
    30240, 78,
    30288, 62,
    30288, 74,
    30336, 59,
    30336, 71,
    30384, 74,
    30384, 93,
    30432, 78,
    30432, 93,
    30480, 59,
    30480, 74,
    30480, 93,
    30528, 62,
    30528, 69,
    30528, 95,
    30576, 74,
    30576, 93,
    30624, 78,
    30624, 90,
    30672, 62,
    30672, 74,
    30672, 86,
    30720, 59,
    30720, 71,
    30768, 74,
    30768, 88,
    30768, 91,
    30816, 78,
    30816, 90,
    30816, 93,
    30864, 59,
    30864, 74,
    30864, 90,
    30864, 93,
    30912, 62,
    30912, 69,
    30960, 74,
    31008, 78,
    31056, 62,
    31056, 74,
    31104, 59,
    31104, 71,
    31152, 74,
    31200, 78,
    31200, 93,
    31248, 59,
    31248, 74,
    31248, 93,
    31296, 62,
    31296, 69,
    31296, 95,
    31344, 74,
    31344, 93,
    31392, 78,
    31392, 90,
    31440, 62,
    31440, 74,
    31440, 86,
    31488, 59,
    31488, 71,
    31536, 74,
    31536, 88,
    31536, 91,
    31584, 78,
    31584, 90,
    31584, 93,
    31632, 59,
    31632, 74,
    31632, 90,
    31632, 93,
    31680, 62,
    31680, 69,
    31728, 74,
    31776, 78,
    31824, 62,
    31824, 74,
    31872, 59,
    31872, 71,
    31920, 74,
    31920, 93,
    31968, 78,
    31968, 93,
    32016, 59,
    32016, 74,
    32016, 93,
    32064, 62,
    32064, 69,
    32064, 95,
    32112, 74,
    32112, 93,
    32160, 78,
    32160, 90,
    32208, 62,
    32208, 74,
    32208, 86,
    32256, 59,
    32256, 71,
    32304, 74,
    32304, 88,
    32304, 91,
    32352, 78,
    32352, 90,
    32352, 93,
    32400, 59,
    32400, 74,
    32400, 90,
    32400, 93,
    32448, 62,
    32448, 69,
    32496, 74,
    32544, 78,
    32592, 62,
    32592, 74,
    32640, 59,
    32640, 71,
    32688, 74,
    32688, 91,
    32736, 78,
    32736, 93,
    32784, 59,
    32784, 74,
    32784, 93,
    32832, 62,
    32832, 69,
    32880, 74,
    32928, 78,
    32976, 62,
    32976, 74,
    33024, 71,
    33024, 71,
    33072, 74,
    33072, 91,
    33120, 71,
    33120, 78,
    33120, 90,
    33168, 69,
    33168, 74,
    33168, 90,
    ]

print 'Attack:', len( wt_attack ), 'Bytes'

import math, struct, winsound

sample_rate = 39062 # 80e6 / 2048
wavetable_fundamental_frequency = sample_rate / ( 256 * math.pi ) # leads to single amplitude steps
print 'Fundamental_f:', wavetable_fundamental_frequency, 'Hz'

wt_sustain = [ 0 ] * int( sample_rate / wavetable_fundamental_frequency )
print 'Sustain:', len( wt_sustain ), 'Bytes'
for i in range( len( wt_sustain ) ):
    wt_sustain[ i ] = int( round( 127 * math.sin( 2 * math.pi * i / len( wt_sustain ) ) ) )
##    if i % 16 == 0:
##        print
##    print '%s,' % wt_sustain[ i ],
##print

wt = wt_attack + wt_sustain

envelope_byte_count = 1024 # should be long enough for small decay steps
envelope_table = [ 0 ] * envelope_byte_count
print 'Envelope:', len( envelope_table ), 'Bytes'
summ = 0
for i in range( envelope_byte_count ):
    envelope_table[ i ] = int( round( 255. / math.exp( i / 163. ) ) ) # should match output bit-depth for single amplitude steps at the end
    ##envelope_table[ i ] = int( round( 65535. / math.exp( i / 86. ) ) ) # should match output bit-depth for single amplitude steps at the end
##    if i % 16 == 0:
##        print
##    print '%s,' % envelope_table[ i ],
##print

data = ''

pot = 8 # power of two
env_pot = 7

oscillator_count = 16 # 64 for no note truncating
increments = [ 0 ] * oscillator_count
phase_accu_ints = [ 0 ] * oscillator_count
envelope_positions = [ 0 ] * oscillator_count

# http://tonalsoft.com/pub/news/pitch-bend.aspx
scale = []
for i in range( -6 * 12 + 3, 4 * 12 + 3 + 7 ):
    f = 440 * 2 ** ( i / 12. )
    scale.append( int( round( ( 1 << pot ) * f / wavetable_fundamental_frequency ) ) )
##    if ( i - 3 ) % 12 == 0:
##        print
##    print '%s,' % scale[ -1 ],
scale.append( 0 ) # To be able to place a silent note at the end if desired to delay looping
##print scale[ -1 ]
print 'Scale:', len( scale )

ticks = 0
time = 0
event_index = 0
next_osc = 0
for i in range( sample_rate * 2 ): # 175 seconds
    while event_index < len( tune_still_alive ) and time >= tune_still_alive[ event_index ]:
        increments[ next_osc ] = scale[ tune_still_alive[ event_index + 1 ] ]
        phase_accu_ints[ next_osc ] = 0
        ##if 0 < envelope_table[ envelope_positions[ next_osc ] >> env_pot ] < 255:
        ##    print 'trunc at env level %s' % envelope_table[ envelope_positions[ next_osc ] >> env_pot ]
        envelope_positions[ next_osc ] = 0
        next_osc += 1
        if next_osc >= oscillator_count:
            next_osc = 0
        event_index += 2
    value = 0
    for osc in range( oscillator_count ):
        phase_accu_ints[ osc ] += increments[ osc ]
        if phase_accu_ints[ osc ] >= len( wt ) << pot:
            phase_accu_ints[ osc ] -= len( wt_sustain ) << pot
        phase_accu = phase_accu_ints[ osc ] >> pot
        value += ( envelope_table[ envelope_positions[ osc ] >> env_pot ] * wt[ phase_accu ] )
        if ( phase_accu_ints[ osc ] >= len( wt_attack ) << pot and
             envelope_positions[ osc ] < ( len( envelope_table ) << env_pot ) - 1 ):
            envelope_positions[ osc ] += 1
    value >>= 8
    if value > 1016:
        print 'clip'
        value = 1016
    elif value < -1016:
        print 'clip'
        value = -1016
    data += struct.pack( '<h', value << 5 )
    ticks += 1
    if ticks >= sample_rate / 192:
        ticks = 0
        time += 1

def __header( samplesPerSec, dataSize ):
    headerSize = 44
    RIFFChunkID = 'RIFF'
    RIFFChunkSize = dataSize + headerSize - 8
    RIFFType = 'WAVE'
    fmtChunkID = 'fmt '
    fmtChunkSize = 16 # 16 Byte
    wFormatTag = 0x0001 # WAVE_FORMAT_PCM
    wChannels = 1
    dwSamplesPerSec = samplesPerSec
    nBitsPerSample = 16
    wBlockAlign = wChannels * ( ( nBitsPerSample + 7 ) // 8 )
    dwAvgBytesPerSec = samplesPerSec * wBlockAlign
    dataChunkID = 'data'
    dataChunkSize = dataSize
    header = struct.pack( '<4sL4s4s', RIFFChunkID, RIFFChunkSize, RIFFType, fmtChunkID )
    header += struct.pack( '<LHHLL', fmtChunkSize, wFormatTag, wChannels, dwSamplesPerSec, dwAvgBytesPerSec )
    header += struct.pack( '<HH4sL', wBlockAlign, nBitsPerSample, dataChunkID, dataChunkSize )
    assert len( header ) == headerSize, 'Error: Actual headerSize (%s) differs from assumed one (%s).' % ( len( header ), headerSize )
    return header

header = __header( sample_rate, len( data ) )
f = open( 'dds.wav', 'wb' ); f.write( header + data ); f.close()
winsound.PlaySound( header + data, winsound.SND_MEMORY | winsound.SND_NOWAIT )
