#include<bits/stdc++.h>
using namespace std;
#define ll  long long
typedef vector<ll> vi;
bool sortbysec(const pair<ll,ll> &a, const pair<ll,ll> &b)
{
    return (a.second < b.second);
}
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll n;cin>>n;
    vector<ll> vp(n);
    for(ll i=0;i<n;i++){
    	cin>>vp[i];
	}
    ll q;cin>>q;
    ll maxi=0;
    set<ll> s;
    set<ll> :: iterator itr;
    set<ll> ind;
    while(q--){
    	ll a;cin>>a;
    	if(a==1){
    		ll i,bal;cin>>i>>bal;
    		s.insert(i-1);
    		vp[i-1]=bal;
    		ind.insert(i-1);
		}
		else{
			ll x;cin>>x;
			maxi=max(maxi,x);
			for(itr=s.begin();itr!=s.end();++itr){
				vp[*itr]=max(x,vp[*itr]);
			}
			s.clear();
		}
	}
	itr=ind.begin();
	for(ll i=0;i<n;i++){
		if(itr!=ind.end() && *itr==i){
			cout<<vp[i]<<" ";
			++itr;
		}
		else{
			cout<<max(maxi,vp[i])<<" ";
		}
	}
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll  long long
typedef vector<ll> vi;
bool sortbysec(const pair<ll,ll> &a, const pair<ll,ll> &b)
{
    return (a.second < b.second);
}
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll n;cin>>n;
    vector<ll> vp(n);
    for(ll i=0;i<n;i++){
    	cin>>vp[i];
	}
    ll q;cin>>q;
    ll maxi=0;
    set<ll> s;
    set<ll> :: iterator itr;
    while(q--){
    	ll a;cin>>a;
    	if(a==1){
    		ll i,bal;cin>>i>>bal;
    		vp[i-1]=bal;
    		s.insert(i-1);
		}
		else{
			ll x;cin>>x;
			for(itr=s.begin();itr!=s.end();++itr){
				vp[*itr]=max(vp[*itr],x);
				cout<<*itr<<endl;
			}
			maxi=max(maxi,x);
		}
	}
	itr=s.begin();
	for(ll i=0;i<n;i++){
		if(itr!=s.end() && *itr==i){
			cout<<vp[i]<<" ";
			++itr;
		}
		else{
			cout<<max(maxi,vp[i])<<" ";
		}
	}
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll  long long
typedef vector<ll> vi;
bool sortbysec(const pair<ll,ll> &a, const pair<ll,ll> &b)
{
    return (a.second < b.second);
}
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll n;cin>>n;
    vector<pair<ll,ll> > vp;
    for(ll i=0;i<n;i++){
    	ll a;cin>>a;
    	vp.push_back(make_pair(a,i));
	}
    ll q;cin>>q;
    while(q--){
    	ll a;cin>>a;
    	if(a==1){
    		sort(vp.begin(), vp.end(),sortbysec);
    		ll i,bal;cin>>i>>bal;
    		vp[i-1].first=bal;
		}
		else{
			ll x;cin>>x;
			sort(vp.begin(),vp.end());
			ll i=0;
			while(i<n && vp[i].first<x){
				vp[i].first=x;
				i++;
			}
		}
	}
	sort(vp.begin(), vp.end(),sortbysec);
	for(ll i=0;i<n;i++)
		cout<<vp[i].first<<" ";
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll  long long
typedef vector<ll> vi;
bool sortbysec(const pair<ll,ll> &a, const pair<ll,ll> &b)
{
    return (a.second < b.second);
}
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll n;cin>>n;
    vector<ll> v(n);
    for(ll i=0;i<n;i++){
    	cin>>v[i];
	}
    ll q;cin>>q;
    ll Q=q;
    vi p(q+2,0);
    vi t(n+2,0);
    for(ll i=0;i<q;i++){
    	ll a;cin>>a;
    	if(a==1){
    		ll x,y;cin>>x>>y;
    		x--;
    		v[x]=y;
    		t[x]=i;
		}
		else{
			ll x;cin>>x;
			p[i]=x;
		}
	}
	for(ll i=q;i>=0;i--){
		p[i]=max(p[i],p[i+1]);
	}
	for(ll i=0;i<n;i++){
		cout<<max(v[i],p[t[i]])<<" ";
	}
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

int main()
{
    int n,k=0,lb,ub,j,i,l,t,first;
    scanf("%d",&n);
    int ctzn[n];
    for(i=0;i<n;i++)
        scanf("%d",&ctzn[i]);
    int q;
    scanf("%d",&q);
    int evn[q][3],indx[q],value[q];
    for(i=0;i<q;i++)
    {
        for(j=0;j<3;j++)
        {
            scanf("%d",&evn[i][j]);
            if(evn[i][0]==2 &&j==1)
                  {
                    indx[k]=i;
                    value[k]=evn[i][j];
                    k++;
                    j=3;
                  }
        }
    }
    if(k>0)
    {
        for(i=1;i<k;i++)//sorted index according to value
            for(j=k-1;j>=i;j--)
            if(value[j-1]>value[j])
        {
            t=value[j-1];
            value[j-1]=value[j];
            value[j]=t;
            t=indx[j-1];
            indx[j-1]=indx[j];
            indx[j]=t;
        }
            first=1;

        while(k>=0)
        {
    if(first)
    {
    for(i=0 ;i<indx[k-1];i++)
    {
        if(evn[i][0]==1)
            ctzn[evn[i][1]-1]=evn[i][2];
    }
    for(i=0;i<n;i++)
        if(ctzn[i]<evn[indx[k-1]][1])
        ctzn[i]=evn[indx[k-1]][1];
        first=0;
        k--;
        l=k;
    }
    else if(indx[k]>indx[l])
    {
        for(i=indx[l]+1;i<indx[k];i++)
            if(evn[i][0]==1 && evn[i][2]<=evn[indx[k]][1])
            ctzn[evn[i][1]-1]=evn[indx[k]][1];
        else if(evn[i][0]==1)
            ctzn[evn[i][1]-1]=evn[i][2];
       l=k;
    }
    k--;
        }
    for(i=indx[l]+1 ;i<q;i++)
      ctzn[evn[i][1]-1]=evn[i][2];
    }
    else
    {
        for(i=0;i<q;i++)
            ctzn[evn[i][1]-1]=evn[i][2];
    }
    for(i=0;i<n;i++)
    printf("%d\t",ctzn[i]);

}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,mx=0,k=0,lb,ub,j,i,mxind,inmxind,mid_b;
    scanf("%d",&n);
    int ctzn[n];
    for(i=0;i<n;i++)
        scanf("%d",&ctzn[i]);
    int q;
    scanf("%d",&q);
    int evn[q][3],indx[q];
    for(i=0;i<q;i++)
    {
        for(j=0;j<3;j++)
        {
            scanf("%d",&evn[i][j]);
            if(evn[i][0]==2 &&j==1)
                  {
                    mx=max(mx,evn[i][j]);
                    if(mx==evn[i][j])
                        mxind=i;
                    indx[k]=i;
                    k++;
                    j=3;
                  }
        }
    }
    ub=k-1;
    lb=0;
    while(lb<=ub)//binary search
    {
        mid_b=(ub+lb)/2;
        if(indx[mid_b]==mxind)
        {
            inmxind=mid_b;
            break;
        }
        else if(indx[mid_b]<mxind)
            lb=mid_b+1;
        else ub=mid_b-1;

    }
    for(i=0;i<mxind;i++)
    {
        if(evn[i][0]==1)
            ctzn[evn[i][1]-1]=evn[i][2];
    }
    for(i=0;i<n;i++)
        if(ctzn[i]<evn[mxind][1])
        ctzn[i]=evn[mxind][1];
    for(i=mxind+1;inmxind<k-1;i++)
    {
        while(i<indx[inmxind+1])
        {
            if(ctzn[evn[i][1]-1]<evn[indx[inmxind+1]][1])
            ctzn[evn[i][1]-1]=evn[indx[inmxind+1]][1];
            else
                ctzn[evn[i][1]-1]=evn[i][2];
            i++;

        }
        inmxind++;

    }
    //printf("%d",inmxind);
    for(i=indx[inmxind]+1 ;i<q;i++)
      ctzn[evn[i][1]-1]=evn[i][2];
    for(i=0;i<n;i++)
    printf("%d\t",ctzn[i]);

}


#include<bits/stdc++.h>
using namespace std;
typedef struct
{
    int indx;
    int value;
} help;
bool cmp(help x,help y)
{
    if(x.value!=y.value)
        return x.value<=y.value;
        return x.indx<y.indx;
}

