import copy


def pad_grid(grid, moves):
    """pad the grid with a white tile in any blank spot next to a black tile"""
    new_grid =copy.deepcopy(grid)

    for y in grid:
        for x in grid[y]:
            if grid[y][x] == "b":
                for move in moves:
                    ymove = y + moves[move][1]
                    xmove = x + moves[move][0]
                    if ymove not in new_grid:
                        new_grid[ymove] = {}
                    if xmove not in new_grid[ymove]:
                        new_grid[ymove][xmove] = "w"

    return new_grid