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