#include <bits/stdc++.h>
using namespace std;
long long int a[1005], b[1005], c[1005];
int main() {
  long long int n, flag = 0;
  cin >> n;
  for (long long int i = 0; i < n; i++) {
    cin >> a[i] >> b[i];
    c[i] = a[i];
  }
  for (long long int i = 0; i < n; i++) {
    if (a[i] != b[i]) {
      flag = 1;
      break;
    }
  }
  if (flag)
    cout << "rated" << endl;
  else {
    long long int flag1 = 0;
    sort(c, c + n);
    long long int k = 0;
    for (long long int i = n - 1; i >= 0; i--) {
      if (a[k] != c[i]) {
        flag1 = 1;
        break;
      }
      k++;
    }
    if (flag1 == 0)
      cout << "maybe" << endl;
    else
      cout << "unrated" << endl;
  }
  return 0;
}
