fork download
  1. n, l = int(input()), 0
  2. table = [0] * 26
  3. while n > 0:
  4. s = input()
  5. l = l + len(s)
  6. s = s.upper()
  7. for c in s:
  8. index = ord(c)
  9. if 65 <= index <= 90:
  10. table[index - 65] = table[index - 65] + 1
  11. n = n - 1
  12. while l > 0:
  13. index = 0
  14. for fre in table:
  15. if fre == l:
  16. print(chr(index + 65), table[index])
  17. index = index + 1
  18. l = l - 1
Success #stdin #stdout 0.03s 9784KB
stdin
2
To be or not to be.
I think, therefore I am.
stdout
E 5
O 5
T 5
I 3
R 3
B 2
H 2
N 2
A 1
F 1
K 1
M 1