#include <bits/stdc++.h>
using namespace std;
int const diffli = 'a' - 'A';
int const oo = 2147483647;
int const loo = 1e18 + 9;
vector<int> arr;
int binary(int val) {
  int start = 0;
  int end = arr.size() - 1;
  while (start < end) {
    int mid = start + (end - start) / 2;
    if (arr[mid] < val)
      start = mid + 1;
    else if (arr[mid] > val)
      end = mid - 1;
    else if (start == mid)
      end = mid;
    else
      start = mid;
  }
  return start;
}
int gcd(int u, int v) {
  while (v != 0) {
    int r = u % v;
    u = v;
    v = r;
  }
  return u;
}
int main() {
  int n;
  cin >> n;
  ;
  int last;
  bool test = 0;
  int u;
  cin >> u;
  ;
  int v;
  cin >> v;
  ;
  last = u;
  if (u - v != 0) {
    cout << "rated";
    return 0;
  }
  n--;
  for (int i = 0; i < n; i++) {
    cin >> u >> v;
    if (u - v != 0) {
      cout << "rated";
      return 0;
    }
    if (u > last) test = 1;
    last = u;
  }
  if (test)
    cout << "unrated";
  else
    cout << "maybe";
}
