#include using namespace std; int which(int n) { switch (n) { case 1: return 1; case 2: case 3: return 2; case 4: case 5: return 3; case 6: return 4; case 7: return 5; case 8: case 9: return 6; } return 0; } int main(){ string str[9] = { "::::o::::", // 1 "o:::::::o", // 2 "::o:::o::", // 2 "o:::o:::o", // 3 "::o:o:o::", // 3 "o:o:::o:o", // 4 "o:o:o:o:o", // 5 "ooo:::ooo", // 6 "o:oo:oo:o" // 6 }; bool wrong = false; string in = "", tmp; for (int i = 0 ; i < 3 ; i++) { cin >> tmp; if (tmp.length() > 3) { wrong = true; } in += tmp; } if (wrong) { cout << "unknown" << endl; return 0; } for (int i = 0 ; i < 9 ; i++) { if (in == str[i]) { cout << which(i+1) << endl; return 0; } } cout << "unknown" << endl; return 0; }