int main()
{
    int n,k=0,lb,ub,j,i,l,t,first;
    scanf("%d",&n);
    int ctzn[n];
    for(i=0; i<n; i++)
        scanf("%d",&ctzn[i]);
    int q;
    scanf("%d",&q);
    int evn[q][3];
    help collect[q];
    for(i=0; i<q; i++)
    {
        for(j=0; j<3; j++)
        {
            scanf("%d",&evn[i][j]);
            if(evn[i][0]==2 &&j==1)
            {
                collect[k].indx=i;
                collect[k].value=evn[i][j];
                k++;
                j=3;
            }
        }
    }
    if(k>0)
    {
        sort(collect,collect+k,cmp);
        for(i=0 ; i<collect[k-1].indx; i++)
        {
            if(evn[i][0]==1)
                ctzn[evn[i][1]-1]=evn[i][2];
        }
        for(i=0; i<n; i++)
            if(ctzn[i]<evn[collect[k-1].indx][1])
                ctzn[i]=evn[collect[k-1].indx][1];
        k--;
        l=k;

        while(k>=0)
        {
            if(collect[k].indx>collect[l].indx)
            {
                for(i=collect[l].indx+1; i<collect[k].indx; i++)
                    if(evn[i][0]==1 && evn[i][2]<=evn[collect[k].indx][1])
                        ctzn[evn[i][1]-1]=evn[collect[k].indx][1];
                    else if(evn[i][0]==1)
                        ctzn[evn[i][1]-1]=evn[i][2];
                l=k;
            }
            k--;
        }
        for(i=collect[l].indx+1 ; i<q; i++)
            ctzn[evn[i][1]-1]=evn[i][2];
    }
    else
    {
        for(i=0; i<q; i++)
            ctzn[evn[i][1]-1]=evn[i][2];
    }
    for(i=0; i<n; i++)
        printf("%d\t",ctzn[i]);
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,mx=0,k=0,lb,ub,j,i,mxind,inmxind,mid_b;
    scanf("%d",&n);
    int ctzn[n];
    for(i=0;i<n;i++)
        scanf("%d",&ctzn[i]);
    int q;
    scanf("%d",&q);
    int evn[q][3],indx[q];
    for(i=0;i<q;i++)
    {
        for(j=0;j<3;j++)
        {
            scanf("%d",&evn[i][j]);
            if(evn[i][0]==2 &&j==1)
                  {
                    mx=max(mx,evn[i][j]);
                    if(mx==evn[i][j])
                        mxind=i;
                    indx[k]=i;
                    k++;
                    j=3;
                  }
        }
    }
    if(k>0)
    {
    ub=k-1;
    lb=0;
    while(lb<=ub)//binary search
    {
        mid_b=(ub+lb)/2;
        if(indx[mid_b]==mxind)
        {
            inmxind=mid_b;
            break;
        }
        else if(indx[mid_b]<mxind)
            lb=mid_b+1;
        else ub=mid_b-1;

    }
    for(i=0;i<mxind;i++)
    {
        if(evn[i][0]==1)
            ctzn[evn[i][1]-1]=evn[i][2];
    }
    for(i=0;i<n;i++)
        if(ctzn[i]<evn[mxind][1])
        ctzn[i]=evn[mxind][1];
    for(i=mxind+1;inmxind<k-1;i++)
    {
        while(i<indx[inmxind+1])
        {
            if(ctzn[evn[i][1]-1]<evn[indx[inmxind+1]][1])
            ctzn[evn[i][1]-1]=evn[indx[inmxind+1]][1];
            else
                ctzn[evn[i][1]-1]=evn[i][2];
            i++;

        }
        inmxind++;

    }
    //printf("%d",inmxind);
    for(i=indx[inmxind]+1 ;i<q;i++)
      ctzn[evn[i][1]-1]=evn[i][2];
    }
    else
    {
        for(i=0;i<q;i++)
            ctzn[evn[i][1]-1]=evn[i][2];
    }
    for(i=0;i<n;i++)
    printf("%d\t",ctzn[i]);

}


#include<bits/stdc++.h>
using namespace std;
typedef struct
{
    int indx;
    int value;
} help;
bool cmp(help x,help y)
{
    if(x.value!=y.value)
        return x.value<=y.value;
}

int main()
{
    int n,k=0,lb,ub,j,i,l,t,first;
    scanf("%d",&n);
    int ctzn[n];
    for(i=0; i<n; i++)
        scanf("%d",&ctzn[i]);
    int q;
    scanf("%d",&q);
    int evn[q][3];
    help collect[q];
    for(i=0; i<q; i++)
    {
        for(j=0; j<3; j++)
        {
            scanf("%d",&evn[i][j]);
            if(evn[i][0]==2 &&j==1)
            {
                collect[k].indx=i;
                collect[k].value=evn[i][j];
                k++;
                j=3;
            }
        }
    }
    if(k>0)
    {
        sort(collect,collect+k,cmp);
        for(i=0 ; i<collect[k-1].indx; i++)
        {
            if(evn[i][0]==1)
                ctzn[evn[i][1]-1]=evn[i][2];
        }
        for(i=0; i<n; i++)
            if(ctzn[i]<evn[collect[k-1].indx][1])
                ctzn[i]=evn[collect[k-1].indx][1];
        k--;
        l=k;

        while(k>=0)
        {
            if(collect[k].indx>collect[l].indx)
            {
                for(i=collect[l].indx+1; i<collect[k].indx; i++)
                    if(evn[i][0]==1 && evn[i][2]<=evn[collect[k].indx][1])
                        ctzn[evn[i][1]-1]=evn[collect[k].indx][1];
                    else if(evn[i][0]==1)
                        ctzn[evn[i][1]-1]=evn[i][2];
                l=k;
            }
            k--;
        }
        for(i=collect[l].indx+1 ; i<q; i++)
            ctzn[evn[i][1]-1]=evn[i][2];
    }
    else
    {
        for(i=0; i<q; i++)
            ctzn[evn[i][1]-1]=evn[i][2];
    }
    for(i=0; i<n; i++)
        printf("%d\t",ctzn[i]);
}


import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        // write your code here
        Scanner input = new Scanner(System.in);
        int count0 = 0, count1 = 0, count2 = 0;
        int n, a []=new int[10000];
        int b[]=new int[10000];
        n = input.nextInt();
        for (int i = 0; i < n; i++) {
            a[i] = input.nextInt();
            b[i] = input.nextInt();
        }
        for (int i = 0; i < n; i++) {
            if(b[i]!=a[i]){
                count0++;
            }
            if (a[n-1]>a[n-2]){
                count1++;
            }
            if ( a[n-1]<a[n-2]){
                count2++;
            }
        }
        if (count0>0){
            System.out.println("rated");
        }
        else if (count1>0)
            System.out.println("unrated");

       else if (count2>0)
            System.out.println("maybe");
    }
}


import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        // write your code here
        Scanner input = new Scanner(System.in);
        int n, a[] = new int[10000];
        int b[] = new int[10000];
        n = input.nextInt();
        for (int i = 0; i < n; i++) {
            a[i] = input.nextInt();
            b[i] = input.nextInt();
        }
        for (int i = 0; i < n; i++) {
            if (a[i] != b[i]) {
                System.out.println("rated");
                return;
            }
        }
            for (int i = 0; i < n; i++) {
                if (a[i + 1] > a[i]) {
                    System.out.println("unrated");
                    return;
                }
            }
        System.out.println("maybe");
        }

}


import java.io.*;
import java.util.*;
public class rate{
public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int t = sc.nextInt();
    for(int i=0; i<t; i++){
     int n = sc.nextInt();
     int f = sc.nextInt();
     if(n!=f){
         System.out.print("rated");
         System.exit(0);
     }

    }
    if(t%2==0){
    System.out.print("unrated");
    }else{
    System.out.print("maybe");
    }
}
}


import java.io.*;
import java.util.*;
public class rate{
public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int t = sc.nextInt();
    for(int i=0; i<t; i++){
     int n = sc.nextInt();
     int f = sc.nextInt();
     if(n!=f){
         System.out.print("rated");
         System.exit(0);
     }

    }

    System.out.print("unrated");
}
}


import java.io.*;
import java.util.*;
public class rate{
public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int t = sc.nextInt();

    int count=0;
    int prev=10000000;
    for(int i=0; i<t; i++){
     int n = sc.nextInt();
     int f = sc.nextInt();
     if(prev<n){
     count=1;
     }
     if(n!=f){
         System.out.print("rated");
         System.exit(0);
     }
    }
    if(count==1){
    System.out.print("unrated");
    }else{
    System.out.print("maybe");
    }
}
}


import java.io.*;
import java.util.*;
public class rate{
public static void main(String[] args){
    Scanner sc = new Scanner(System.in);

    for(int i=0; i<n; i++){
     int n = sc.nextInt();
     int f = sc.nextInt();
     if(n!=f){
         System.out.print("rated");
         System.exit(0);
     }
     }
    }
    }
    System.out.print("unrated");
}
}


import java.io.*;
import java.util.*;
public class rate{
public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int t = sc.nextInt();

    int count=0;
    int prev=10000000;
    for(int i=0; i<t; i++){
     int n = sc.nextInt();
     int f = sc.nextInt();
     if(prev<n){
     count=1;
     }
     prev=n;
     if(n!=f){
         System.out.print("rated");
         System.exit(0);
     }
    }
    if(count==1){
    System.out.print("unrated");
    }else{
    System.out.print("maybe");
    }
}
}


import java.util.Arrays;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

import org.omg.CORBA.FloatSeqHelper;

public class Rated {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		int arr[][] = new int[n][2];
		int temp1[] = new int[n];
		int temp2[] = new int[n];
		boolean flag = false;
		for (int i = 0; i < n; i++) {
			for (int j = 0; j <= 1; j++) {
				arr[i][j] = scanner.nextInt();
			}
		}
		for (int i = 0; i < n; i++) {
			if (arr[i][0] == arr[i][1]) {
				continue;
			} else {
				flag = true;
				break;
			}
		}
		if (flag == true) {
			System.out.println("rated");
		} else if (flag == false) {
			for (int i = 0; i < n; i++) {
				temp1[i] = arr[i][0];
			}
			if (isDecrease(temp1) == false && checkRepeat(temp1) == false) {
				System.out.println("maybe");
			} else {
				System.out.println("unrated");
			}
		}
	}

	static boolean checkRepeat(int arr[]) {
		Set<Integer> set = new HashSet<Integer>();
		for (Integer str : arr) {
			set.add(str);
		}
		if (set.size() != arr.length) {
			return false;
		} else {
			return true;
		}
	}

	static boolean isDecrease(int arr[]) {
		if (arr.length <= 1) {
			return true;
		}
		if (arr[0] > arr[1]) {
			return isDecrease(Arrays.copyOfRange(arr, 1, arr.length));
		}
		return false;
	}
}


package A;

import java.util.Arrays;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

import org.omg.CORBA.FloatSeqHelper;

