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