#include <bits/stdc++.h>
int x[1000], y[1000];
using namespace std;
int main() {
  int n, counter = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> x[i] >> y[i];
    if (x[i] != y[i]) {
      cout << "rated";
      return 0;
    }
  }
  for (int i = 0; i < n; i++) {
    if (x[i] < x[i + 1]) {
      cout << "unrated";
      return 0;
    }
  }
  cout << "maybe";
  return 0;
}