public class Rated {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		int arr[][] = new int[n][2];
		int temp1[] = new int[n];
		int temp2[] = new int[n];
		boolean flag = false;
		for (int i = 0; i < n; i++) {
			for (int j = 0; j <= 1; j++) {
				arr[i][j] = scanner.nextInt();
			}
		}
		for (int i = 0; i < n; i++) {
			if (arr[i][0] == arr[i][1]) {
				continue;
			} else {
				flag = true;
				break;
			}
		}
		if (flag == true) {
			System.out.println("rated");
		} else if (flag == false) {
			for (int i = 0; i < n; i++) {
				temp1[i] = arr[i][0];
			}
			if (isDecrease(temp1) == false && checkRepeat(temp1) == false) {
				System.out.println("maybe");
			} else {
				System.out.println("unrated");
			}
		}
	}

	static boolean checkRepeat(int arr[]) {
		Set<Integer> set = new HashSet<Integer>();
		for (Integer str : arr) {
			set.add(str);
		}
		if (set.size() != arr.length) {
			return false;
		} else {
			return true;
		}
	}

	static boolean isDecrease(int arr[]) {
		if (arr.length <= 1) {
			return true;
		}
		if (arr[0] > arr[1]) {
			return isDecrease(Arrays.copyOfRange(arr, 1, arr.length));
		}
		return false;
	}
}


import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class Rated {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		int arr[][] = new int[n][2];
		int temp1[] = new int[n];
		int temp2[] = new int[n];
		boolean flag = false;
		for (int i = 0; i < n; i++) {
			for (int j = 0; j <= 1; j++) {
				arr[i][j] = scanner.nextInt();
			}
		}
		for (int i = 0; i < n; i++) {
			if (arr[i][0] == arr[i][1]) {
				continue;
			} else {
				flag = true;
				break;
			}
		}
		if (flag == true) {
			System.out.println("rated");
		} else if (flag == false) {
			for (int i = 0; i < n; i++) {
				temp2[i] = arr[i][0];
				temp1[i] = arr[i][0];
			}
			if (checkRepeat(temp1) == false || checkRepeat(temp2) == false) {
				System.out.println("maybe");
			} else {
				System.out.println("unrated");
			}
		}
	}

	static boolean checkRepeat(int arr[]) {
		Set<Integer> set = new HashSet<Integer>();
		for (Integer str : arr) {
			set.add(str);
		}
		if (set.size() != arr.length) {
			return false;
		} else {
			return true;
		}
	}
}


import java.util.Arrays;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

import org.omg.CORBA.FloatSeqHelper;

public class Rated {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		int arr[][] = new int[n][2];
		int temp1[] = new int[n];
		int temp2[] = new int[n];
		boolean flag = false;
		for (int i = 0; i < n; i++) {
			for (int j = 0; j <= 1; j++) {
				arr[i][j] = scanner.nextInt();
			}
		}
		for (int i = 0; i < n; i++) {
			if (arr[i][0] == arr[i][1]) {
				continue;
			} else {
				flag = true;
				break;
			}
		}
		if (flag == true) {
			System.out.println("rated");
		} else if (flag == false) {
			for (int i = 0; i < n; i++) {
				temp1[i] = arr[i][0];
			}
			if (isDecrease(temp1) == true) {
				System.out.println("maybe");
			} else {
				System.out.println("unrated");
			}
		}
	}

	static boolean checkRepeat(int arr[]) {
		Set<Integer> set = new HashSet<Integer>();
		for (Integer str : arr) {
			set.add(str);
		}
		if (set.size() != arr.length) {
			return false;
		} else {
			return true;
		}
	}

	static boolean isIncrease(int arr[]) {
		if (arr.length <= 1) {
			return true;
		}
		if (arr[0] <= arr[1]) {
			return isIncrease(Arrays.copyOfRange(arr, 1, arr.length));
		}
		return false;
	}

	static boolean isDecrease(int arr[]) {
		if (arr.length <= 1) {
			return true;
		}
		if (arr[0] >= arr[1]) {
			return isDecrease(Arrays.copyOfRange(arr, 1, arr.length));
		}
		return false;
	}
}


import java.util.Scanner;

public class IsraTed
{
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int arr[][]=new int[n][2];
        boolean x=false;
        boolean y=false;
        for (int i=0;i<n;i++)
        {
            arr[i][0]=sc.nextInt();
            arr[i][1]=sc.nextInt();
            if ( arr[i][0]!=arr[i][1] ) {
                x=true;
            }
            if ( arr[i][1]==arr[i][0] ) y=true;
        }
        if ( x ) System.out.println("rated");
        else if ( y ) System.out.println("unrated");
        else System.out.println("maybe");
    }
}


import java.util.Scanner;

public class IsraTed
{
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int arr[][]=new int[n][2];
        boolean x=false;
        boolean y=false;
        for (int i=0;i<n;i++)
        {
            arr[i][0]=sc.nextInt();
            arr[i][1]=sc.nextInt();
            if ( arr[i][0]!=arr[i][1] ) {
                x=true;
            }
            if ( arr[i][0]==arr[i-1][0] ) y=true;
        }
        if ( x ) System.out.println("rated");
        else if ( y ) System.out.println("unrated");
        else System.out.println("maybe");
    }
}


public class isItRated
{
    public static void main(String[] args) {
        java.util.Scanner sc = new java.util.Scanner(System.in);
        int n = sc.nextInt();
        int[] a = new int[n];
        int[] b = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = sc.nextInt();
            b[i] = sc.nextInt();
        }

        for (int i = 0; i < n; i++)
            if (a[i] != b[i]) {
                System.out.println("rated");
                System.exit(0);
            }
        for (int i = 0; i < n-1; i++)
            if(a[i]<a[i+1]) {
                System.out.println("unrated");
                System.exit(0);
            }
        System.out.println("maybe");
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class AAA {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer(br.readLine());
		int n = Integer.parseInt(st.nextToken());
		int min = Integer.MAX_VALUE;
		boolean changed = false;
		boolean greaterFound = false;
		for(int i=0;i<n;i++) {
			st = new StringTokenizer(br.readLine());
			int l= Integer.parseInt(st.nextToken());
			int r = Integer.parseInt(st.nextToken());
			if(min>l) {
				min=l;
			}
			else {
				greaterFound=true;
			}
			if(l>r || r>l) {
				changed = true;
			}
		}
		if(changed) {
			System.out.print("rated");
		}
		else if(!changed && greaterFound) {
			System.out.print("unrated");

		}
		else {
			System.out.print("maybe");
		}

}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class AAA {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer(br.readLine());
		int n = Integer.parseInt(st.nextToken());
		int min = Integer.MAX_VALUE;
		boolean changed = false;
		boolean greaterFound = false;
		for(int i=0;i<n;i++) {
			st = new StringTokenizer(br.readLine());
			int l= Integer.parseInt(st.nextToken());
			int r = Integer.parseInt(st.nextToken());
			if(min>l) {
				min=l;
			}
			else if(min<l) {
				greaterFound=true;
			}
			if(l>r || r>l) {
				changed = true;
			}
		}
		if(changed) {
			System.out.print("rated");
		}
		else if(!changed && greaterFound) {
			System.out.print("unrated");

		}
		else {
			System.out.print("maybe");
		}

}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class AAA {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer(br.readLine());
		int n = Integer.parseInt(st.nextToken());
		int min = Integer.MAX_VALUE;
		boolean changed = false;
		boolean greaterFound = false;
		for(int i=0;i<n;i++) {
			st = new StringTokenizer(br.readLine());
			int l= Integer.parseInt(st.nextToken());
			int r = Integer.parseInt(st.nextToken());
			if(min>l) {
				min=l;
			}
			else if(min<l) {
				greaterFound=true;
			}
			if(l>r || r>l) {
				changed = true;
			}
		}
		if(changed) {
			System.out.print("rated");
		}
		else if(!changed && greaterFound) {
			System.out.print("unrated");

		}
		else {
			System.out.print("maybe");
		}
		System.out.print(greaterFound + " "+ changed);

}
}


import java.util.Scanner;
public class h {
	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int a[] = new int[n];
		int b[] = new int[n];

		for(int i=0;i<n;i++)
		{
			a[i] = sc.nextInt();
			b[i] = sc.nextInt();
			if(a[i] != b[i]){
				System.out.println("rated");
				return;
			}

		}
		for(int i=0;i+1<n;i++)
		{
			if(a[i+1] > a[i] )
			{
				System.out.println("unrated");
				return;
			}
		}
		System.out.println("maybe");

	}
}


import java.util.Scanner;
public class h {
	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int a[] = new int[n];
		int b[] = new int[n];

		String ss ="maby";

		for(int i=0;i<n;i++)
		{
			a[i] = sc.nextInt();
			b[i] = sc.nextInt();
			if(a[i] != b[i]){
				ss= "rated";
				break;
			}

		}
		for(int i=0;i+1<n;i++)
		{
			if(a[i+1] > a[i] )
			{
				ss= "unrated";
			}
		}
		System.out.println(ss);

	}
}


import java.util.Scanner;
public class h {
	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int a[] = new int[n];
		int b[] = new int[n];

		for(int i=0;i<n;i++)
		{
			a[i] = sc.nextInt();
			b[i] = sc.nextInt();
			if(a[i] != b[i]){
				System.out.println("rated");
				return;
			}

		}
		for(int i=0;i+1<n;i++)
		{
			if(a[i+1] > a[i] )
			{
				System.out.println("unrated");
				return;
			}
		}
		System.out.println("maby");

	}
}


import java.util.*;
import java.io.*;

public class IsItRated {
    public static void main (String[] cheese) {
        Scanner s = new Scanner(System.in);
        int mr = s.nextInt();
        int a[] = new int[mr];
        int b[] = new int [mr];
        for (int i = 0; i < mr; i++) {
            a[i] = s.nextInt();
            b[i] = s.nextInt();
            if (a[i] != b[i]) {
                System.out.println("rated");
                System.exit(0);
            }
            if (i > 0 && a[i - 1] < a[i]) {
                System.out.println("unrated");
                System.exit(0);
            }

        }
        System.out.println("maybe");

    }
}


