public class Solution { public static void main(String[] args) throws Exception { BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); // Alphabet String abc = "abcdefghijklmnopqrstuvwxyz"; char[] abcArray = abc.toCharArray(); // Read in strings ArrayList<String> list = new ArrayList<>(); for (int i = 0; i < 10; i++) { String s = reader.readLine(); list.add(s.toLowerCase()); } // write your code here Map<Character , Integer> map = new HashMap<>(); for (int i = 0 ; i < list.size() ; i++){ String s = list.get(i); for (char x : s.toCharArray()) { if (!map.containsKey(x)){ map.put(x, 1); } else map.put(x, map.get(x) + 1); } } for(char x : abcArray) System.out.println(x + " " + map.get(x)); } }