using System; using System.Collections.Generic; using System.Collections; using System.Collections.Specialized; using System.Linq; using System.Text; using System.IO; using System.Reflection; using static System.Math; using System.Numerics; static class Program{ const int mod=(int)1e9+7; const double eps=1e-11; static void Main(){ Sc sc=new Sc(); var n=sc.I; var t=new string[]{"o-o","oo-","-oo","-o--","--o-","ooo"}; Ac ac=new Ac(t,'-','x'); StringBuilder sb=new StringBuilder(); for(int i = 0;i{ ans='O'; return false; }); if(ans=='X'){ for(int j = 0,k=-1;j li=new List(); public Nd sx; public List stl=new List(); public int c,l=0,n; public bool b=false; public Nd(int c,int l){this.c=c-o;this.l=l;} } public Ac(string[] t,int a,int z){ n=z-a+1; o=a; root=new Nd(a-1,0); for(int i = 0;i(); for(int i = 0;i0){ var e=qu.Dequeue(); for(int i = 0;i0){e.li[i].stl.AddRange(e.li[i].sx.stl);} if(e.li[i].b){qu.Enqueue(e.li[i]);} e.li[i].n=p; } } } public void Match(string t,bool bo,Action f){ var e=root; for(int i = 0;i f){ var e=root; for(int i = 0;i(int n,Func f){var a=new T[n];for(int i=0;i(int n,Func f){var a=new T[n];for(int i=0;i(int n,Func f){var a=new T[n];for(int i=0;i(int n,Func f){var a=new T[n];for(int i=0;i