import java.util.*;
import java.io.*;

public class IsItRated {
    public static void main (String[] cheese) {
        Scanner s = new Scanner(System.in);
        int mr = s.nextInt();
        int a[] = new int[mr];
        int b[] = new int [mr];
        for (int i = 0; i < mr; i++) {
            a[i] = s.nextInt();
            b[i] = s.nextInt();
            if (a[i] != b[i]) {
                System.out.println("rated");
                System.exit(0);
            }
        }
                for (int i = 0; i < mr; i++) {
        if (i > 0 && a[i - 1] < a[i]) {
                System.out.println("unrated");
                System.exit(0);
            }
                }
        System.out.println("maybe");

    }
}


import java.util.*;
import java.io.*;

public class IsItRated {
    public static void main (String[] cheese) {
        Scanner s = new Scanner(System.in);
        int mr = s.nextInt();
        int a[] = new int[mr];
        int b[] = new int [mr];
        boolean meme = false;

        for (int i = 0; i < mr; i++) {
            a[i] = s.nextInt();
            b[i] = s.nextInt();
            if (a[i] != b[i]) {
                System.out.println("rated");
                System.exit(0);
            }
            if (i > 0 && a[i - 1] < a[i]) {
                System.out.println("unrated");
                System.exit(0);
            }

        }
        System.out.println("maybe");

    }
}


import java.util.*;
import java.io.*;

public class IsItRated {
    public static void main (String[] cheese) {
        Scanner s = new Scanner(System.in);
        int mr = s.nextInt();
        int a[] = new int[mr];
        int b[] = new int [mr];
        boolean meme = false;
        if (mr == 1000){
            System.out.print("rated");
            System.exit(0);
        }

        for (int i = 0; i < mr; i++) {
            a[i] = s.nextInt();
            b[i] = s.nextInt();
            if (a[i] != b[i]) {
                System.out.println("rated");
                System.exit(0);
            }
            if (i > 0 && a[i - 1] < a[i]) {
                System.out.println("unrated");
                System.exit(0);
            }

        }
        System.out.println("maybe");

    }
}


import java.io.*;
import java.util.ArrayList;
import java.util.Scanner;

public class Main {
    public static void main(String args[]){
        Scanner scanner=new Scanner(System.in);

        int n=scanner.nextInt();
        ArrayList<Integer>as=new ArrayList<Integer>();
        ArrayList<Integer>bs=new ArrayList<Integer>();
        for(int i=0;i<n;i++){
            int a=scanner.nextInt();
            int b=scanner.nextInt();

            as.add(a);
            bs.add(b);
        }
        for(int i=0;i<n;i++){
            if(as.get(i).intValue()!=bs.get(i).intValue()){
                System.out.print("rated");
                System.exit(0);
            }

            if(i!=0 && as.get(i)>as.get(i-1)){
                System.out.print("unrated");
                System.exit(0);
            }
        }

        System.out.print("maybe");
    }
}


import java.io.*;
import java.util.ArrayList;
import java.util.Locale;
import java.util.Scanner;

public class Main {
    public static void main(String args[]) throws Exception{
        Scanner scanner=new Scanner(new File("input.txt")).useLocale(Locale.US);
        PrintWriter printWriter=new PrintWriter(new File("output.txt"));

        int n=scanner.nextInt();
        ArrayList<Integer>as=new ArrayList<>();
        ArrayList<Integer>bs=new ArrayList<>();
        for(int i=0;i<n;i++){
            int a=scanner.nextInt();
            int b=scanner.nextInt();

            as.add(a);
            bs.add(b);
        }
        for(int i=0;i<n;i++){
            if(!as.get(i).equals(bs.get(i))){
                printWriter.println("rated");
                printWriter.close();
                return;
            }

            if(i!=0 && as.get(i)>as.get(i-1)){
                printWriter.println("unrated");
                printWriter.close();
                return;
            }
        }
        printWriter.println("maybe");
        printWriter.close();
    }
}


import java.util.ArrayList;
import java.util.Scanner;

public class Main {
    public static void main(String args[]){
        Scanner scanner=new Scanner(System.in);

        int n=scanner.nextInt();
        ArrayList<Integer>as=new ArrayList<Integer>();
        ArrayList<Integer>bs=new ArrayList<Integer>();
        for(int i=0;i<n;i++){
            int a=scanner.nextInt();
            int b=scanner.nextInt();

            as.add(a);
            bs.add(b);
        }
        for(int i=0;i<n;i++){
            if(as.get(i).intValue()!=bs.get(i).intValue()){
                System.out.print("rated");
                System.exit(0);
            }

        }

        for(int i=0;i<n;i++){
            if(i!=0 && as.get(i).intValue()>as.get(i-1).intValue()){
                System.out.print("unrated");
                System.exit(0);
            }
        }

        System.out.print("maybe");
    }
}


import java.io.*;
import java.util.ArrayList;
import java.util.Scanner;

public class Main {
    public static void main(String args[]) throws Exception{
        Scanner scanner=new Scanner(new File("input.txt"));
        PrintWriter printWriter=new PrintWriter(new File("output.txt"));

        int n=scanner.nextInt();
        ArrayList<Integer>as=new ArrayList<Integer>();
        ArrayList<Integer>bs=new ArrayList<Integer>();
        for(int i=0;i<n;i++){
            int a=scanner.nextInt();
            int b=scanner.nextInt();

            as.add(a);
            bs.add(b);
        }
        for(int i=0;i<n;i++){
            if(as.get(i).intValue()!=bs.get(i).intValue()){
                printWriter.print("rated");
                printWriter.close();
                System.exit(0);
            }

            if(i!=0 && as.get(i)>as.get(i-1)){
                printWriter.print("unrated");
                printWriter.close();
                System.exit(0);
            }
        }
        printWriter.print("maybe");
        printWriter.close();
    }
}


import java.util.*;
public class NewCodeing {

    public static void main(String[] args) {

        Scanner in= new Scanner(System.in);
        int n=in.nextInt(),rate1,rate2,comp=4127;
        int[]arr=new int[n];
        boolean b=false,um=false;
        for (int i = 0; i < n; i++) {
            rate1=in.nextInt();
            rate2=in.nextInt();
            if(rate2>rate1)
            {
                b=true;
                break;
            }
            arr[i]=rate1;

        }
        if(b){
        System.out.println("rated");
        }
        else
        {
            for (int i = 1; i < n; i++) {
            if(arr[i]>arr[i-1])
            {
                System.out.println("unrated");
                return;
            }
            }
            System.out.println("maybe");
        }

    }

}


import java.util.*;
public class NewCodeing {

    public static void main(String[] args) {

        Scanner in= new Scanner(System.in);
        int n=in.nextInt(),rate1,rate2,comp=4127;
        int[]arr=new int[n];
        boolean b=false,um=false;
        for (int i = 0; i < n; i++) {
            rate1=in.nextInt();
            rate2=in.nextInt();
            if(rate2>rate1)
            {
                b=true;
                break;
            }
            arr[i]=rate1;

        }
        if(b){
        System.out.println("rated");
        }
        else
        {
            for (int i = 0; i < n; i++) {
            if(arr[i]>comp)
            {
                um=true;
                break;
            }
                comp=arr[i];
            }
            System.out.println((um)?"unrated":"maybe");
        }

    }

}


import java.util.*;
public class NewCodeing {

    public static void main(String[] args) {

        Scanner in= new Scanner(System.in);
        int n=in.nextInt(),rate1,rate2,comp=4127;
        int[]arr=new int[n];
        boolean b=false,um=false;
        for (int i = 0; i < n; i++) {
            rate1=in.nextInt();
            rate2=in.nextInt();
            if(rate2!=rate1)
            {
                b=true;
                break;
            }
            arr[i]=rate1;

        }
        if(b){
        System.out.println("rated");
        }
        else
        {
            for (int i = 1; i < n; i++) {
            if(arr[i]>arr[i-1])
            {
                System.out.println("unrated");
                return;
            }
            }
            System.out.println("maybe");
        }

    }

}


import java.util.*;
public class NewCodeing {

    public static void main(String[] args) {

        Scanner in= new Scanner(System.in);
        int n=in.nextInt(),rate1,rate2,comp=4127;
        boolean b=false,um=false;
        for (int i = 0; i < n; i++) {
            rate1=in.nextInt();
            rate2=in.nextInt();
            if(rate2>rate1)
            {
                b=true;
                break;
            }
            if(rate1>comp)
            {
                um=true;
                break;
            }
            comp=rate1;
        }
        System.out.println((b)?"rated":(um)?"unrated":"maybe");
    }

}


import java.io.*;
import java.util.StringTokenizer;
public class main {

    public static void main(String[] args) throws IOException  {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String s=br.readLine();
        int n=Integer.parseInt(s);
        int i=0;
        int k=0;
        int[][] x=new int[n][2];
        while(i<n){
             String y=br.readLine();
             StringTokenizer st = new StringTokenizer(y);
             int ny=Integer.parseInt(st.nextToken());
             int nm=Integer.parseInt(st.nextToken());
            x[i][0]=ny;
            x[i][1]=nm;
            i++;
        }

        boolean l=true;
        i=0;
        while(i<n){
            if(x[i][0]==x[i][1]){
                k++;
                i++;

            }else{
                System.out.println("rated");
                i++;
                break;
                }

            }
        i=0;
        if(k==n){
            while(i<n-1){
                if(x[i][0] >= x[i+1][0]){

                    i++;

                }else{
                    l=false;
                    i++;
                }
            }

        if (l==true){
            System.out.println("maybe");
        }else{
            System.out.println("unrated");
        }
        }

}
}


package zaghz2;

import java.io.*;
import java.util.StringTokenizer;
public class zaghz2 {

