Is it rated?

Here it is. The Ultimate Question of Competitive Programming, Codeforces, and Everything. And you are here to answer it.

Another Codeforces round has been conducted. No two participants have the same number of points. For each participant, from the top to the bottom of the standings, their rating before and after the round is known.

It's known that if at least one participant's rating has changed, then the round was rated for sure.

It's also known that if the round was rated and a participant with lower rating took a better place in the standings than a participant with higher rating, then at least one round participant's rating has changed.

In this problem, you should not make any other assumptions about the rating system.

Determine if the current round is rated, unrated, or it's impossible to determine whether it is rated of not.
The first line contains a single integer *n* (2 ≤ *n* ≤ 1000) — the number of round participants.

Each of the next *n* lines contains two integers *a*<sub class="lower-index">*i*</sub> and *b*<sub class="lower-index">*i*</sub> (1 ≤ *a*<sub class="lower-index">*i*</sub>, *b*<sub class="lower-index">*i*</sub> ≤ 4126) — the rating of the *i*-th participant before and after the round, respectively. The participants are listed in order from the top to the bottom of the standings.
In the first example, the ratings of the participants in the third and fifth places have changed, therefore, the round was rated.

In the second example, no one's rating has changed, but the participant in the second place has lower rating than the participant in the fourth place. Therefore, if the round was rated, someone's rating would've changed for sure.

