import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.Scanner; // 注意类名必须为 Main, 不要有任何 package xxx 信息 public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); while (in.hasNext()) { Map<String, Integer> map = new LinkedHashMap<>(); String a = in.nextLine(); for (int i = 0; i < a.length(); i++) { if (map.containsKey(a.substring(i, i + 1))) { int temp = map.get(a.substring(i, i + 1)); map.put(a.substring(i, i + 1), temp + 1); } else { map.put(a.substring(i, i + 1), 1); } } for (String key : map.keySet()) { if (map.get(key) > 1) { int[] arry = new int[map.get(key)]; int j = 0; for (int i = 0; i < a.length(); i++) { if (key.equals(a.substring(i, i + 1)))arry[j++] = i; } for (int i = 0; i < map.get(key) - 1; i++) { System.out.print(key + ":" + arry[i] + ","); } System.out.println(key + ":" + arry[map.get(key) - 1]); } } } } }