from typing import Tuple


def index_to_tuple(index: int, size: int) -> Tuple[int, int]:
    """
    Returns a tuple to indicate 2d-array for the given index

    :param index:
    :param size:
    :return:
    """
    assert 0 <= index < size * size, "Out of bound"

    return int(index / size), int(index % size)