#include <bits/stdc++.h>
using namespace std;
struct D {
  int a, b;
};
bool comp(D x, D y) { return x.a > y.a; }
int main() {
  int n;
  cin >> n;
  D A[1010];
  D B[1010];
  int ok = 0;
  for (int i = 0; i < n; i++) {
    cin >> A[i].a >> A[i].b;
    B[i].a = A[i].a;
    B[i].b = A[i].b;
    if (abs(A[i].a - A[i].b) > 0) ok = 1;
  }
  if (ok) return cout << "rated\n", 0;
  sort(A, A + n, comp);
  for (int i = 0; i < n; i++) {
    if (A[i].a != B[i].a) return cout << "unrated\n", 0;
  }
  return cout << "maybe\n", 0;
}
