import java.util.Scanner; import java.util.*; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); String str = in.nextLine(); ArrayList list = new ArrayList<>(); for(int i = 0;i < str.length();i++){ list.add(str.charAt(i) + ""); } Map<String,...