def str_to_state(str_state):
    """
    Returns a state corresponding to the provided string representation. Here is an example of a valid state:
     , , , , , ,X
     , , , , ,X,
     , , , , ,O,X
     ,X,O, , , ,X
     , , , , ,O,
     ,O,X, , , ,
    O, , , ,O, ,

    :param str_state: a string representation of the board
    :return: the corresponding state
    """
    white_squares = []
    black_squares = []
    y = 1
    for row in str_state.splitlines():
        x = 1
        for square in row.split(','):
            if square == ',':
                continue
            if square == 'O':
                white_squares.append((x, y))
            elif square == 'X':
                black_squares.append((x, y))
            x += 1
        y += 1
    return tuple(white_squares), tuple(black_squares)