#include <bits/stdc++.h>
using namespace std;
const int MAXN = 20005;
int n, b, q, upto[MAXN], quantity[MAXN];
vector<pair<int, int>> v;
struct Edge {
  int u, v;
  long long cap, flow;
  Edge() {}
  Edge(int u, int v, long long cap) : u(u), v(v), cap(cap), flow(0) {}
};
struct Dinic {
  int N;
  vector<Edge> E;
  vector<vector<int>> g;
  vector<int> d, pt;
  Dinic(int N) : N(N), E(0), g(N), d(N), pt(N) {}
  void AddEdge(int u, int v, long long cap) {
    if (u != v) {
      E.emplace_back(u, v, cap);
      g[u].emplace_back(E.size() - 1);
      E.emplace_back(v, u, 0);
      g[v].emplace_back(E.size() - 1);
    }
  }
  bool BFS(int S, int T) {
    queue<int> q({S});
    fill(d.begin(), d.end(), N + 1);
    d[S] = 0;
    while (!q.empty()) {
      int u = q.front();
      q.pop();
      if (u == T) break;
      for (int k : g[u]) {
        Edge &e = E[k];
        if (e.flow < e.cap && d[e.v] > d[e.u] + 1) {
          d[e.v] = d[e.u] + 1;
          q.emplace(e.v);
        }
      }
    }
    return d[T] != N + 1;
  }
  long long DFS(int u, int T, long long flow = -1) {
    if (u == T || flow == 0) return flow;
    for (int &i = pt[u]; i < g[u].size(); ++i) {
      Edge &e = E[g[u][i]];
      Edge &oe = E[g[u][i] ^ 1];
      if (d[e.v] == d[e.u] + 1) {
        long long amt = e.cap - e.flow;
        if (flow != -1 && amt > flow) amt = flow;
        if (long long pushed = DFS(e.v, T, amt)) {
          e.flow += pushed;
          oe.flow -= pushed;
          return pushed;
        }
      }
    }
    return 0;
  }
  long long MaxFlow(int S, int T) {
    long long total = 0;
    while (BFS(S, T)) {
      fill(pt.begin(), pt.end(), 0);
      while (long long flow = DFS(S, T)) total += flow;
    }
    return total;
  }
};
int main() {
  cin >> n >> b >> q;
  for (int i = 1; i <= q; i++) {
    cin >> upto[i] >> quantity[i];
    v.push_back({upto[i], quantity[i]});
  }
  v.push_back({b, n});
  sort(v.begin(), v.end());
  Dinic d(q + 1 + 1 + 1 + 6);
  int s = 0;
  int t = v.size() + 6 + 1;
  for (int i = 0; i < 5; i++) {
    int pre = 0;
    d.AddEdge(0, i + 1, n / 5);
    for (int j = 0; j < v.size(); j++) {
      int cap = 0;
      for (int k = pre + 1; k <= v[j].first; k++) {
        if (k % 5 == i) cap++;
      }
      pre = v[j].first;
      d.AddEdge(i + 1, 6 + j, cap);
    }
  }
  int pre = 0;
  for (int i = 0; i < v.size(); i++) {
    if (pre > v[i].second) {
      cout << "unfair" << endl;
      return 0;
    }
    d.AddEdge(i + 6, t, max(0, v[i].second - pre));
    pre = v[i].second;
  }
  int flow = d.MaxFlow(s, t);
  if (flow != n) {
    cout << "unfair" << endl;
  } else {
    cout << "fair" << endl;
  }
  return 0;
}
