using System.Collections.Generic; using System.Linq; using System; public class Hello { static void Main() { var s = Console.ReadLine().Trim(); getAns(s); } static void getAns(string s) { var ss = ""; foreach (var x in s) { ss += Convert.ToString(Convert.ToInt32(x.ToString(), 16), 2); } var ans = new int[8]; var ssL = ss.Length; var sub = ssL % 3; var w1 = ss.Substring(0, sub); if (sub != 0) ans[Convert.ToInt32(w1, 2)]++; var p = sub; while (p < ssL) { var ww = ss.Substring(p, 3); ans[Convert.ToInt32(ww, 2)]++; p += 3; } var res = new List(); var ansmax = ans.Max(); for (int i = 0; i < 8; i++) if (ans[i] == ansmax) res.Add(i); Console.WriteLine(string.Join(" ", res)); } }