#include #define REP(i, n) for(int (i)=0;(i)<(n);(i)++) using namespace std; char patt[6][2][10] = { {"::::o::::","::::o::::"}, {"::o:::o::","o:::::::o"}, {"::o:o:o::","o:::o:::o"}, {"o:o:::o:o","o:o:::o:o"}, {"o:o:o:o:o","o:o:o:o:o"}, {"ooo:::ooo","o:oo:oo:o"} }; int main() { char kostka[9]; REP(i, 9){ scanf(" %c ", &(kostka[i])); } REP(i, 6){ REP(j, 2){ int good = true; REP(k, 9){ if (patt[i][j][k] != kostka[k]) { good = false; } } if (good){ cout << i+1 << endl; return 0; } } } cout << "unknown" << endl; }