#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  int bef = 5000;
  bool change = false;
  bool sorted = true;
  for (int i = 0; i < n; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    if (x != y) {
      change = true;
    }
    if (x > bef) {
      sorted = false;
    }
    bef = x;
  }
  if (change) {
    printf("rated\n");
  } else if (sorted) {
    printf("maybe\n");
  } else {
    printf("unrated\n");
  }
}