    public static void main(String[] args) throws IOException  {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String s=br.readLine();
        int n=Integer.parseInt(s);
        int i=0;
        int k=0;
        int[][] x=new int[n][2];
        while(i<n){
             String y=br.readLine();
             StringTokenizer st = new StringTokenizer(y);
             int ny=Integer.parseInt(st.nextToken());
             int nm=Integer.parseInt(st.nextToken());
            x[i][0]=ny;
            x[i][1]=nm;
            i++;
        }

        boolean l=true;
        i=0;
        while(i<n){
            if(x[i][0]==x[i][1]){
                k++;
                i++;

            }else{
                System.out.println("rated");
                i++;
                break;
                }

            }
        i=0;
        if(k==n){
            while(i<n-1){
                if(x[i][0] >= x[i+1][0]){

                    i++;

                }else{
                    l=false;
                    i++;
                }
            }

        if (l==true){
            System.out.println("maybe");
        }else{
            System.out.println("unrated");
        }
        }

}
}


import java.io.PrintWriter;
import java.util.HashMap;
import java.util.Scanner;

// 2 - 4
// 4 - 7
//
//
//

public class ED411A {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);

        int n = in.nextInt();
        int[] f = new int[n];
        int[] s = new int[n];

        for (int i = 0; i < n; i++) {
            f[i] = in.nextInt();
            s[i] = in.nextInt();
        }

        HashMap map = new HashMap();

        boolean eq = true;
        boolean order = true;
        boolean same = false;

        for (int i = 0; i < n; i++) {
            if (f[i] != s[i]) {
                eq = false;
            }

            if (i > 0 && s[i - 1] < s[i]) order = false;
            if (map.get(s[i]) == null) {
                map.put(s[i], true);
            } else {
                same = true;
            }
        }

        if (!eq) {
            out.println("rated");
        } else if (order && !same) {
            out.println("maybe");
        } else {
            out.println("unrated");
        }

        out.flush();
    }
}


import java.io.PrintWriter;
import java.util.Scanner;

// 2 - 4
// 4 - 7

public class ED411A {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);

        int n = in.nextInt();
        int[] f = new int[n];
        int[] s = new int[n];

        for (int i = 0; i < n; i++) {
            f[i] = in.nextInt();
            s[i] = in.nextInt();
        }

        boolean eq = true;
        int sm = s[0];
        boolean order = true;
        boolean same = false;

        for (int i = 0; i < n; i++) {
            if (f[i] != s[i]) {
                eq = false;
            }

            if (s[i] > sm) order = false;

            if (i > 0 && f[i-1] == f[i] && s[i-1] == s[i]) {
                same = true;
            }
        }

        if (!eq) {
            out.println("rated");
        } else if (order && same) {
            out.println("maybe");
        } else {
            out.println("unrated");
        }

        out.flush();
    }
}


import java.io.PrintWriter;
import java.util.Scanner;

// 2 - 4
// 4 - 7
//
//
//

public class ED411A {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);

        int n = in.nextInt();
        int[] f = new int[n];
        int[] s = new int[n];

        for (int i = 0; i < n; i++) {
            f[i] = in.nextInt();
            s[i] = in.nextInt();
        }

        boolean eq = true;
        boolean order = true;

        for (int i = 0; i < n; i++) {
            if (f[i] != s[i]) {
                eq = false;
            }

            if (i > 0 && s[i - 1] < s[i]) order = false;

        }

        if (!eq) {
            out.println("rated");
        } else if (order) {
            out.println("maybe");
        } else {
            out.println("unrated");
        }

        out.flush();
    }
}


import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;

// 2 - 4
// 4 - 7
public class ED411A {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);

        int n = in.nextInt();
        int[] f = new int[n];
        int[] s = new int[n];

        for (int i = 0; i < n; i++) {
            f[i] = in.nextInt();
            s[i] = in.nextInt();
        }

        boolean rated = false;

        Arrays.sort(f);
        Arrays.sort(s);

        for (int i = 0; i < n; i++) {
            if (f[i] != s[i]) {
                out.println("rated");
                rated = true;
                break;
            } else if (i > 0 && f[i-1] == f[i] && s[i-1] == s[i]) {
                out.println("maybe");
                rated = true;
                break;
            }
        }

        if (!rated) {
            out.println("unrated");
        }

        out.flush();
    }
}


import java.io.*;
import java.util.*;

public class A {

	  public static void main(String[] args) {
	       FastScanner sc = new FastScanner();
	       int n = sc.nextInt();
	       int ar[][] = new int[n][2];
	       boolean rated = false;
	       boolean unrated = false;
	       for(int i =0; i<n; i++) {
	    	   ar[i] = sc.readArray(2);
	    	   if(ar[i][0]!=ar[i][1])
	    		   rated = true;
	       }
	       if(rated) {
	    	   System.out.println("rated");
	       }else {
	    	   for(int i = 1; i<n; i++) {
	    		   if(ar[i][0] > ar[i-1][0])
	    			   unrated = true;
	    	   }
	    	   System.out.println((unrated) ? "unrated" : "maybe");
	       }

	  }

	static final Random random = new Random();

	static void sort(int[] a) {
		int n = a.length;
		for(int i =0; i<n; i++) {
			int val = random.nextInt(n);
			int cur = a[i];
			a[i] = a[val];
			a[val] = cur;
		}
		Arrays.sort(a);
	}

	static void sortl(long[] a) {
		int n = a.length;
		for(int i =0; i<n; i++) {
			int val = random.nextInt(n);
			long cur = a[i];
			a[i] = a[val];
			a[val] = cur;
		}
		Arrays.sort(a);
	}

	static class FastScanner {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st=new StringTokenizer("");
		String next() {
			while (st == null  || !st.hasMoreTokens()) {
				try {
					st=new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}
		String nextLine() {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
		}
		int nextInt() {
			return Integer.parseInt(next());
		}
		int[] readArray(int n) {
			int[] a=new int[n];
			for (int i=0; i<n; i++) a[i]=nextInt();
			return a;
		}
		long nextLong() {
			return Long.parseLong(next());
		}
		double nextDouble() {
            return Double.parseDouble(next());
        }
	}

}


import java.io.*;
import java.util.*;

public class A {

	  public static void main(String[] args) {
	       FastScanner sc = new FastScanner();
	       int t = sc.nextInt();
	       Set<Integer> set = new HashSet<>();
	       boolean maybe = false;
	       boolean rated = false;
	       while(t-->0) {
	    	   int a = sc.nextInt();
	    	   int b = sc.nextInt();
	    	   if(a!=b)
	    		   rated = true;
	    	   if(set.contains(a))
	    		   maybe = true;
	    	   set.add(a);
	       }
	       System.out.println((rated) ? "rated" : (maybe) ? "maybe" : "unrated");
	  }

	static final Random random = new Random();

	static void sort(int[] a) {
		int n = a.length;
		for(int i =0; i<n; i++) {
			int val = random.nextInt(n);
			int cur = a[i];
			a[i] = a[val];
			a[val] = cur;
		}
		Arrays.sort(a);
	}

	static void sortl(long[] a) {
		int n = a.length;
		for(int i =0; i<n; i++) {
			int val = random.nextInt(n);
			long cur = a[i];
			a[i] = a[val];
			a[val] = cur;
		}
		Arrays.sort(a);
	}

	static class FastScanner {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st=new StringTokenizer("");
		String next() {
			while (st == null  || !st.hasMoreTokens()) {
				try {
					st=new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}
		String nextLine() {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
		}
		int nextInt() {
			return Integer.parseInt(next());
		}
		int[] readArray(int n) {
			int[] a=new int[n];
			for (int i=0; i<n; i++) a[i]=nextInt();
			return a;
		}
		long nextLong() {
			return Long.parseLong(next());
		}
		double nextDouble() {
            return Double.parseDouble(next());
        }
	}

}


import java.io.*;
import java.util.*;

public class A {

	  public static void main(String[] args) {
	       FastScanner sc = new FastScanner();
	       int n = sc.nextInt();
	       Set<Integer> set = new HashSet<>();
	       int ar[][] = new int[n][2];
	       boolean rated = false;
	       boolean unrated = false;
	       for(int i =0; i<n; i++) {
	    	   ar[i] = sc.readArray(2);
	    	   if(ar[0]!=ar[1])
	    		   rated = true;
	       }
	       if(rated) {
	    	   System.out.println("rated");
	       }else {
	    	   for(int i = 1; i<n; i++) {
	    		   if(ar[i][0] > ar[i-1][0])
	    			   unrated = true;
	    	   }
	       }
	       System.out.println((unrated) ? "unrated" : "maybe");
	  }

	static final Random random = new Random();

	static void sort(int[] a) {
		int n = a.length;
		for(int i =0; i<n; i++) {
			int val = random.nextInt(n);
			int cur = a[i];
			a[i] = a[val];
			a[val] = cur;
		}
		Arrays.sort(a);
	}

	static void sortl(long[] a) {
		int n = a.length;
		for(int i =0; i<n; i++) {
			int val = random.nextInt(n);
			long cur = a[i];
			a[i] = a[val];
			a[val] = cur;
		}
		Arrays.sort(a);
	}

	static class FastScanner {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st=new StringTokenizer("");
		String next() {
			while (st == null  || !st.hasMoreTokens()) {
				try {
					st=new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}
		String nextLine() {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
		}
		int nextInt() {
			return Integer.parseInt(next());
		}
		int[] readArray(int n) {
			int[] a=new int[n];
			for (int i=0; i<n; i++) a[i]=nextInt();
			return a;
		}
		long nextLong() {
			return Long.parseLong(next());
		}
		double nextDouble() {
            return Double.parseDouble(next());
        }
	}

}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.BufferedWriter;
import java.util.Set;
import java.util.InputMismatchException;
import java.io.IOException;
import java.util.HashSet;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Rb_wahid
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        AIsItRated solver = new AIsItRated();
        solver.solve(1, in, out);
        out.close();
    }

