AnnaKar/eBadalyan
AnnaKar/abrivan
n1nw = eval(input())n1a1a2 = eval(input())
2d = dict()2d = dict()
3text = input()3text = input()
n4 n
5while text:4while text:
6    text = text.split()5    text = text.split()
n7    for words in text:n6    for slova in text:
8        if "'" in words:7        if "'" in slova:
9            words = words[0:words.find("'")]8            slova = slova[0:slova.find("'")]
10        if ";" in words:9        if ";" in slova:
11            words = words[0:words.find(";")]10            slova = slova[0:slova.find(";")]
12        if "-" in words:11        if "-" in slova:
13            words = words.replace((words[0:words.find("-")] + "-"), "")12            slova = slova.replace((slova[0:slova.find("-")]+"-"), "")
14        while len(words) > 1 and not words[-1].isalpha():13        while len(slova) > 1 and not slova[-1].isalpha():
15            words = words[0:-1]14            slova = slova[0:-1]
16        while len(words) > 1 and not words[0].isalpha():15        while len(slova) > 1 and not slova[0].isalpha():
17            words = words[1:]16            slova = slova[1:]
18        words = words.lower()17        slova = slova.lower()
19        if words.isalpha() and len(words) >= w:18        if slova.isalpha() and len(slova) >= a2:
20            if words in d:19            if slova in d:
21                d[words] += 120                d[slova] += 1
22            else:21            else:
n23                d[words] = 1n22                d[slova] = 1
23 
24    text = input()24    text = input()
t25 t
26wordsCount = set(d.values())25kol_sl = set(d.values())
27wordsCount = list(wordsCount)26kol_sl = list(kol_sl)
28wordsCount.sort(reverse=True)27kol_sl.sort(reverse=True)
29wordsCount = wordsCount[0:n]28kol_sl = kol_sl[0:a1]
30l = [(v, k) for k, v in d.items() if v in wordsCount]29l = [(v, k) for k, v in d.items() if v in kol_sl]
31l.sort()30l.sort()
32for x in l:31for x in l:
33    print(x[0], ': ', x[1], sep='')32    print(x[0], ': ', x[1], sep='')
3433
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op