Function to find out parent of an alphabet
def find ( x ) : NEW_LINE INDENT if parent [ x ] == x : NEW_LINE INDENT return x NEW_LINE DEDENT else : NEW_LINE INDENT return find ( parent [ x ] ) NEW_LINE DEDENT DEDENT