    static class AIsItRated {
        public void solve(int testNumber, InputReader in, OutputWriter out) {
            Set<Integer> set = new HashSet<>();
            int n = in.nextInt();
            String ans;
            for (int i = 0; i < n; i++) {
                set.add(in.nextInt());
                set.add(in.nextInt());
            }
            if (set.size() == n)
                ans = "unrated";
            else if (set.size() > n)
                ans = "rated";
            else
                ans = "maybe";

            out.println(ans);

        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private InputReader.SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }

    static class OutputWriter {
        private final PrintWriter writer;

        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }

        public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
        }

        public void print(Object... objects) {
            for (int i = 0; i < objects.length; i++) {
                if (i != 0) {
                    writer.print(' ');
                }
                writer.print(objects[i]);
            }
        }

        public void println(Object... objects) {
            print(objects);
            writer.println();
        }

        public void close() {
            writer.close();
        }

    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.BufferedWriter;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Rb_wahid
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        AIsItRated solver = new AIsItRated();
        solver.solve(1, in, out);
        out.close();
    }

    static class AIsItRated {
        public void solve(int testNumber, InputReader in, OutputWriter out) {

            int n = in.nextInt();

            int[][] arr = new int[n][2];
            for (int i = 0; i < n; i++) {
                arr[i][0] = in.nextInt();
                arr[i][1] = in.nextInt();

                if (arr[i][0] != arr[i][1]) {
                    out.println("rated");
                    return;
                }
            }

            for (int i = 1; i < n; i++) {
                if (arr[i][0] > arr[i - 1][0]) {
                    out.println("unrated");
                    return;
                }
            }

            out.println("maybe");

        }

    }

    static class OutputWriter {
        private final PrintWriter writer;

        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }

        public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
        }

        public void print(Object... objects) {
            for (int i = 0; i < objects.length; i++) {
                if (i != 0) {
                    writer.print(' ');
                }
                writer.print(objects[i]);
            }
        }

        public void println(Object... objects) {
            print(objects);
            writer.println();
        }

        public void close() {
            writer.close();
        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private InputReader.SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.BufferedWriter;
import java.util.Set;
import java.util.InputMismatchException;
import java.io.IOException;
import java.util.HashSet;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Rb_wahid
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        AIsItRated solver = new AIsItRated();
        solver.solve(1, in, out);
        out.close();
    }

    static class AIsItRated {
        public void solve(int testNumber, InputReader in, OutputWriter out) {
            Set<Integer> set = new HashSet<>();
            int n = in.nextInt();
            String ans = "maybe";
            int[][] arr = new int[n][2];
            for (int i = 0; i < n; i++) {
                arr[i][0] = in.nextInt();
                arr[i][1] = in.nextInt();
            }

            for (int i = 0; i < n; i++) {
                if (arr[i][0] != arr[i][1]) {
                    ans = "rated";
                    break;
                } else if (arr[i][0] == arr[i][1]) {
                    set.add(arr[i][0]);
                }
            }

            if (set.size() == n)
                ans = "unrated";

            out.println(ans);

        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private InputReader.SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }

    static class OutputWriter {
        private final PrintWriter writer;

        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }

        public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
        }

        public void print(Object... objects) {
            for (int i = 0; i < objects.length; i++) {
                if (i != 0) {
                    writer.print(' ');
                }
                writer.print(objects[i]);
            }
        }

        public void println(Object... objects) {
            print(objects);
            writer.println();
        }

        public void close() {
            writer.close();
        }

    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.BufferedWriter;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Rb_wahid
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        AIsItRated solver = new AIsItRated();
        solver.solve(1, in, out);
        out.close();
    }

    static class AIsItRated {
        public void solve(int testNumber, InputReader in, OutputWriter out) {

            int n = in.nextInt();

            int[][] arr = new int[n][2];
            for (int i = 0; i < n; i++) {
                arr[i][0] = in.nextInt();
                arr[i][1] = in.nextInt();

                if (arr[i][0] != arr[i][1]) {
                    out.println("rated");
                    return;
                }
            }

            for (int i = 0; i < n; i++) {
                if (arr[i][0] < arr[i][1]) {
                    out.println("unrated");
                    return;
                }
            }

            out.println("maybe");

        }

    }

    static class OutputWriter {
        private final PrintWriter writer;

        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }

        public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
        }

        public void print(Object... objects) {
            for (int i = 0; i < objects.length; i++) {
                if (i != 0) {
                    writer.print(' ');
                }
                writer.print(objects[i]);
            }
        }

        public void println(Object... objects) {
            print(objects);
            writer.println();
        }

        public void close() {
            writer.close();
        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private InputReader.SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.BufferedWriter;
import java.util.Set;
import java.util.InputMismatchException;
import java.io.IOException;
import java.util.HashSet;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Rb_wahid
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        AIsItRated solver = new AIsItRated();
        solver.solve(1, in, out);
        out.close();
    }

    static class AIsItRated {
        public void solve(int testNumber, InputReader in, OutputWriter out) {
            Set<Integer> set = new HashSet<>();
            int n = in.nextInt();
            String ans;
            for (int i = 0; i < n; i++) {
                set.add(in.nextInt());
                set.add(in.nextInt());
            }
            if (set.size() < n)
                ans = "maybe";
            else if (set.size() > n)
                ans = "rated";
            else
                ans = "unrated";

            out.println(ans);

        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private InputReader.SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }

    static class OutputWriter {
        private final PrintWriter writer;

        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }

        public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
        }

        public void print(Object... objects) {
            for (int i = 0; i < objects.length; i++) {
                if (i != 0) {
                    writer.print(' ');
                }
                writer.print(objects[i]);
            }
        }

        public void println(Object... objects) {
            print(objects);
            writer.println();
        }

        public void close() {
            writer.close();
        }

    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class isitrated {

	public static void main (String []args) throws IOException{
		BufferedReader br =new BufferedReader (new InputStreamReader(System.in));
		String s;
		int iu;
		StringTokenizer st=new StringTokenizer(br.readLine());
		int x=Integer.parseInt(st.nextToken());
		PrintWriter out=new PrintWriter(System.out);
		int prevz=10000;
		boolean flag=true;
		boolean flag2=true;
		for(int i=0;i<x&&flag;i++){
			st=new StringTokenizer(br.readLine());
			int y=Integer.parseInt(st.nextToken());
			int z=Integer.parseInt(st.nextToken());
			if(!(z==y)){
				flag=false;}

			if(z>prevz){
				flag2=false;
		}
			prevz=z;}
		if(flag){
			if(flag2){
				out.println("maybe");
			}
			else
				out.println("unrated");
		}
		else
			out.print("rated");
		out.flush();

	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class isitrated {

	public static void main (String []args) throws IOException{
		BufferedReader br =new BufferedReader (new InputStreamReader(System.in));
		String s;
		int yyy;
		StringTokenizer st=new StringTokenizer(br.readLine());
		int x=Integer.parseInt(st.nextToken());
		PrintWriter out=new PrintWriter(System.out);
		int prevz=10000;
		boolean flag=true;
		boolean flag2=true;
		for(int i=0;i<x&&flag;i++){
			st=new StringTokenizer(br.readLine());
			int y=Integer.parseInt(st.nextToken());
			int z=Integer.parseInt(st.nextToken());
			if(!(z==y)){
				flag=false;}

			if(z>prevz){
				flag2=false;
		}
			prevz=z;}
		if(flag){
			if(flag2){
				out.println("maybe");
			}
			else
				out.println("unrated");
		}
		else
			out.print("rated");
		out.flush();

	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class isitrated {

	public static void main (String []args) throws IOException{
		BufferedReader br =new BufferedReader (new InputStreamReader(System.in));
		String s;
		StringTokenizer st=new StringTokenizer(br.readLine());
		int x=Integer.parseInt(st.nextToken());
		PrintWriter out=new PrintWriter(System.out);
		int prevz=10000;
		boolean flag=true;
		boolean flag2=true;
		for(int i=0;i<x&&flag;i++){
			st=new StringTokenizer(br.readLine());
			int y=Integer.parseInt(st.nextToken());
			int z=Integer.parseInt(st.nextToken());
			if(!(z==y)){
				flag=false;}

			if(z>prevz){
				flag2=false;
		}
			prevz=z;}
		if(flag){
			if(flag2){
				out.println("maybe");
			}
			else
				out.println("unrated");
		}
		else
			out.print("rated");
		out.flush();

	}
}


import java.util.*;
public class A807{
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		for (int i=0;i<n;++i){
		int a=sc.nextInt();
		int b=sc.nextInt();
		if(a!=b){System.out.println("rated"); break;}
		}
	}
}


import java.util.*;
public class A807{
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int a[]=new int [n];
		int b[]=new int [n];
		for (int i=0;i<n;++i){
		a[i]=sc.nextInt();
		b[i]=sc.nextInt();
		if(a[i]!=b[i]){System.out.println("rated"); System.exit(0);}
		if(i>0 && a[i]>a[i-1]) {System.out.println("unrated"); System.exit(0);}
		}
		System.out.println("maybe");
	}
}


import java.util.*;
public class A807{
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int c=0,x=0;
		int a=sc.nextInt();
		int b=sc.nextInt();
		x=a;
		for (int i=0;i<n-1;++i){
		a=sc.nextInt();
		b=sc.nextInt();
		if(a!=b){System.out.println("rated"); System.exit(0);}
		else if(x>=a) {c++;}
		else if(x<a) {c--;}
		x=a;
		}
		if(c==n-1) System.out.println("maybe");
		else System.out.println("unrated");
	}
}


import java.util.*;
public class A807{
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int c=0,x=0;
		int a=sc.nextInt();
		int b=sc.nextInt();
		if(a!=b){System.out.println("rated"); System.exit(0);}
		x=a;
		for (int i=0;i<n-1;++i){
		a=sc.nextInt();
		b=sc.nextInt();
		if(a!=b){System.out.println("rated"); System.exit(0);}
		else if(x>=a) {c++;}
		else if(x<a) {c--;}
		x=a;
		}
		if(c==n-1) System.out.println("maybe");
		else System.out.println("unrated");
	}
}


import java.util.*;
public class A807{
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int a[]=new int [n];
		int b[]=new int [n];
        boolean x=false;
		for (int i=0;i<n;++i){
		a[i]=sc.nextInt();
		b[i]=sc.nextInt();
		if(a[i]!=b[i]){System.out.println("rated"); System.exit(0);}
		if(i>0 && a[i]>a[i-1]) x=true;
		}
		if(x) System.out.println("unrated");
		else System.out.println("maybe");
	}
}


