#include <bits/stdc++.h>
using namespace std;
using pii = pair<int, int>;
const int SZ = 10000 + 10;
struct Edge {
  int v, cap, rev;
  Edge(int v = 0, int cap = 0, int rev = 0) : v(v), cap(cap), rev(rev) {}
};
int g_n, g_mx, g_q, g_ty;
bool vb[SZ];
vector<int> vi_cnt;
vector<pii> vpii_lr;
vector<vector<Edge>> vve;
void input() {
  g_ty = 5;
  memset(vb, 0, sizeof(vb));
  vpii_lr.clear(), vve.clear(), vve.resize(g_mx + 10);
  for (int i = 0, x, vi_cnt; i < g_q; ++i) {
    scanf(" %d %d", &x, &vi_cnt);
    vpii_lr.emplace_back(x, vi_cnt);
  }
}
void add_edge(int u, int v, int cap) {
  vve[u].emplace_back(v, cap, vve[v].size());
  vve[v].emplace_back(u, 0, vve[u].size() - 1);
}
int dfs(int u, int t, int f) {
  if (u == t) return f;
  vb[u] = true;
  for (Edge &e : vve[u]) {
    if (!vb[e.v] && e.cap > 0) {
      int d = dfs(e.v, t, min(f, e.cap));
      if (d > 0) {
        e.cap -= d;
        vve[e.v][e.rev].cap += d;
        return d;
      }
    }
  }
  return 0;
}
void solve() {
  sort(vpii_lr.begin(), vpii_lr.end());
  vpii_lr.erase(unique(vpii_lr.begin(), vpii_lr.end()), vpii_lr.end());
  g_q = vpii_lr.size();
  int mxvi_cnt = 0;
  for (int i = 0; i < g_q; ++i) {
    if (mxvi_cnt > vpii_lr[i].second) {
      printf("unfair\n");
      return;
    } else {
      mxvi_cnt = vpii_lr[i].second;
    }
  }
  for (int i = 2; i < g_ty + 2; ++i) {
    add_edge(0, i, g_n / g_ty);
  }
  int p = g_ty + 2, l = 1, r = 0, ct = 0;
  for (int i = 0; i < g_q; ++i) {
    r = vpii_lr[i].first;
    ct = vpii_lr[i].second - ct;
    if (r >= l && ct) {
      vi_cnt.clear();
      vi_cnt.resize(g_ty);
      for (int j = l; j <= r; ++j) {
        ++vi_cnt[j % g_ty];
      }
      for (int j = 0; j < g_ty; ++j) {
        add_edge(j + 2, p, vi_cnt[j]);
      }
      add_edge(p, 1, ct);
      ++p;
    }
    l = vpii_lr[i].first + 1, ct = vpii_lr[i].second;
  }
  l = vpii_lr.back().first + 1, r = g_mx;
  ct = g_n - vpii_lr.back().second;
  vi_cnt.clear();
  vi_cnt.resize(g_ty);
  for (int j = l; j <= r; ++j) {
    ++vi_cnt[j % g_ty];
  }
  for (int j = 0; j < g_ty; ++j) {
    add_edge(j + 2, p, vi_cnt[j]);
  }
  add_edge(p, 1, ct);
  int flow = 0;
  while (true) {
    memset(vb, 0, sizeof(vb));
    int f = dfs(0, 1, INT_MAX);
    if (f == 0) break;
    flow += f;
  }
  if (flow == g_n) {
    puts("fair");
  } else {
    puts("unfair");
  }
}
int main() {
  while (cin >> g_n >> g_mx >> g_q) {
    input();
    solve();
  }
  return 0;
}
