#include <bits/stdc++.h>
using namespace std;
const int maxn = 1005;
const int mod = 1e9 + 7;
const int INF = 0x3f3f3f3f;
const double eps = 1e-6;
struct node {
  int x, y;
} a[maxn];
int main() {
  int n;
  while (~scanf("%d", &n)) {
    int flag = 0;
    int flag2 = 0;
    for (int i = 0; i < n; i++) {
      scanf("%d%d", &a[i].x, &a[i].y);
      if (a[i].x != a[i].y) {
        flag = 1;
      }
      if (i != 0 && a[i].x > a[i - 1].x) {
        flag2 = 1;
      }
    }
    if (flag) {
      puts("rated");
      continue;
    }
    if (flag2) {
      puts("unrated");
      continue;
    }
    puts("maybe");
  }
  return 0;
}
