#include <bits/stdc++.h>
template <class T>
bool chmax(T &a, const T &b) {
  return (a < b) ? (a = b, 1) : 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  return (b < a) ? (a = b, 1) : 0;
}
using namespace std;
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
using pii = pair<int, int>;
int n, b, q;
vector<pii> hint;
int main(void) {
  scanf("%d%d%d", &n, &b, &q);
  hint.emplace_back(pii(0, 0));
  hint.emplace_back(pii(b, n));
  for (int i = int(0); i < int(q); ++i) {
    int idx, num;
    scanf("%d%d", &idx, &num);
    hint.emplace_back(pii(idx, num));
  }
  sort(begin(hint), end(hint));
  bool ok = true;
  for (int i = int(0); i < int(int(hint.size()) - 1); ++i) {
    if (hint[i].first == hint[i + 1].first &&
        hint[i].second != hint[i + 1].second)
      ok = false;
    if (hint[i + 1].second - hint[i].second < 0) ok = false;
  }
  for (int mask = int(1); mask < int(32); ++mask) {
    const int limit = n / 5 * __builtin_popcount(mask);
    int cnt = 0;
    for (int i = int(0); i < int(int(hint.size()) - 1); ++i) {
      int num = hint[i + 1].second - hint[i].second;
      int cur = hint[i].first + 1;
      while (num && cur <= hint[i + 1].first) {
        if (mask & (1LL << (cur % 5))) cnt++, num--;
        cur++;
      }
    }
    if (cnt < limit) ok = false;
  }
  if (ok)
    puts("fair");
  else
    puts("unfair");
  return 0;
}
