Limak is a grizzly bear. He is big and dreadful. You were chilling in the forest when you suddenly met him. It's very unfortunate for you. He will eat all your cookies unless you can demonstrate your mathematical skills. To test you, Limak is going to give you a puzzle to solve.

It's a well-known fact that Limak, as every bear, owns a set of numbers. You know some information about the set:

  * The elements of the set are distinct positive integers. 
  * The number of elements in the set is n. The number n is divisible by 5. 
  * All elements are between 1 and b, inclusive: bears don't know numbers greater than b. 
  * For each r in {0, 1, 2, 3, 4}, the set contains exactly <image> elements that give remainder r when divided by 5. (That is, there are <image> elements divisible by 5, <image> elements of the form 5k + 1, <image> elements of the form 5k + 2, and so on.) 



Limak smiles mysteriously and gives you q hints about his set. The i-th hint is the following sentence: "If you only look at elements that are between 1 and upToi, inclusive, you will find exactly quantityi such elements in my set."

In a moment Limak will tell you the actual puzzle, but something doesn't seem right... That smile was very strange. You start to think about a possible reason. Maybe Limak cheated you? Or is he a fair grizzly bear?

Given n, b, q and hints, check whether Limak can be fair, i.e. there exists at least one set satisfying the given conditions. If it's possible then print ''fair". Otherwise, print ''unfair".

Input

The first line contains three integers n, b and q (5 ≤ n ≤ b ≤ 104, 1 ≤ q ≤ 104, n divisible by 5) — the size of the set, the upper limit for numbers in the set and the number of hints.

The next q lines describe the hints. The i-th of them contains two integers upToi and quantityi (1 ≤ upToi ≤ b, 0 ≤ quantityi ≤ n).

Output

Print ''fair" if there exists at least one set that has all the required properties and matches all the given hints. Otherwise, print ''unfair".

Examples

Input

10 20 1
10 10


Output

fair


Input

10 20 3
15 10
5 0
10 5


Output

fair


Input

10 20 2
15 3
20 10


Output

unfair

Note

In the first example there is only one set satisfying all conditions: {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}.

In the second example also there is only one set satisfying all conditions: {6, 7, 8, 9, 10, 11, 12, 13, 14, 15}.

Easy to see that there is no set satisfying all conditions from the third example. So Limak lied to you :-(
#include <bits/stdc++.h>
int read() {
  int ans = 0, c, f = 1;
  while (!isdigit(c = getchar()))
    if (c == '-') f *= -1;
  do ans = ans * 10 + c - '0';
  while (isdigit(c = getchar()));
  return ans * f;
}
const int N = 10050;
const int K = 5;
inline int query(int l, int r, int t) {
  return (r + K - t) / K - (l - 1 + K - t) / K;
}
std::pair<int, int> Q[N];
int main() {
  int n = read(), b = read(), q = read();
  for (int i = 0; i < q; ++i) {
    Q[i].first = read();
    Q[i].second = read();
  }
  Q[q++] = std::make_pair(0, 0);
  Q[q++] = std::make_pair(b, n);
  std::sort(Q, Q + q);
  for (int i = 1; i < q; ++i)
    if (Q[i].second < Q[i - 1].second ||
        Q[i].second - Q[i - 1].second > Q[i].first - Q[i - 1].first) {
      puts("unfair");
      return 0;
    }
  for (int S = 1; S < (1 << K); ++S) {
    int t = n;
    for (int i = 1; i < q; ++i) {
      int l = Q[i - 1].first + 1, r = Q[i].first,
          s = Q[i].second - Q[i - 1].second;
      int b = 0;
      for (int j = 0; j < K; ++j)
        if ((S >> j) & 1) b += query(l, r, j);
      if (b - s < 0) t += b - s;
    }
    int sx = 0;
    for (int j = 0; j < K; ++j)
      if ((S >> j) & 1) ++sx;
    sx *= n / 5;
    if (sx > t) {
      puts("unfair");
      return 0;
    }
  }
  puts("fair");
  return 0;
}
