def check_size(indices: list, queries: list) -> int:
    """ Check whether size of all indices and queries are the same

    :param list indices: list of all indices
    :param list queries: list of all queries
    :returns: the size when size of all indices and queries are the same or -1
              if lists does not have same size
    """
    width = 0
    # get the first length if any
    if indices:
        width = len(indices[0])
    elif queries:
        width = len(queries[0])

    # at this point, width will be the length of 1 of the indices or queries,
    # or will still be 0 if there is no index or query
    for index in indices:
        if len(index) != width:
            print('Indices are not the same width')
            return -1

    for query in queries:
        if len(query) != width:
            print('Queries and indices not the same width')
            return -1

    return width