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