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