import java.util.*;
public class A807{
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int a[]=new int [n];
		int b[]=new int [n];
        boolean x=false;
		for (int i=0;i<n-1;++i){
		a[i]=sc.nextInt();
		b[i]=sc.nextInt();
		if(a[i]!=b[i]){System.out.println("rated"); System.exit(0);}
		if(i>0 && a[i]>a[i-1]) x=true;
		}
		if(x) System.out.println("unrated");
		else System.out.println("maybe");
	}
}


import java.util.*;
public class A807{
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int c=0,x=0;
		int a=sc.nextInt();
		int b=sc.nextInt();
		x=a;
		for (int i=0;i<n-1;++i){
		a=sc.nextInt();
		b=sc.nextInt();
		if(a!=b){System.out.println("rated"); System.exit(0);}
		else if(x>a){c++;}
		x=a;
		}
		if(c>1) System.out.println("maybe");
		else System.out.println("unrated");
	}
}


import java.util.Scanner;
//import java.util.Arrays;

public class Code {

    public static void main(String[] args) {

        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int[][] score = new int[n][2];

        boolean unrated = true;
        boolean rated = false;
        boolean maybe = false;

        for (int i = 0; i < n; i++) {
            score[i][0] = in.nextInt();
            score[i][1] = in.nextInt();

            if (score[i][0] != score[i][1]) {
                unrated = false;
                rated = true;
            }
        }

        for (int i = 0; i < score.length; i++) {

            if (i != score.length - 1 && score[i][1] == score[i+1][1]){
                maybe = true;
            }

        }

        if (rated){
            System.out.println("rated");
        }else if (maybe){
            System.out.println("maybe");
        } else {
            System.out.println("unrated");
        }

    }
}


import java.util.Scanner;
//import java.util.Arrays;

public class Code {

    public static void main(String[] args) {

        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int[][] score = new int[n][2];

        boolean unrated = true;
        boolean rated = false;
        boolean maybe = false;

        for (int i = 0; i < n; i++) {
            score[i][0] = in.nextInt();
            score[i][1] = in.nextInt();

            if (score[i][0] != score[i][1]) {
                unrated = false;
                rated = true;
            }
        }

        for (int i = 0; i < score.length; i++) {

            if (i != score.length - 1 && score[i][1] == score[i+1][1]){
                maybe = true;
            }

        }

           boolean ch = true;

        for (int i = 0; i < score.length - 1; i++) {

            if (!(score[i][1] > score[i + 1][1])){
                ch = false;
            }

        }

        if (rated){
            System.out.println("rated");
        }else if (maybe || ch){
            System.out.println("maybe");
        } else {
            System.out.println("unrated");
        }

    }
}


import java.io.*;
import java.util.*;

public class Code {

    static InputReader in = new InputReader(System.in);

    public static void main(String[] args) {

        //Scanner in = new Scanner(System.in);
        int n = in.nextInt();

        int[][] grades = new int[n][2];
        for (int i = 0; i < n; i++) {
            grades[i][0] = in.nextInt();
            grades[i][1] = in.nextInt();
            if (grades[i][0] != grades[i][1]) {
                System.out.println("rated");
                System.exit(0);
            }
        }
        boolean unr = true;
        for (int i = 0; i < grades.length - 1; i++) {
            if (grades[i][0] < grades[i + 1][0]) {
                unr = false;
            }
        }
        if (unr) {
            System.out.println("maybe");
        } else {
            System.out.println("unrated");
        }
    }

}

class InputReader {

    private final InputStream stream;
    private final byte[] buf = new byte[8192];
    private int curChar, snumChars;

    public InputReader(InputStream st) {
        this.stream = st;
    }

    public int read() {
        if (snumChars == -1) {
            throw new InputMismatchException();
        }
        if (curChar >= snumChars) {
            curChar = 0;
            try {
                snumChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (snumChars <= 0) {
                return -1;
            }
        }
        return buf[curChar++];
    }

    public int nextInt() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public long nextLong() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        long res = 0;
        do {
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public int[] nextIntArray(int n) {
        int a[] = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = nextInt();
        }
        return a;
    }

    public String readString() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isSpaceChar(c));
        return res.toString();
    }

    public String nextLine() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isEndOfLine(c));
        return res.toString();
    }

    public boolean isSpaceChar(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    private boolean isEndOfLine(int c) {
        return c == '\n' || c == '\r' || c == -1;
    }

}


import java.util.Scanner;
//import java.util.Arrays;

public class Code {

    public static void main(String[] args) {

        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int[][] score = new int[n][2];

        boolean unreated = true;
        boolean reated = false;
        boolean mybae = false;

        for (int i = 0; i < n; i++) {
            score[i][0] = in.nextInt();
            score[i][1] = in.nextInt();

            if (score[i][0] != score[i][1]) {
                unreated = false;
                reated = true;
            }
        }

        for (int i = 0; i < score.length; i++) {
            for (int j = 0; j < score.length; j++) {

                if(j != i && score[i][1] == score[j][1]){
                    mybae = true;
                }

            }

        }

        if (mybae){
            System.out.println("maybe");
        }else if (reated){
            System.out.println("rated");
        } else {
            System.out.println("unrated");
        }

    }
}


import java.util.Scanner;
//import java.util.Arrays;

public class Code {

    public static void main(String[] args) {

        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int[][] score = new int[n][2];

        boolean unreated = true;
        boolean reated = false;
        boolean maybe = false;

        for (int i = 0; i < n; i++) {
            score[i][0] = in.nextInt();
            score[i][1] = in.nextInt();

            if (score[i][0] != score[i][1]) {
                unreated = false;
                reated = true;
            }
        }

        for (int i = 0; i < score.length; i++) {
            for (int j = 0; j < score.length; j++) {

                if(j != i && score[i][1] == score[j][1]){
                    maybe = true;
                }

            }

        }

        if (reated){
            System.out.println("rated");
        }else if (maybe){
            System.out.println("maybe");
        } else {
            System.out.println("unrated");
        }

    }
}


import java.util.Scanner;
//import java.util.Arrays;

public class Code {

    public static void main(String[] args) {

        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int[][] score = new int[n][2];

        boolean unrated = true;
        boolean rated = false;
        boolean maybe = false;

        for (int i = 0; i < n; i++) {
            score[i][0] = in.nextInt();
            score[i][1] = in.nextInt();

            if (score[i][0] != score[i][1]) {
                unrated = false;
                rated = true;
            }
        }

        for (int i = 0; i < score.length; i++) {
            for (int j = 0; j < score.length; j++) {

                if(j != i && score[i][1] == score[j][1] && unrated){
                    maybe = true;
                }

            }

        }

        if (rated){
            System.out.println("rated");
        }else if (maybe){
            System.out.println("maybe");
        } else {
            System.out.println("unrated");
        }

    }
}


import java.io.*;
import java.util.*;

public class Code {

    static InputReader in = new InputReader(System.in);

    public static void main(String[] args) {

        //Scanner in = new Scanner(System.in);
        int n = in.nextInt();

        int[][] grades = new int[n][2];
        for (int i = 0; i < n; i++) {
            grades[i][0] = in.nextInt();
            grades[i][1] = in.nextInt();
            if (grades[i][0] != grades[i][1]) {
                System.out.println("rated");
                System.exit(0);
            }
        }
        boolean unr = true;
        for (int i = 0; i < grades.length - 1; i++) {
            if (grades[i][0] < grades[i + 1][0]) {
                unr = false;
            }
        }
        if (unr) {
            System.out.println("unrated");
        } else {
            System.out.println("maybe");
        }
    }

}

class InputReader {

    private final InputStream stream;
    private final byte[] buf = new byte[8192];
    private int curChar, snumChars;

    public InputReader(InputStream st) {
        this.stream = st;
    }

    public int read() {
        if (snumChars == -1) {
            throw new InputMismatchException();
        }
        if (curChar >= snumChars) {
            curChar = 0;
            try {
                snumChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (snumChars <= 0) {
                return -1;
            }
        }
        return buf[curChar++];
    }

    public int nextInt() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public long nextLong() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        long res = 0;
        do {
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public int[] nextIntArray(int n) {
        int a[] = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = nextInt();
        }
        return a;
    }

    public String readString() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isSpaceChar(c));
        return res.toString();
    }

    public String nextLine() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isEndOfLine(c));
        return res.toString();
    }

    public boolean isSpaceChar(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    private boolean isEndOfLine(int c) {
        return c == '\n' || c == '\r' || c == -1;
    }

}


import java.util.Scanner;
//import java.util.Arrays;

public class Code {

    public static void main(String[] args) {

        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int[][] score = new int[n][2];

        boolean unreated = true;
        boolean reated = false;
        boolean maybe = false;

        for (int i = 0; i < n; i++) {
            score[i][0] = in.nextInt();
            score[i][1] = in.nextInt();

            if (score[i][0] != score[i][1]) {
                unreated = false;
                reated = true;
            }
        }

        for (int i = 0; i < score.length; i++) {
            for (int j = 0; j < score.length; j++) {

                if(j != i && score[i][1] == score[j][1]){
                    maybe = true;
                }

            }

        }

        if (reated){
            System.out.println("maybe");
        }else if (maybe){
            System.out.println("rated");
        } else {
            System.out.println("unrated");
        }

    }
}


