public class student implements Comparable{
String name;
String age;
public student() {
}
@Override
public int compareTo(Object o) {
student o1 = (student)o;
int num = this.name.compareTo(o1.name);
int num1 = num == 0 ? this.age.compareTo(o1.age) : num;
return num1;
}
public class Treemap_class {
public static void main(String[] args) {
TreeMap<student, String> map = new TreeMap<>(new Comparator<student>() {
@Override
public int compare(student o1, student o2) {
int num = o1.name.compareTo(o2.name);
int num1 = num == 0 ? -o1.age.compareTo(o2.age) : num;
return num1;
}
});
public class Treemap_class {
public static void main(String[] args) {
Scanner as = new Scanner(System.in);
String str = as.nextLine();
Map<Character, Integer> map = new HashMap<>();
for (int i = 0; i < str.length(); i++) {
Character s = new Character(str.charAt(i));
if(map.get(s) != null){
Integer a = map.get(s) + 1;
map.put(s, a);
}
else
map.put(s, 1);
}
for (Character s:map.keySet()){
System.out.println(s + " " +map.get(s));
}