#include <bits/stdc++.h>
using namespace std;
void solve(int a[], int b[], int t) {
  int temp = 0;
  for (int i = 0; i < t; i++) {
    cin >> a[i] >> b[i];
    if (a[i] != b[i]) {
      temp = 1;
    }
  }
  int temp1 = -1;
  for (int i = 1; i < t; i++) {
    if ((a[i] > a[i - 1]) || (b[i] > b[i - 1])) {
      temp1 = -2;
      break;
    }
  }
  if (temp1 == -1 && temp == 0) {
    cout << "maybe" << endl;
  } else if (temp == 1) {
    cout << "rated" << endl;
    return;
  } else if (temp == 0) {
    cout << "unrated" << endl;
    return;
  }
}
int main() {
  int t;
  cin >> t;
  int a[t], b[t];
  solve(a, b, t);
}