In the third example, no one's rating has changed, and the participants took places in non-increasing order of their rating. Therefore, it's impossible to determine whether the round is rated or not.
6
3060 3060
2194 2194
2876 2903
2624 2624
3007 2991
2884 2884
rated
4
1500 1500
1300 1300
1200 1200
1400 1400
unrated
5
3123 3123
2777 2777
2246 2246
2246 2246
1699 1699
maybe
2
1 1
1 1
maybe
2
4126 4126
4126 4126
maybe
10
446 446
1331 1331
3594 3594
1346 1902
91 91
3590 3590
2437 2437
4007 3871
2797 699
1423 1423
rated
10
4078 4078
2876 2876
1061 1061
3721 3721
143 143
2992 2992
3279 3279
3389 3389
1702 1702
1110 1110
unrated
10
4078 4078
3721 3721
3389 3389
3279 3279
2992 2992
2876 2876
1702 1702
1110 1110
1061 1061
143 143
maybe
2
3936 3936
2967 2967
maybe
2
1 1
2 2
unrated
2
2 2
1 1
maybe
2
2 1
1 2
rated
2
2967 2967
3936 3936
unrated
3
1200 1200
1200 1200
1300 1300
unrated
3
3 3
2 2
1 1
maybe
3
1 1
1 1
2 2
unrated
2
3 2
3 2
rated
3
5 5
4 4
3 4
rated
3
200 200
200 200
300 300
unrated
3
1 1
2 2
3 3
unrated
5
3123 3123
2777 2777
2246 2246
2245 2245
1699 1699
maybe
2
10 10
8 8
maybe
3
1500 1500
1500 1500
1600 1600
unrated
3
1500 1500
1500 1500
1700 1700
unrated
4
100 100
100 100
70 70
80 80
unrated
2
1 2
2 1
rated
3
5 5
4 3
3 3
rated
3
1600 1650
1500 1550
1400 1450
rated
4
2000 2000
1500 1500
1500 1500
1700 1700
unrated
4
1500 1500
1400 1400
1400 1400
1700 1700
unrated
2
1600 1600
1400 1400
maybe
2
3 1
9 8
rated
2
2 1
1 1
rated
4
4123 4123
4123 4123
2670 2670
3670 3670
unrated
2
2 2
3 3
unrated
2
10 11
5 4
rated
2
15 14
13 12
rated
2
2 1
2 2
rated
3
2670 2670
3670 3670
4106 4106
unrated
3
4 5
3 3
2 2
rated
2
10 9
10 10
rated
3
1011 1011
1011 999
2200 2100
rated
2
3 3
5 5
unrated
2
1500 1500
3000 2000
rated
2
5 6
5 5
rated
3
2000 2000
1500 1501
500 500
rated
2
2 3
2 2
rated
2
3 3
2 2
maybe
2
1 2
1 1
rated
4
3123 3123
2777 2777
2246 2246
1699 1699
maybe
2
15 14
14 13
rated
4
3000 3000
2900 2900
3000 3000
2900 2900
unrated
6
30 3060
24 2194
26 2903
24 2624
37 2991
24 2884
rated
2
100 99
100 100
rated
4
2 2
1 1
1 1
2 2
unrated
3
100 101
100 100
100 100
rated
4
1000 1001
900 900
950 950
890 890
rated
2
2 3
1 1
rated
2
2 2
1 1
maybe
2
3 2
2 2
rated
2
3 2
3 3
rated
2
1 1
2 2
unrated
3
3 2
3 3
3 3
rated
4
1500 1501
1300 1300
1200 1200
1400 1400
rated
3
1000 1000
500 500
400 300
rated
5
3123 3123
2777 2777
2246 2246
2246 2246
3000 3000
unrated
2
1 1
2 3
rated
2
6 2
6 2
rated
5
3123 3123
1699 1699
2777 2777
2246 2246
2246 2246
unrated
2
1500 1500
1600 1600
unrated
5
3123 3123
2777 2777
2246 2246
2241 2241
1699 1699
maybe
2
20 30
10 5
rated
3
1 1
2 2
1 1
unrated
2
1 2
3 3
rated
5
5 5
4 4
3 3
2 2
1 1
maybe
2
2 2
2 1
rated
2
100 100
90 89
rated
2
1000 900
2000 2000
rated
2
50 10
10 50
rated
2
200 200
100 100
maybe
3
2 2
2 2
3 3
unrated
3
1000 1000
300 300
100 100
maybe
4
2 2
2 2
3 3
4 4
unrated
2
5 3
6 3
rated
2
1200 1100
1200 1000
rated
2
5 5
4 4
maybe
2
5 5
3 3
maybe
5
1500 1500
1300 1300
1200 1200
1400 1400
1100 1100
unrated
5
10 10
9 9
8 8
7 7
6 6
maybe
3
1000 1000
300 300
10 10
maybe
5
6 6
5 5
4 4
3 3
2 2
maybe
2
3 3
1 1
maybe
4
2 2
2 2
2 2
3 3
unrated
2
1000 1000
700 700
maybe
2
4 3
5 3
rated
2
1000 1000
1100 1100
unrated
4
5 5
4 4
3 3
2 2
maybe
3
1 1
2 3
2 2
rated
2
1 2
1 3
rated
2
3 3
1 2
rated
4
1501 1500
1300 1300
1200 1200
1400 1400
rated
5
1 1
2 2
3 3
4 4
5 5
unrated
2
10 10
1 2
rated
6
3123 3123
2777 2777
2246 2246
2246 2246
1699 1699
1900 1900
unrated
6
3123 3123
2777 2777
3000 3000
2246 2246
2246 2246
1699 1699
unrated
2
100 100
110 110
unrated
3
3 3
3 3
4 4
unrated
3
3 3
3 2
4 4
rated
3
5 2
4 4
3 3
rated
4
4 4
3 3
2 2
1 1
maybe
2
1 1
3 2
rated
5
3123 3123
2777 2777
2246 2246
2246 2246
2699 2699
unrated
3
3 3
3 3
3 4
rated
3
1 2
2 2
3 3
rated
3
1 2
1 2
1 2
rated
2
2 1
2 1
rated
2
1 2
3 4
rated
2
3 2
2 3
rated
3
1500 1500
1600 1600
1600 1600
unrated
3
1 1
3 3
4 4
unrated
3
1 1
2 2
2 2
unrated
2
10 12
8 8
rated
5
1200 1200
1500 1500
1500 1500
1500 1500
1500 1500
unrated
2
1 2
2 2
rated
3
1500 1400
1200 1200
1100 1100
rated
2
10 12
10 10
rated
3
1500 1500
1400 1400
1300 1300
maybe
3
3 3
4 4
5 5
unrated
3
2 6
3 5
4 4
rated
2
5 6
4 6
rated
4
10 10
10 10
7 7
8 8
unrated
2
4 4
3 3
maybe
l1=int(input())
f,g  = [], []
for i in range(l1):
    a,b = input().split()
    a,b = int(a),int(b)
    f.append(a)
    q.append(b)
r=sorted(q,reverse=True)
if g==f and r==q:
    print('maybe')
elif g==f and r!=g:
    print('unrated')
else:
    print('rated')
		  		   		 	 			 			  				  	