import collections


text = 'abba com mother bill mother com abba dog abba mother com'
array = text.split()
counter = collections.Counter()

for n in range(len(array) - 2):
    three = ' '.join(sorted(array[n:n + 3]))
    counter[three] += 1

print(counter.most_common(1))
