def find_password_of_length_k():
k = int(input("Введите целое число K: "))
passwords = []
while True:
password = input("Введите пароль: ")
if password == "END":
break
passwords.append(password)
for password in passwords:
if len(password) == k:
print(password)
return
find_password_of_length_k()