#include <bits/stdc++.h>
using namespace std;
int que[10055];
template <class T>
struct Edge {
  int to, next;
  T cap, flow;
  Edge(int to, int next, T cap, T flow = 0) {
    this->to = to;
    this->next = next;
    this->cap = cap;
    this->flow = flow;
  }
};
template <class T>
struct Dinic {
  const int nodes, inf;
  int source, sink, lvl[10055], nodeEnd[10055];
  vector<Edge<T> > edgeList;
  Dinic(int n) : nodes(n), inf(numeric_limits<T>::max() / 4) {
    fill(nodeEnd, nodeEnd + n, -1);
  }
  void addEdge(int u, int v, T cap = 1) {
    edgeList.push_back(Edge<T>(v, nodeEnd[u], cap));
    nodeEnd[u] = (int)edgeList.size() - 1;
    edgeList.push_back(Edge<T>(u, nodeEnd[v], 0));
    nodeEnd[v] = (int)edgeList.size() - 1;
  }
  bool createLevel() {
    fill(lvl, lvl + nodes, -1);
    int qs = 0, qt = 0;
    que[qs] = source, lvl[source] = 0;
    while (qs <= qt && lvl[sink] == -1) {
      int nd = que[qs++], ch;
      for (int i = nodeEnd[nd]; i != -1; i = edgeList[i].next)
        if (lvl[ch = edgeList[i].to] == -1 &&
            edgeList[i].cap > edgeList[i].flow)
          lvl[ch] = lvl[nd] + 1, que[++qt] = ch;
    }
    return lvl[sink] != -1;
  }
  T blockingFlow(int nd, T flow) {
    if (nd == sink) return flow;
    int ch;
    T pflow = flow;
    for (int i = nodeEnd[nd]; i != -1; i = edgeList[i].next)
      if (lvl[ch = edgeList[i].to] == lvl[nd] + 1) {
        T pushed =
            blockingFlow(ch, min(pflow, edgeList[i].cap - edgeList[i].flow));
        pflow -= pushed;
        edgeList[i].flow += pushed;
        edgeList[i ^ 1].flow -= pushed;
        if (!pflow) break;
      }
    return flow - pflow;
  }
  T maxFlow(int src, int snk) {
    for (int i = 0; i < (int)edgeList.size(); i++) edgeList[i].flow = 0;
    source = src, sink = snk;
    T tot = 0;
    while (createLevel()) tot += blockingFlow(source, inf);
    return tot;
  }
};
int N, B, Q, sum[10055];
vector<pair<int, int> > vec;
map<int, int> mp;
int main() {
  scanf("%d%d", &N, &B);
  scanf("%d", &Q);
  while (Q--) {
    int u, q;
    scanf("%d%d", &u, &q);
    vec.push_back(make_pair(u, q));
    if (mp.find(u) != mp.end() && mp[u] != q) {
      puts("unfair");
      return 0;
    }
  }
  if (mp.find(B) == mp.end()) vec.push_back(make_pair(B, N));
  sort(vec.begin(), vec.end());
  int n = 7 + vec.size();
  Dinic<int> dinic(n);
  for (int i = 0; i < (int)5; i++) {
    dinic.addEdge(0, (i) ? i : 5, N / 5);
    memset(sum, 0, sizeof(sum));
    for (int j = 1; j < (int)B + 1; j++) {
      sum[j] = sum[j - 1];
      if (j % 5 == i) sum[j]++;
    }
    for (int j = 0; j < (int)vec.size(); j++) {
      int r = sum[vec[j].first], l = 0;
      if (j) l = sum[vec[j - 1].first];
      if (r - l > 0) dinic.addEdge((i) ? i : 5, 6 + j, r - l);
    }
  }
  for (int j = 0; j < (int)vec.size(); j++) {
    int r = vec[j].second, l = 0;
    if (j) l = vec[j - 1].second;
    if (r - l < 0) {
      puts("unfair");
      return 0;
    }
    if (r - l > 0) dinic.addEdge(6 + j, n - 1, r - l);
  }
  int f = dinic.maxFlow(0, n - 1);
  if (f < N)
    puts("unfair");
  else
    puts("fair");
}
