#include <bits/stdc++.h>
using namespace std;
int n;
vector<pair<int, int> > p;
int main() {
  ios ::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 1, x, y; i <= n; ++i) {
    cin >> x >> y, p.push_back({x, n - i + 1});
    if (x != y) {
      cout << "rated";
      return 0;
    };
  }
  sort(p.begin(), p.end());
  int MAX = 0;
  for (int i = 0; i < p.size(); ++i) {
    if (p[i].second < MAX) {
      cout << "unrated";
      return 0;
    };
    MAX = max(MAX, p[i].second);
  }
  cout << "maybe";
}
