#include <bits/stdc++.h>
#pragma warning(disable : 4996)
using namespace std;
int n, m;
vector<pair<int, int> > a;
int q;
map<int, int> mq;
vector<int> upTo, quantity;
struct EDGE {
  int s, e, f;
  EDGE() {}
  EDGE(int s, int e, int f) : s(s), e(e), f(f) {}
};
vector<EDGE> edges;
vector<int> edge[100000];
int source, sink;
int getcnt(int x, int r) {
  if (x < r) return 0;
  x = max(0, x - r);
  return x / 5 + !!r;
}
void addedge(int s, int e, int f) {
  int x = edges.size();
  edges.emplace_back(s, e, f);
  edges.emplace_back(e, s, 0);
  edge[s].push_back(x);
  edge[e].push_back(x + 1);
}
int num[100000];
void bfs() {
  int i, j;
  vector<int> q;
  fill(num, num + sink + 1, -1);
  num[source] = 0;
  q.push_back(source);
  for (i = 0; i < q.size(); i++) {
    int now = q[i];
    for (auto e : edge[now]) {
      EDGE ed = edges[e];
      if (!ed.f || num[ed.e] != -1) continue;
      num[ed.e] = num[now] + 1;
      q.push_back(ed.e);
    }
  }
}
int back(int now, int f) {
  if (now == sink) return f;
  for (auto e : edge[now]) {
    EDGE &ed = edges[e];
    if (!ed.f || num[ed.e] != num[now] + 1) continue;
    if (int flow = back(ed.e, min(f, ed.f))) {
      ed.f -= flow;
      edges[e ^ 1].f += flow;
      return flow;
    }
  }
  num[now] = -1;
  return 0;
}
int main() {
  int i, j, k;
  cin >> n >> m >> q;
  upTo.resize(q), quantity.resize(q);
  for (i = 0; i < q; i++) {
    scanf("%d%d", &upTo[i], &quantity[i]);
  }
  for (i = 0; i < q; i++) {
    if (mq.count(upTo[i])) {
      if (mq[upTo[i]] != quantity[i]) return !printf("unfair");
      continue;
    }
    mq[upTo[i]] = quantity[i];
  }
  for (auto e : mq) a.push_back(e);
  sort((a).begin(), (a).end());
  q = a.size();
  for (i = q - 1; i >= 1; i--) a[i].second -= a[i - 1].second;
  int sum = 0;
  for (i = 0; i < q; i++) sum += a[i].second;
  if (a[q - 1].first != m) {
    a.emplace_back(m, n - sum);
    q++;
  }
  for (i = 0; i < q; i++)
    if (a[i].second < 0) return !printf("unfair");
  sink = q + 6;
  int last = 0;
  for (i = 0; i < 5; i++) addedge(q + 1 + i, sink, n / 5);
  for (i = 0; i < q; i++) {
    addedge(source, i + 1, a[i].second);
    for (j = 0; j < 5; j++) {
      int res = getcnt(a[i].first, j) - getcnt(last, j);
      addedge(i + 1, q + 1 + j, getcnt(a[i].first, j) - getcnt(last, j));
    }
    last = a[i].first;
  }
  int tot = 0;
  while (1) {
    bfs();
    if (num[sink] == -1) break;
    while (int flow = back(source, 0x3f3f3f3f)) tot += flow;
  }
  printf(tot == n ? "fair" : "unfair");
  return 0;
}
