#include <bits/stdc++.h>
using namespace std;
int mark[5000];
int main() {
  int flag = 1;
  int n, a, b;
  scanf("%d", &n);
  int temp = 5000;
  for (int i = 0; i < n; i++) {
    scanf("%d%d", &a, &b);
    if (a != b) flag = 0;
    if (flag) {
      if (a > temp) flag = 2;
    }
    temp = a;
  }
  if (!flag)
    puts("rated");
  else if (flag == 1)
    puts("maybe");
  else
    puts("unrated");
  return 0;
}
