#include <bits/stdc++.h>
using namespace std;
string s[3] = {"maybe", "unrated", "rated"};
int main() {
  int n;
  int flag = 0;
  scanf("%d", &n);
  int a, b, temp = 5233;
  for (int i = 0; i < n; i++) {
    scanf("%d%d", &a, &b);
    if (a != b) flag = 2;
    if (flag == 0 && a > temp) flag = 1;
    temp = a;
  }
  cout << s[flag] << endl;
}
