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