#include using namespace std; void quit(int i) { cout << "error " << (i + 1) << '\n'; exit(0); } int main() { ios_base::sync_with_stdio(false); char c; int n, x, y, a = 0, b = 0; cin >> n; for(int i = 0; i < n; ++i) { cin >> x >> c >> y; if((x + y) % 4 == 1 || (x + y) % 4 == 2) swap(x, y); if(x < a || y < b) quit(i); if(x > 11 || y > 11) quit(i); a = x; b = y; } cout << "ok\n"; }