#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  vector<pair<long long, long long> > v;
  cin >> n;
  for (int i = 0; i < n; i++) {
    long long x, y;
    cin >> x >> y;
    v.push_back({x, y});
  }
  for (int i = 0; i < n; i++) {
    if (v[i].first != v[i].second) {
      cout << "rated" << endl;
      return 0;
    }
  }
  for (int i = 1; i < n; i++) {
    for (int j = 0; j < i; j++) {
      if (v[j].first < v[i].first) {
        cout << "unrated" << endl;
        return 0;
      }
    }
  }
  cout << "maybe" << endl;
  return 0;
}
