#include <bits/stdc++.h>
int main() {
  int n, i, j, k = 0, c = 0;
  scanf("%d", &n);
  int a[n][2];
  for (i = 0; i < n; i++) {
    for (j = 0; j < 2; j++) {
      scanf("%d", &a[i][j]);
    }
    if (a[i][0] != a[i][1]) {
      k++;
    }
  }
  if (k > 0) {
    printf("rated\n");
  } else {
    for (i = 0; i < (n - 1); i++) {
      if (a[i][0] < a[i + 1][0]) {
        c++;
        break;
      }
    }
    if (c > 0)
      printf("unrated\n");
    else
      printf("maybe\n");
  }
  return 0;
}
