import ast


def get_variable(assignable):
    """
    Return modified variable name.

    >>> import ast
    >>> ref = ast.Subscript(
    ...     value=ast.Subscript(
    ...         value=ast.Name(id='a', ctx=ast.Load()),
    ...         slice=ast.Index(value=ast.Name(id='i', ctx=ast.Load())),
    ...         ctx=ast.Load()),
    ...     slice=ast.Index(value=ast.Name(id='j', ctx=ast.Load())),
    ...     ctx=ast.Load())
    >>> ast.dump(get_variable(ref))
    "Name(id='a', ctx=Load())"
    """
    msg = "Only name and subscript can be assigned."
    assert isinstance(assignable, (ast.Name, ast.Subscript)), msg
    while isinstance(assignable, ast.Subscript):
        assignable = assignable.value
    return assignable