#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, ara[1005][3], st = 0, cnt = 0, cn = 0;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d %d", &ara[i][0], &ara[i][1]);
    if (ara[i][0] == ara[i][1]) cnt++;
  }
  if (cnt != n) {
    printf("rated\n");
    return 0;
  }
  for (i = 1; i < n; i++) {
    if (ara[i][0] <= ara[i - 1][0]) {
      cn++;
    }
  }
  if (cn == n - 1) {
    printf("maybe\n");
  } else {
    printf("unrated\n");
  }
  return 0;
}
