def load_input(fp: TextIO):
    data = fp.read().strip().split('\n\n')
    iea = data[0]
    assert (len(iea) == 512)
    grid = []
    for line in data[1].strip().split('\n'):
        grid.append(list(line))
    image = Image.from_grid(grid)
    return (iea, image)
def load_input(fp: TextIO):
    data = fp.read().strip().split('\n\n')
    iea = data[0]
    assert (len(iea) == 512)
    grid = []
    for line in data[1].strip().split('\n'):
        grid.append(list(line))
    image = Image.from_grid(grid)
    return (iea, image)