using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; class TEST{ static void Main(){ Sol mySol =new Sol(); mySol.Solve(); } } class Sol{ public void Solve(){ Three = new List(); for(int i=1;i<=7;i++){ for(int j=0;j<3;j++){ Three.Add(new int[]{i,i+1,i+2}); } } for(int i=1;i<=9;i++){ Three.Add(new int[]{i,i,i}); } int[] cnt = new int[10]; for(int i=0;i ans = new List(); for(int i=1;i<=9;i++){ cnt[i]++; bool chk2 = true; for(int j=1;j<=9;j++) chk2 &= (cnt[j] % 2) == 0 && cnt[j] != 4; if(chk2){ //Console.WriteLine("chk2: i:{0}",i); ans.Add(i); cnt[i]--; continue; } bool chk3 = false; for(int a=0;a 4) chk = false; diff[j] = cnt[j] - c0[j]; if(diff[j] < 0) chk = false; } if(!chk) continue; for(int j=1;j<10;j++){ if(diff[j] == 2) chk3 = true; } /* if(chk3){ Console.WriteLine("i:{0}",i); Console.WriteLine(String.Join(" ",cnt)); Console.WriteLine(String.Join(" ",c0)); Console.WriteLine(String.Join(" ",diff)); } */ } } } } if(chk3){ ans.Add(i); } cnt[i]--; } foreach(var n in ans) Console.WriteLine(n); } List Three; String S; public Sol(){ S = rs(); } static String rs(){return Console.ReadLine();} static int ri(){return int.Parse(Console.ReadLine());} static long rl(){return long.Parse(Console.ReadLine());} static double rd(){return double.Parse(Console.ReadLine());} static String[] rsa(char sep=' '){return Console.ReadLine().Split(sep);} static int[] ria(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>int.Parse(e));} static long[] rla(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>long.Parse(e));} static double[] rda(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>double.Parse(e));} }