#include <bits/stdc++.h>
using namespace std;
int a, b, aa[100000], bb[100000], tk, i, j;
int main() {
  int cnt = 0, flg = 0, flg2 = 0, temp, kk = 0;
  scanf("%d", &tk);
  temp = tk;
  int kkk = 99999;
  while (tk--) {
    scanf("%d%d", &i, &j);
    if (i <= kkk) {
      kkk = i;
      kk++;
    } else
      flg2 = 1;
    if (i == j) cnt++;
    if (i != j) flg = 1;
  }
  if (flg == 1)
    printf("rated\n");
  else if (temp != kk)
    printf("unrated\n");
  else if (temp == kk)
    printf("maybe\n");
  return 0;
}
