#include <bits/stdc++.h>
using namespace std;
inline char gc() {
  static char buf[100000], *p1 = buf, *p2 = buf;
  return p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 100000, stdin), p1 == p2)
             ? EOF
             : *p1++;
}
inline int read() {
  char c = getchar();
  int tot = 1;
  while ((c < '0' || c > '9') && c != '-') c = getchar();
  if (c == '-') {
    tot = -1;
    c = getchar();
  }
  int sum = 0;
  while (c >= '0' && c <= '9') {
    sum = sum * 10 + c - '0';
    c = getchar();
  }
  return sum * tot;
}
inline void wr(int x) {
  if (x < 0) {
    putchar('-');
    wr(-x);
    return;
  }
  if (x >= 10) wr(x / 10);
  putchar(x % 10 + '0');
}
inline void wrn(int x) {
  wr(x);
  putchar('\n');
}
inline void wri(int x) {
  wr(x);
  putchar(' ');
}
inline void wrn(int x, int y) {
  wri(x);
  wrn(y);
}
inline void wrn(int a, int b, int c) {
  wri(a);
  wrn(b, c);
}
int dui[500055], n, m, b, q, s, t, dis[500055], cur[500055], ans, r;
int num;
struct xx {
  int a, b;
} z[500055];
bool cmp(xx a, xx b) { return a.a < b.a; }
int nedge, Next[500055 * 2], head[500055], to[500055 * 2], lon[500055 * 2];
void add(int a, int b, int c) {
  Next[++nedge] = head[a];
  head[a] = nedge;
  to[nedge] = b;
  lon[nedge] = c;
}
inline int g(int x) { return x + ((x & 1) ? 1 : -1); }
void add_ne(int a, int b, int c) {
  add(a, b, c);
  add(b, a, 0);
}
int bfs() {
  for (int i = (s); i <= (t); i++) dis[i] = 0;
  dui[r = 1] = s;
  dis[s] = 1;
  for (int l = (1); l <= (r); l++) {
    int t1 = dui[l];
    for (int i = head[t1]; i; i = Next[i]) {
      if (!dis[to[i]] && lon[i]) {
        dis[to[i]] = dis[t1] + 1;
        dui[++r] = to[i];
      }
    }
  }
  return dis[t];
}
int dfs(int x, int s) {
  if (x == t) return s;
  for (int &i = cur[x]; i; i = Next[i]) {
    if (lon[i] && dis[to[i]] == dis[x] + 1) {
      int t1 = dfs(to[i], min(lon[i], s));
      if (t1) {
        lon[i] -= t1;
        lon[g(i)] += t1;
        return t1;
      }
    }
  }
  return 0;
}
inline int ch(int l, int r, int x) {
  while (l % 5 != x) l++;
  while (abs(r % 5) != x) r--;
  if (l <= r)
    return ((r - l) / 5 + 1);
  else
    return 0;
}
signed main() {
  n = read();
  b = read();
  q = read();
  for (int i = (1); i <= (q); i++) z[i].a = read(), z[i].b = read();
  q++;
  z[q].a = b;
  z[q].b = n;
  z[++q].a = 0;
  z[q].b = 0;
  sort(z + 1, z + q + 1, cmp);
  for (int i = (2); i <= (q); i++) {
    if (z[i].b > n || z[i].b < z[i - 1].b || (z[i].a >= b && z[i].b < n))
      return puts("unfair"), 0;
    ;
    if (z[i].b == z[i - 1].b || z[i].a > b) continue;
    add_ne(s, i - 1, z[i].b - z[i - 1].b);
    for (int j = (0); j <= (4); j++)
      add_ne(i - 1, q + j, ch(z[i - 1].a + 1, z[i].a, j));
  }
  t = q + 5;
  for (int i = (0); i <= (4); i++) add_ne(q + i, t, n / 5);
  while (bfs()) {
    for (int i = (s); i <= (t); i++) cur[i] = head[i];
    for (int d = dfs(s, 1000000005); d; d = dfs(s, 1000000005)) ans += d;
  }
  if (ans == n)
    puts("fair");
  else
    puts("unfair");
  return 0;
}
