import six


def disp_title(all_title_idx,dictionary,number_of_title):
    """
        Displays the nth title in all_title_idx represented as indices using the dictionary
        Titles are seperated by coded <eol> (end of line)
    """
    idx_end_of_line = dictionary.get('<eol>')
    index2word = {wid: word for word, wid in six.iteritems(dictionary)}
    eolidx = [i for i, x in enumerate([all_title_idx[y] == idx_end_of_line for y in range(len(all_title_idx))]) if x]

    return [index2word[all_title_idx[x]] for x in range(eolidx[number_of_title]+1,eolidx[number_of_title+1]+1)]