k = int(input('k = '))
lst = input().lower().split()
count = 0
for i in lst:
if i.count('ы') > 1 and len(i) == k:
print(i, end=' ')
count += 1
print(f'\n{count}')
k = int(input('k = '))
lst = input().lower().split()
count = 0
for i in lst:
if i.count('ы') > 1 and len(i) == k:
print(i, end=' ')
count += 1
print(f'\n{count}')