#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3FFFFFFF;
const long long INF2 = 0x3FFFFFFFFFFFFFFF;
struct Edge {
  int fr, to, c, f, ind;
  Edge(int fr, int to, int c, int f, int ind)
      : fr(fr), to(to), c(c), f(f), ind(ind) {}
};
vector<int> e, h, cnt;
queue<int> q;
vector<bool> act;
vector<vector<Edge>> adj;
int N, B, Q, V;
void addEdge(int u, int v, int c) {
  adj[u].push_back(Edge(u, v, c, 0, adj[v].size()));
  adj[v].push_back(Edge(v, u, 0, 0, adj[u].size() - 1));
}
void enqueue(int u) {
  if (e[u] > 0 && !act[u]) {
    q.push(u);
    act[u] = true;
  }
}
void push(Edge &edge) {
  int u = edge.fr, v = edge.to;
  int d = min(e[u], edge.c - edge.f);
  if (d <= 0 || h[u] <= h[v]) return;
  edge.f += d;
  adj[v][edge.ind].f -= d;
  e[u] -= d;
  e[v] += d;
  enqueue(v);
}
void relabel(int u) {
  cnt[h[u]]--;
  h[u] = INF;
  for (Edge &edge : adj[u])
    if (edge.f < edge.c) h[u] = min(h[u], h[edge.to] + 1);
  cnt[h[u]]++;
}
void gap(int k) {
  for (int i = 0; i < V; i++)
    if (h[i] >= k) {
      cnt[h[i]]--;
      h[i] = max(h[i], V + 1);
      cnt[h[i]]++;
    }
}
void discharge(int u) {
  for (int i = 0; i < adj[u].size() && e[u] > 0; i++) push(adj[u][i]);
  if (e[u] > 0) {
    if (cnt[h[u]] == 1)
      gap(h[u]);
    else
      relabel(u);
    enqueue(u);
  }
}
void no() {
  printf("unfair\n");
  exit(0);
}
int main() {
  scanf("%d%d%d", &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());
  if (Q == 0 || v.back().first < B) v.push_back(pair<int, int>(B, N));
  int m = v.size();
  V = 5 + m + 2;
  e = h = vector<int>(V, 0);
  e[0] = INF;
  h[0] = V;
  cnt = vector<int>(2 * V, 0);
  cnt[V] = 1;
  cnt[0] = V - 1;
  act = vector<bool>(V, false);
  act[0] = act[V - 1] = true;
  adj = vector<vector<Edge>>(V);
  for (int i = 1; i <= 5; i++) addEdge(0, i, N / 5);
  int pre = 0, presize = 0;
  for (int i = 0; i < v.size(); i++) {
    int d = v[i].second - presize;
    if (d < 0 || d > v[i].first - pre) no();
    addEdge(6 + i, V - 1, v[i].second - presize);
    pre = v[i].first;
    presize = v[i].second;
  }
  for (int i = 1; i <= 5; i++)
    for (int j = 0; j < v.size(); j++) {
      int l = j == 0 ? 1 : v[j - 1].first + 1, r = v[j].first;
      int c = 0;
      while (l % 5 != i % 5) l++;
      while (l <= r) c++, l += 5;
      addEdge(i, 6 + j, c);
    }
  for (Edge &edge : adj[0]) push(edge);
  while (!q.empty()) {
    int u = q.front();
    q.pop();
    act[u] = false;
    discharge(u);
  }
  int f = 0;
  for (Edge &edge : adj[0]) f += edge.f;
  printf("%s\n", f == N ? "fair" : "unfair");
  return 0;
}
