import re
text = """Ukraine[a] is a country in Eastern Europe. It is the second-largest country in Europe after Russia,
which borders it to the east and northeast.[b] Ukraine also borders Belarus to the north;
Poland and Slovakia to the west; Hungary, Romania and Moldova[c] to the southwest;
and the Black Sea and the Sea of Azov to the south and southeast.[d]
Kyiv is the nation's capital and largest city, followed by Kharkiv, Odesa, and Dnipro.
Ukraine's official language is Ukrainian."""
words = re.findall(r"[A-Za-z]+", text)
allowed_start = ("I", "Y", "K", "L", "M", "N")
IDN = [w for w in words if w.startswith(allowed_start)]
print("Масив IDN:", IDN)
aW1wb3J0IHJlCnRleHQgPSAiIiJVa3JhaW5lW2FdIGlzIGEgY291bnRyeSBpbiBFYXN0ZXJuIEV1cm9wZS4gSXQgaXMgdGhlIHNlY29uZC1sYXJnZXN0IGNvdW50cnkgaW4gRXVyb3BlIGFmdGVyIFJ1c3NpYSwgCndoaWNoIGJvcmRlcnMgaXQgdG8gdGhlIGVhc3QgYW5kIG5vcnRoZWFzdC5bYl0gVWtyYWluZSBhbHNvIGJvcmRlcnMgQmVsYXJ1cyB0byB0aGUgbm9ydGg7IApQb2xhbmQgYW5kIFNsb3Zha2lhIHRvIHRoZSB3ZXN0OyBIdW5nYXJ5LCBSb21hbmlhIGFuZCBNb2xkb3ZhW2NdIHRvIHRoZSBzb3V0aHdlc3Q7IAphbmQgdGhlIEJsYWNrIFNlYSBhbmQgdGhlIFNlYSBvZiBBem92IHRvIHRoZSBzb3V0aCBhbmQgc291dGhlYXN0LltkXSAKS3lpdiBpcyB0aGUgbmF0aW9uJ3MgY2FwaXRhbCBhbmQgbGFyZ2VzdCBjaXR5LCBmb2xsb3dlZCBieSBLaGFya2l2LCBPZGVzYSwgYW5kIERuaXByby4gClVrcmFpbmUncyBvZmZpY2lhbCBsYW5ndWFnZSBpcyBVa3JhaW5pYW4uIiIiCndvcmRzID0gcmUuZmluZGFsbChyIltBLVphLXpdKyIsIHRleHQpCmFsbG93ZWRfc3RhcnQgPSAoIkkiLCAiWSIsICJLIiwgIkwiLCAiTSIsICJOIikKSUROID0gW3cgZm9yIHcgaW4gd29yZHMgaWYgdy5zdGFydHN3aXRoKGFsbG93ZWRfc3RhcnQpXQpwcmludCgi0JzQsNGB0LjQsiBJRE46IiwgSUROKQ==