#include <bits/stdc++.h>
using namespace std;

const int T = 100;
const int dx[8] = {-1, -1, -1, 0, 0, 1, 1, 1};
const int dy[8] = {-1, 0, 1, -1, 1, -1, 0, 1};

int level, k;
vector<pair<int, int>> live;
int sz, tag1[301][301], tag2[301][301];

void msg(string s) {
    cout << s << '\n';
    exit(0);
}

int main() {
    cin >> level;
    if (level < 1 || level > 3) msg("level must >= 1 and <= 3");
    if (level == 1) live = {{20, 20}, {20, 21}, {21, 20}, {21, 21}};
    if (level == 2) live = {{20, 20}, {20, 21}, {21, 20}, {21, 21}, {23, 23}, {23, 24}, {24, 23}, {24, 24}};
    if (level == 3) live = {{20, 20}, {20, 21}, {21, 20}, {22, 22}, {23, 21}, {23, 22}};

    cin >> k;
    if (k < 0 || k > 100) msg("k must >= 0 and <= 100");
    set<pair<int, int>> s;
    for (int i = 1; i <= k; i++) {
        int x, y;
        cin >> x >> y;
        if (x < 0 || x > 9 || y < 0 || y > 9) msg("x, y must >= 0 and <= 9");
        if (s.count({x, y})) msg("repeated x, y");
        s.emplace(x, y);
        live.emplace_back(x, y);
    }

    for (int t = 1; t <= T && live.size(); t++) {
        vector<pair<int, int>> cand, nxt;
        sz++;
        for (auto [x, y] : live) {
            tag1[x + 100][y + 100] = tag2[x + 100][y + 100] = sz;
            cand.emplace_back(x, y);
        }
        for (auto [x, y] : live) for (int i = 0; i < 8; i++) if (tag2[x + dx[i] + 100][y + dy[i] + 100] != sz) {
            cand.emplace_back(x + dx[i], y + dy[i]);
            tag2[x + dx[i] + 100][y + dy[i] + 100] = sz;
        }
        for (auto [x, y] : cand) {
            int cnt = 0;
            for (int i = 0; i < 8 && cnt <= 3; i++) cnt += (tag1[x + dx[i] + 100][y + dy[i] + 100] == sz);
            if (tag1[x + 100][y + 100] == sz) {
                if (cnt == 2 || cnt == 3) nxt.emplace_back(x, y);
            } else {
                if (cnt == 3) nxt.emplace_back(x, y);
            }
        }
        live = nxt;
    }

    if (live.size() == 0) msg("accepted");
    else msg("wrong answer");
}