#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  bool rated = 0;
  vector<int> a(n);
  vector<int> sorted(n);
  for (int i = 0; i < n; i++) {
    int b;
    cin >> a[i];
    sorted[i] = a[i];
    cin >> b;
    if (a[i] != b) rated = 1;
  }
  if (rated)
    cout << "rated\n";
  else {
    sort(sorted.rbegin(), sorted.rend());
    if (sorted == a)
      cout << "maybe\n";
    else
      cout << "unrated\n";
  }
  return 0;
}
