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