#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int n;
  cin >> n;
  long long int type = 0, val;
  for (long long int i = 0; i < n; ++i) {
    long long int a, b;
    cin >> a;
    cin >> b;
    if (a != b) {
      type = 1;
      break;
    }
    if (i > 0 && a > val) {
      type = 2;
    }
    val = a;
  }
  if (type == 1) {
    cout << "rated\n";
  } else if (type == 2) {
    cout << "unrated\n";
  } else {
    cout << "maybe\n";
  }
  return 0;
}
