import java.util.Scanner; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); char[] s = sc.next().toCharArray(); sc.close(); StringBuilder sb = new StringBuilder(); for (int i = 0; i < s.length; i++) { int a = Integer.parseInt(String.valueOf(s[i]), 16); sb.append(Integer.toBinaryString(a)); } int[] cnt = new int[8]; int start = sb.length() % 3; if (start != 0) { int a = Integer.parseInt(sb.substring(0, start), 2); cnt[a]++; } for (int i = start; i < sb.length(); i += 3) { int a = Integer.parseInt(sb.substring(i, i + 3), 2); cnt[a]++; } int max = 0; for (int i = 0; i < cnt.length; i++) { max = Math.max(max, cnt[i]); } StringBuilder sb2 = new StringBuilder(); for (int i = 0; i < cnt.length; i++) { if (cnt[i] == max) { sb2.append(i).append(' '); } } sb2.deleteCharAt(sb2.length() - 1); System.out.println(sb2.toString()); } }