#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x, y;
  cin >> n;
  bool flag = false;
  vector<pair<int, int> > v;
  for (int i = 0; i < n; i++) {
    cin >> x >> y;
    if (x != y) flag = true;
    v.push_back(make_pair(x, y));
  }
  if (flag) {
    cout << "rated" << endl;
  } else {
    flag = false;
    vector<pair<int, int> > vx = v;
    sort(vx.rbegin(), vx.rend());
    for (int i = 0; i < n; i++) {
      if (vx[i].first == v[i].first && vx[i].second == v[i].second)
        continue;
      else
        flag = true;
    }
    if (flag)
      cout << "unrated" << endl;
    else
      cout << "maybe" << endl;
  }
}
