def is_vowel_start(word):
    import string
    clean = word.strip(string.punctuation)
    if not clean:
        return False
    vowels = 'aeiouyAEIOUY'
    return clean[0] in vowels


with open('input.txt', 'r', encoding='utf-8') as f:
    lines = f.readlines()

with open('output.txt', 'w', encoding='utf-8') as f_out:
    for line_num, line in enumerate(lines, start=1):
        words = line.split()

        if not words:
            continue

        selected = []
        for word in words:
            if is_vowel_start(word):
                selected.append(word)

        if selected:
            f_out.write(f"{line_num} {' '.join(selected)} {len(selected)}\n")