#include <bits/stdc++.h>
using namespace std;
int main(void) {
  ios ::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  vector<pair<int, int> > data(n);
  for (int i = 0; i <= n - 1; ++i) {
    cin >> data[i].first >> data[i].second;
  }
  for (int i = 0; i <= n - 1; ++i) {
    if (data[i].first != data[i].second) {
      cout << "rated" << endl;
      return 0;
    }
  }
  if (is_sorted(data.begin(), data.end(), greater<pair<int, int> >())) {
    cout << "maybe" << endl;
  } else {
    cout << "unrated" << endl;
  }
  return 0;
}
