#include <bits/stdc++.h>
using namespace std;
const int INF = 1 << 25;
struct Dinic {
  struct edge {
    int t, c, r;
    edge(int _t, int _c, int _r) : t(_t), c(_c), r(_r) {}
  };
  vector<int> l, nxt;
  vector<vector<edge>> e;
  Dinic(int n) : e(n + 1) {}
  void add(int u, int v, int w) {
    e[u].push_back(edge(v, w, e[v].size()));
    e[v].push_back(edge(u, 0, e[u].size() - 1));
  }
  edge& rev(const edge& E) { return e[E.t][E.r]; }
  bool bfs(int s, int t) {
    l.assign(e.size(), INF);
    l[s] = 1;
    queue<int> Q;
    for (Q.push(s); !Q.empty(); Q.pop()) {
      s = Q.front();
      for (const edge& E : e[s])
        if (E.c > 0 && l[E.t] > l[s] + 1) {
          l[E.t] = l[s] + 1;
          Q.push(E.t);
        }
    }
    return l[t] < INF;
  }
  int dfs(int s, int t, int num = INF) {
    if (s == t || num == 0) return num;
    int ans = 0;
    for (int& i = nxt[s]; num && i<(int)e[s].size(); i += num> 0) {
      edge& E = e[s][i];
      if (E.c > 0 && l[s] + 1 == l[E.t]) {
        int tmp = dfs(E.t, t, min(num, E.c));
        rev(E).c += tmp, ans += tmp;
        E.c -= tmp, num -= tmp;
      }
    }
    return ans > 0 ? ans : l[s] = 0;
  }
  int operator()(int s, int t) {
    int ans = 0;
    for (; bfs(s, t); ans += dfs(s, t)) nxt.assign(e.size(), 0);
    return ans;
  }
};
bool solve(const vector<pair<int, int>>& a, int n, int m, int k) {
  int s = 0;
  int t = n + m + 6;
  Dinic D(t);
  for (int i = 1; i <= m; i++) {
    if (a[i].second < a[i - 1].second)
      return false;
    else if (a[i].second - a[i - 1].second > a[i].first - a[i - 1].first)
      return false;
    for (int j = a[i - 1].first + 1; j <= a[i].first; j++) D.add(n + i, j, 1);
    D.add(s, n + i, a[i].second - a[i - 1].second);
  }
  for (int i = 1; i <= n; i++) D.add(i, n + m + i % 5 + 1, 1);
  for (int i = 1; i <= 5; i++) D.add(n + m + i, t, k / 5);
  return D(s, t) == k;
}
int main() {
  int n, m, k;
  scanf("%d%d%d", &k, &n, &m);
  vector<pair<int, int>> a;
  a.push_back({0, 0});
  a.push_back({n, k});
  for (int i = 0; i < m; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    a.push_back({x, y});
  }
  sort(a.begin(), a.end());
  printf(solve(a, n, m + 1, k) ? "fair\n" : "unfair\n");
}
