#include <bits/stdc++.h>
const int32_t MAX_N = 1e4 + 25;
const int32_t MOD_CNT = 5;
const int32_t INF = 1e9;
struct Vertex;
struct Edge {
  Edge *rev;
  Vertex *to;
  int32_t cap;
  Edge() : cap(0) {}
};
struct Vertex {
  int32_t ind;
  std::vector<Edge> edges;
  int32_t dist;
  void add_edge(Vertex *to, int32_t cap) {
    edges.push_back(Edge());
    to->edges.push_back(Edge());
    edges.back().cap = cap;
    edges.back().to = to;
    edges.back().rev = &to->edges.back();
    to->edges.back().cap = 0;
    to->edges.back().to = this;
    to->edges.back().rev = &edges.back();
  }
};
Vertex graph[MAX_N];
Vertex *source, *sink;
int32_t setSize, maxElem;
int32_t qCnt;
std::pair<int32_t, int32_t> hints[MAX_N];
inline int32_t vert_cnt() { return qCnt + 2 + MOD_CNT + 1; }
void input() {
  scanf("%i %i %i", &setSize, &maxElem, &qCnt);
  for (int32_t i = 0; i < qCnt; i++) {
    scanf("%i %i", &hints[i].first, &hints[i].second);
  }
  sort(hints, hints + qCnt);
}
bool build_graph() {
  source = &graph[MOD_CNT];
  sink = &graph[MOD_CNT + 1];
  source->edges.reserve(MOD_CNT);
  sink->edges.reserve(qCnt + 1);
  for (int32_t i = 0; i < MOD_CNT; i++) {
    source->add_edge(&graph[i], setSize / 5);
    graph[i].edges.reserve(qCnt + 2);
  }
  int32_t lastNum = 0, lastCnt = 0;
  int32_t cap[5];
  hints[qCnt].first = maxElem;
  hints[qCnt].second = setSize;
  for (int32_t i = 0; i <= qCnt; i++) {
    if (hints[i].second < lastCnt) {
      return false;
    } else if (hints[i].second == lastCnt) {
      lastNum = hints[i].first;
      continue;
    }
    int32_t div = (hints[i].first - lastNum) / MOD_CNT;
    for (int32_t j = 0; j < MOD_CNT; j++) {
      cap[j] = div;
    }
    int32_t str = lastNum + div * 5 + 1;
    for (int32_t j = str; j <= hints[i].first; j++) {
      cap[j % MOD_CNT]++;
    }
    graph[i + 7].edges.reserve(MOD_CNT + 1);
    graph[i + 7].add_edge(sink, hints[i].second - lastCnt);
    for (int32_t j = 0; j < MOD_CNT; j++) {
      graph[j].add_edge(&graph[i + 7], cap[j]);
    }
    lastNum = hints[i].first;
    lastCnt = hints[i].second;
  }
  return true;
}
void print_graph() {
  for (int32_t i = 0; i < vert_cnt(); i++) {
    graph[i].ind = i + 1;
  }
  for (int32_t i = 0; i < vert_cnt(); i++) {
    printf("%i  D: %i\n", i + 1, graph[i].dist);
    for (Edge e : graph[i].edges) {
      printf("(%i %i) ", e.to->ind, e.cap);
    }
    printf("\n");
  }
}
bool calc_dist() {
  for (int32_t i = 0; i < vert_cnt(); i++) {
    graph[i].dist = -1;
  }
  sink->dist = 0;
  std::queue<Vertex *> next;
  next.push(sink);
  while (!next.empty()) {
    Vertex *cur = next.front();
    next.pop();
    for (Edge e : cur->edges) {
      if ((e.to->dist < 0) && (e.rev->cap > 0)) {
        e.to->dist = cur->dist + 1;
        next.push(e.to);
      }
    }
  }
  return source->dist > 0;
}
int32_t push_flow(Vertex *cur, int32_t cap) {
  if (cur == sink) {
    return cap;
  }
  for (Edge &e : cur->edges) {
    if ((e.cap == 0) || (e.to->dist != cur->dist - 1)) {
      continue;
    }
    int32_t curCap = (cap < e.cap) ? cap : e.cap;
    int32_t f = push_flow(e.to, curCap);
    if (f) {
      e.cap -= f;
      e.rev->cap += f;
      return f;
    }
  }
  cur->dist = -42;
  return 0;
}
int main() {
  input();
  if (not build_graph()) {
    printf("unfair\n");
    return 0;
  }
  int32_t flow = 0;
  while (calc_dist()) {
    while (true) {
      int32_t cur = push_flow(source, INF);
      if (!cur) {
        break;
      }
      flow += cur;
    }
  }
  printf("%s\n", (flow == setSize) ? "fair" : "unfair");
}