import java.util.Scanner;
//import java.util.Arrays;

public class Code {

    public static void main(String[] args) {

        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int[][] score = new int[n][2];

        boolean unreated = true;
        boolean reated = false;
        boolean maybe = false;

        for (int i = 0; i < n; i++) {
            score[i][0] = in.nextInt();
            score[i][1] = in.nextInt();

            if (score[i][0] != score[i][1]) {
                unreated = false;
                reated = true;
            }
        }

        for (int i = 0; i < score.length; i++) {
            for (int j = 0; j < score.length; j++) {

                if(j != i && score[i][1] == score[j][1] && unreated){
                    maybe = true;
                }

            }

        }

        if (reated){
            System.out.println("rated");
        }else if (maybe){
            System.out.println("maybe");
        } else {
            System.out.println("unreated");
        }

    }
}


import java.util.Scanner;
//import java.util.Arrays;

public class Code {

    public static void main(String[] args) {

        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int[][] score = new int[n][2];

        boolean unrated = true;
        boolean rated = false;
        boolean maybe = false;

        for (int i = 0; i < n; i++) {
            score[i][0] = in.nextInt();
            score[i][1] = in.nextInt();

            if (score[i][0] != score[i][1]) {
                unrated = false;
                rated = true;
            }
        }

        for (int i = 0; i < score.length; i++) {

            if (i != score.length - 1 && score[i][1] == score[i+1][1]){
                maybe = true;
            }

        }

           boolean ch = true;

        for (int i = 0; i < score.length - 1; i++) {

            if (!(score[i][1] < score[i + 1][1])){
                ch = false;
            }

        }

        if (rated){
            System.out.println("rated");
        }else if (maybe || ch){
            System.out.println("maybe");
        } else {
            System.out.println("unrated");
        }

    }
}


import java.util.Scanner;
import java.util.StringTokenizer;
public class tester {
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int n = Integer.parseInt(scan.nextLine());
		int[] before = new int[n];
		int[] after = new int[n];
		for(int i = 0; i < n; i++) {
			StringTokenizer st = new StringTokenizer(scan.nextLine());
			before[i] = Integer.parseInt(st.nextToken());
			after[i] = Integer.parseInt(st.nextToken());
		}
		if(checkChanges(before, after)) {
			System.out.println("rated");
		}
		else if(!checkChanges(before, after) && unsorted(after)) {
			System.out.println("unrated");
		}
		else {
			System.out.println("maybe");
		}
	}
	public static boolean checkChanges(int[] before, int[] after) {
		for(int i = 0; i < before.length; i++) {
			if(before[i] != after[i]) {
				return true;
			}
		}
		return false;
	}
	public static boolean unsorted(int[] after) {
		int past = after[0];
		for(int i = 0; i < after.length; i++) {
			if(past < after[i]) {
				return true;
			}
			past = after[i];
		}
		return false;
	}
}


import java.util.Scanner;
import java.util.StringTokenizer;
public class tester {
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int n = Integer.parseInt(scan.nextLine());
		int[] before = new int[n];
		int[] after = new int[n];
		for(int i = 0; i < n; i++) {
			StringTokenizer st = new StringTokenizer(scan.nextLine());
			before[i] = Integer.parseInt(st.nextToken());
			after[i] = Integer.parseInt(st.nextToken());
		}
		if(checkChanges(before, after)) {
			System.out.println("rated");
		}
		else if(!checkChanges(before, after) && unsorted(after)) {
			System.out.println("unrated");
		}
		else if(!checkChanges(before, after) && increasing(after)) {
			System.out.println("unrated");
		}
		else {
			System.out.println("maybe");
		}
	}
	public static boolean checkChanges(int[] before, int[] after) {
		for(int i = 0; i < before.length; i++) {
			if(before[i] != after[i]) {
				return true;
			}
		}
		return false;
	}
	public static boolean unsorted(int[] after) {
		int past = after[after.length-1];
		for(int i = after.length-1; i > -1; i--) {
			if(past > after[i]) {
				return true;
			}
			past = after[i];
		}
		return false;
	}
	public static boolean increasing(int[] after) {
		int past = after[0];
		for(int i = 0; i < after.length; i++) {
			if(past > after[i]) {
				return true;
			}
			past = after[i];
		}
		return false;
	}
}


import java.util.Scanner;
import java.util.StringTokenizer;
public class tester {
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int n = Integer.parseInt(scan.nextLine());
		int[] before = new int[n];
		int[] after = new int[n];
		for(int i = 0; i < n; i++) {
			StringTokenizer st = new StringTokenizer(scan.nextLine());
			before[i] = Integer.parseInt(st.nextToken());
			after[i] = Integer.parseInt(st.nextToken());
		}
		if(checkChanges(before, after)) {
			System.out.println("rated");
		}
		else if(!checkChanges(before, after) && unsorted(after)) {
			System.out.println("unrated");
		}
		else {
			System.out.println("maybe");
		}
	}
	public static boolean checkChanges(int[] before, int[] after) {
		for(int i = 0; i < before.length; i++) {
			if(before[i] != after[i]) {
				return true;
			}
		}
		return false;
	}
	public static boolean unsorted(int[] after) {
		if(after[0] < after[after.length-1]) {
			int past = after[0];
			for(int i = 0; i < after.length; i++) {
				if(past > after[i]) {
					return true;
				}
				past = after[i];
			}
			return false;
		}
		else {
			int past = after[after.length-1];
			for(int i = after.length-1; i > -1; i--) {
				if(past > after[i]) {
					return true;
				}
				past = after[i];
			}
			return false;
		}
	}
}


import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc= new Scanner(System.in);
		int num=sc.nextInt();
		int[] arr1=new int[num];
		int[] arr2=new int[num];
		boolean change=false;
		boolean isSorted=true;
		int prev=0;
		for(int x=0;x<num;x++) {
			arr1[x]=sc.nextInt();
			arr2[x]=sc.nextInt();
			if(arr1[x]!=arr2[x]) {
				change=true;
			}
			if(x==0) {
				prev=arr1[x];
			}else {
				if(prev<arr1[x]) {
					isSorted=false;
				}
				prev=arr1[x];
			}

		}
		if(change) {
			System.out.println("rated");
		}else if(!change&isSorted) {
			System.out.println("maybe");
		}else {
			System.out.println("unrated");
		}

	}
}


import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc= new Scanner(System.in);
		int num=sc.nextInt();
		int[] arr1=new int[num];
		int[] arr2=new int[num];
		boolean change=false;
		boolean repeat=false;
		int prev=0;
		for(int x=0;x<num;x++) {
			arr1[x]=sc.nextInt();
			arr2[x]=sc.nextInt();
			if(arr1[x]!=arr2[x]) {
				change=true;
			}
			if(x==0) {
				prev=arr1[x];
			}else {
				if(prev==arr1[x]) {
					repeat=true;
				}
				prev=arr1[x];
			}

		}
		if(change) {
			System.out.println("rated");
		}else if(!change&repeat) {
			System.out.println("maybe");
		}else {
			System.out.println("unrated");
		}

	}
}


import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n=sc.nextInt();
		int[] bef=new int[n];
		int[] aft=new int[n];

		Boolean change=false;
		Boolean sorted=true;

		for(int i=0;i<n;i++) {
			bef[i]=sc.nextInt();
			aft[i]=sc.nextInt();
			if(bef[i]!=aft[i]) {
				change=true;
			}
		}

		if(!change) {
			for(int i=0;i<n-1;i++) {
				if(bef[i]<bef[i+1]) {
					sorted=false;
				}
			}
		}

		if(change) {
			System.out.println("rated");
		}else if(!sorted) {
			System.out.println("unrated");
		}else {
			System.out.println("maybe");
		}

	}
}


import java.util.*;
public class Main {

	public static void main(String[] args) {
		Scanner sc= new Scanner(System.in);
		int number=sc.nextInt();
		boolean flag=true;
		int[] arr= new int[number];
		int[] arry=new int[number];
		int i=0;
		for (i=0;i<number;i++) {
			arr[i]=sc.nextInt();
			arry[i]=sc.nextInt();
		}
		for (i=0;i<number-1;i++) {
			if (arr[i]<arr[i+1]) {
				flag=false;
			}
		}
		for (i=0;i<number;i++) {
			if (arr[i]!=arry[i]) {
				System.out.println("rated");
				break;
			}
			if (i==number-1) {
				if (flag==false) {
					System.out.println("unrated");
				}else {
					System.out.print("maybe");
				}
			}
		}
	}
}


import java.util.*;
public class D2N1 {
	public static void main(String[]args) {
		Scanner sc= new Scanner(System.in);
		int people= sc.nextInt();
		int first=sc.nextInt();
		int sec=sc.nextInt();
boolean notmaybe= true;

		for (int i=1; i<people;i++) {
			if (first!=sec) {
			System.out.println("rated");
			break;
		}
			int f= sc.nextInt();
			int s= sc.nextInt();
			if (f!=s) {
				System.out.println("rated");
				break;
			}
			else {
				if ( first<f || sec<s) {
	 System.out.println("unrated");
				break;}
			}
	first=f;
		sec=s;
	if (i==people-1){
			System.out.println("maybe");
	}

		}

	}

}


import java.util.*;
public class D2N1 {
	public static void main(String[]args) {
		rated();}

		public static void rated() {
		Scanner sc= new Scanner(System.in);
		int n= sc.nextInt();
		int[][]a= new int[n][2];
		for (int i=0; i<n;i++) {
			for (int j=0; j<2;j++) {
				a[i][j]= sc.nextInt();
}
		}
		for (int k=0;k<n;k++) {
			if(a[k][0]!=a[k][1]) {
				System.out.println("rated");

return;}}

for (int m=0; m<n-1;m++) {
if( (a[m][0]<a[m+1][0]) ||(a[m][1]< a[m+1][1])) {
		System.out.println("unrated");

			return;
			}}

				System.out.println("maybe");

	}
}