#include <bits/stdc++.h>
using namespace std;
struct maxflow {
  int to[1000000], nex[1000000], G[1000000], etp, cap[1000000], cur[1000000],
      rev[1000000];
  maxflow() { memset(G, -1, sizeof G); }
  int S, T, dist[1000000];
  queue<int> Q;
  void addedge(int u, int v, int c) {
    to[etp] = v;
    nex[etp] = G[u];
    cap[etp] = c;
    rev[etp] = etp + 1;
    G[u] = etp;
    etp++;
    to[etp] = u;
    nex[etp] = G[v];
    cap[etp] = 0;
    rev[etp] = etp - 1;
    G[v] = etp;
    etp++;
  }
  bool bfs() {
    fill(dist, dist + T + 1, -1);
    for (Q.push(S), dist[S] = 0; !Q.empty(); Q.pop()) {
      int u = Q.front();
      for (int e = G[u]; ~e; e = nex[e]) {
        int v = to[e];
        if (!cap[e]) continue;
        if (dist[v] == -1) {
          dist[v] = dist[u] + 1;
          Q.push(v);
        }
      }
    }
    return (dist[T] != -1);
  }
  int dfs(int u, int a = 1000000) {
    if (u == T || a == 0) return a;
    int F, FF = 0;
    for (int& e = cur[u]; ~e; e = nex[e]) {
      int v = to[e];
      if (cap[e] && dist[v] == dist[u] + 1 && (F = dfs(v, min(a, cap[e])))) {
        FF += F;
        cap[e] -= F;
        cap[rev[e]] += F;
        a -= F;
        if (!a) return FF;
      }
    }
    return FF;
  }
  int flow() {
    int ans = 0;
    while (bfs()) {
      copy(G, G + T + 1, cur);
      ans += dfs(S);
    }
    return ans;
  }
} solve;
int main() {
  int n, b, q;
  cin >> n >> b >> q;
  vector<pair<int, int> > v(q);
  for (int i = 0; i < q; i++) scanf("%d%d", &v[i].first, &v[i].second);
  sort(v.begin(), v.end());
  v.push_back(make_pair(b, n));
  for (int i = 0; i < v.size(); i++) {
    if (v[i].first < v[i].second) return puts("unfair"), 0;
    if (i > 0) {
      if (v[i].first == v[i - 1].first) {
        if (v[i] != v[i - 1]) return puts("unfair"), 0;
      } else if (v[i].second < v[i - 1].second)
        return puts("unfair"), 0;
    }
  }
  solve.S = 0;
  solve.T = b + v.size() + 1 + 5;
  for (int i = 0; i < v.size(); i++) {
    int tmp = i ? v[i].second - v[i - 1].second : v[i].second;
    solve.addedge(0, i + 1, tmp);
    tmp = i ? v[i - 1].first + 1 : 1;
    for (; tmp <= v[i].first; tmp++) solve.addedge(i + 1, v.size() + tmp, 1);
  }
  for (int i = 1; i <= b; i++)
    solve.addedge(v.size() + i, b + v.size() + i % 5 + 1, 1);
  for (int i = 0; i < 5; i++)
    solve.addedge(v.size() + b + i + 1, solve.T, n / 5);
  if (solve.flow() != n)
    puts("unfair");
  else
    puts("fair");
}
