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 <img align="middle" class="tex-formula" src="https://espresso.codeforces.com/43442cbfe432682b89a440ef8f3a585940e247f9.png" style="max-width: 100.0%;max-height: 100.0%;"/> elements that give remainder *r* when divided by 5. (That is, there are <img align="middle" class="tex-formula" src="https://espresso.codeforces.com/43442cbfe432682b89a440ef8f3a585940e247f9.png" style="max-width: 100.0%;max-height: 100.0%;"/> elements divisible by 5, <img align="middle" class="tex-formula" src="https://espresso.codeforces.com/43442cbfe432682b89a440ef8f3a585940e247f9.png" style="max-width: 100.0%;max-height: 100.0%;"/> elements of the form 5*k* + 1, <img align="middle" class="tex-formula" src="https://espresso.codeforces.com/43442cbfe432682b89a440ef8f3a585940e247f9.png" style="max-width: 100.0%;max-height: 100.0%;"/> elements of the form 5*k* + 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 *upTo*<sub class="lower-index">*i*</sub>, inclusive, you will find exactly *quantity*<sub class="lower-index">*i*</sub> 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".
The first line contains three integers *n*, *b* and *q* (5 ≤ *n* ≤ *b* ≤ 10<sup class="upper-index">4</sup>, 1 ≤ *q* ≤ 10<sup class="upper-index">4</sup>, *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 *upTo*<sub class="lower-index">*i*</sub> and *quantity*<sub class="lower-index">*i*</sub> (1 ≤ *upTo*<sub class="lower-index">*i*</sub> ≤ *b*, 0 ≤ *quantity*<sub class="lower-index">*i*</sub> ≤ *n*).
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 :-(
10 20 1
10 10
fair
10 20 3
15 10
5 0
10 5
fair
10 20 2
15 3
20 10
unfair
15 27 2
6 4
23 5
unfair
50 7654 4
1273 11
6327 38
1244 3
5208 22
fair
50 7654 4
2899 15
3848 26
2718 12
5511 36
fair
50 7654 4
4881 20
4957 6
4764 50
944 44
unfair
50 6457 1
945 41
fair
500 5000 5
1289 221
694 178
2179 454
160 11
1398 232
fair
500 5000 10
2905 421
573 82
1602 205
4523 491
970 100
3810 453
2553 418
2033 364
1664 245
1924 311
fair
500 5000 20
875 49
73 16
2405 136
811 33
2477 140
3475 303
4640 496
4025 369
4482 440
3475 272
3594 346
3945 368
3807 346
2605 159
4045 382
2861 270
4488 448
1894 61
2388 113
4071 383
unfair
500 5000 50
687 73
3816 389
4333 436
1660 177
2238 231
2936 312
899 96
541 55
4218 425
4512 457
1302 132
2322 239
688 73
4423 449
2765 284
3755 382
4192 422
2718 277
2254 231
1354 140
4891 490
2722 277
344 35
4774 479
988 101
2530 256
3679 375
3258 341
1870 201
1391 146
643 68
1040 105
2607 266
906 97
4790 480
2390 245
3101 326
2616 267
1064 107
1091 110
1735 187
2434 247
3887 397
1335 137
2073 219
450 45
480 47
3519 359
157 16
4316 434
fair
15 40 3
2 0
13 9
4 1
fair
15 41 3
16 8
14 2
40 9
unfair
15 40 3
8 0
38 14
28 9
fair
15 40 3
1 9
24 0
35 7
unfair
15 40 2
23 4
36 7
unfair
15 41 2
19 12
2 0
fair
15 40 2
35 13
36 14
fair
15 40 2
15 4
24 4
fair
5 6 2
4 4
5 4
unfair
10 20 4
3 3
5 3
9 7
17 7
unfair
5 10 3
2 1
5 4
7 4
unfair
5 30 10
1 1
5 1
6 2
10 2
11 3
15 3
16 4
20 4
21 5
30 5
unfair
10 13 2
3 3
5 4
unfair
5 10 3
1 1
5 1
9 5
unfair
10 14 2
4 4
5 4
unfair
I = lambda: [int(i) for i in input().split()]

n, b, m = I()
sz = [0] * 32
a = [(0, 0)] + sorted([I() for _ in range(m)]) + [(b, n)]
def solve():
    for S in range(32):
        sz[S] = sz[S >> 1] + (S & 1)
        sm = 0
        for j in range(1, m + 1):
            l = a[j-1][0] + 1
            r = a[j][0]
            w = a[j][1] - a[j-1][1]
            if w < 0: return "unfair"
            sm += min(sum(S>>(i%5)&1 for i in range(l, r+1)), w)
        if sm < n/5 * sz[S]: return "unfair"
    return "fair"

print(solve())