#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  vector<pair<int, int>> vec;
  int n, a, b;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a >> b;
    if (a != b) {
      cout << "rated";
      return 0;
    }
    vec.push_back({a, b});
  }
  for (int i = 0; i < vec.size() - 1; i++) {
    if (vec[i].first < vec[i + 1].first) {
      cout << "unrated";
      return 0;
    }
  }
  cout << "maybe";
}
