#include <bits/stdc++.h>
using namespace std;
int main() {
  long n;
  cin >> n;
  array<long, 2> a[n], b[n];
  long i;
  for (i = 0; i < n; i++) {
    cin >> a[i][0] >> a[i][1];
  }
  for (i = 0; i < n; i++) {
    if (a[i][0] != a[i][1]) {
      cout << "rated";
      return 0;
    }
  }
  for (i = 0; i < n - 1; i++) {
    if (a[i][0] < a[i + 1][0]) {
      cout << "unrated";
      return 0;
    }
  }
  cout << "maybe";
  return 0;
}
