def mark_island(row, col, land_map, marker):
    if ((row < 0) or (col < 0) or (row >= len(land_map)) or (col >= len(land_map[0]))):
        return land_map
    if (land_map[row][col] == 0):
        return land_map
    if (land_map[row][col] == marker):
        return land_map
    if (land_map[row][col] == 1):
        land_map[row][col] = marker
    for (r, c) in moves:
        land_map = mark_island((row + r), (col + c), land_map, marker)
    return land_map
def mark_island(row, col, land_map, marker):
    if ((row < 0) or (col < 0) or (row >= len(land_map)) or (col >= len(land_map[0]))):
        return land_map
    if (land_map[row][col] == 0):
        return land_map
    if (land_map[row][col] == marker):
        return land_map
    if (land_map[row][col] == 1):
        land_map[row][col] = marker
    for (r, c) in moves:
        land_map = mark_island((row + r), (col + c), land_map, marker)
    return land_map