import numpy as np

G = np.array([1,1,1,0,1,0,0,0,1,1,1,0,1,0,0,0,1,1,1,0,1]).reshape((3,7))
H = np.array([1,1,1,0,0,1,1,1,1,1,0,1,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]).reshape((7,4))

for i in range(1,8):
    word = [0,0,0]
    for j in range(3):
        word[j] = 1 * bool(i & 2**j)

    c = (word @ G) % 2
    check = (c @ H) % 2
    print(word, c, check)

print([1,1,1,1,1,1,1] @ H)
