#include <bits/stdc++.h>
using namespace std;
struct node {
  int a, b, index;
} p[1050];
bool cmp(node a, node b) {
  if (a.a == b.a) return a.index < b.index;
  return a.a > b.a;
}
int main() {
  int n;
  scanf("%d", &n);
  int temp = n;
  for (int i = 1; i <= n; ++i) {
    scanf("%d%d", &p[i].a, &p[i].b);
    p[i].index = i;
  }
  sort(p + 1, p + n + 1, cmp);
  int flag = 0;
  for (int i = 1; i <= n; ++i) {
    if (p[i].index != i) {
      flag = 1;
    }
    if (p[i].a != p[i].b) {
      printf("rated\n");
      return 0;
    }
  }
  if (flag == 1)
    printf("unrated\n");
  else
    printf("maybe\n");
  return 0;
}
