The reading of the color blocks is extremely slow for some reason.
Even with the sample code, just timing the input of the colors takes about 90ms on average (on the first turn it can take 200+)
Reading the other input lines works fast, just the color section is slow
import sys
import math
import time
# game loop
while True:
start = time.perf_counter()
for i in range(8):
color_a, color_b = [int(j) for j in input().split()]
print('This takes way too long', (time.perf_counter()-start)*1000, file=sys.stderr)
for i in range(12):
row = input()
for i in range(12):
row = input() # One line of the map ('.' = empty, '0' = skull block, '1' to '5' = colored block)
print("0 1")