#include <bits/stdc++.h>
using namespace std;
struct Que {
  int p, lm;
} a[20010];
struct Edge {
  int to, old, c;
} e[20010 * 10];
int l[20010], q[20010], n, m, b, t, tot, S, T, pre[20010], ans;
inline int Dfs(int x, int f) {
  int flow = f;
  if (x == T || !f) return (f);
  for (int i = l[x]; i && f; i = e[i].old)
    if (pre[e[i].to] == pre[x] + 1 && e[i].c) {
      int a = Dfs(e[i].to, min(f, e[i].c));
      e[i].c -= a, e[i ^ 1].c += a, f -= a;
    }
  if (flow == f) pre[x] = -1;
  return (flow - f);
}
inline bool Bfs() {
  int h = 1, t = 1;
  q[h] = S;
  memset(pre, -1, sizeof(pre)), pre[S] = 0;
  do {
    int nw = q[h];
    for (int i = l[nw]; i; i = e[i].old)
      if (e[i].c && pre[e[i].to] == -1)
        q[++t] = e[i].to, pre[e[i].to] = pre[nw] + 1;
    h++;
  } while (h <= t);
  return (pre[T] != -1);
}
inline void Add(int x, int y, int z) {
  e[++tot].to = y;
  e[tot].old = l[x], l[x] = tot, e[tot].c = z;
  e[++tot].to = x;
  e[tot].old = l[y], l[y] = tot, e[tot].c = 0;
}
bool Cmp(Que a, Que b) { return (a.p < b.p); }
int main() {
  S = 20006, T = 20007, tot = 1;
  scanf("%d%d%d", &n, &b, &t);
  for (int i = 1; i <= t; i++) scanf("%d%d", &a[i].p, &a[i].lm);
  sort(a + 1, a + 1 + t, Cmp);
  if (a[t].p != b) a[++t].p = b, a[t].lm = n;
  for (int i = 1; i <= t; i++)
    if (a[i].lm < a[i - 1].lm) {
      puts("unfair");
      return (0);
    }
  for (int i = 1; i <= t; i++)
    if (a[i].lm - a[i - 1].lm) {
      int l = a[i - 1].p + 1, r = a[i].p;
      Add(S, i, a[i].lm - a[i - 1].lm);
      for (int j = l; j <= r; j++) Add(i, j + t, 1);
    }
  for (int i = 1; i <= b; i++) Add(i + t, b + t + i % 5 + 1, 1);
  for (int i = 1; i <= 5; i++) Add(b + t + i, T, n / 5);
  while (Bfs()) ans += Dfs(S, 100000000);
  if (ans == n)
    puts("fair");
  else
    puts("unfair");
}
