#include <bits/stdc++.h>
using namespace std;
int main() {
  long long a[100005], b[100005], t, i = 0, j, k, x, y, z, count = 0, p,
                                     flag = 0, ans = 0, sum = 0, l, n, m, max1,
                                     min1, pos, tmp, q;
  t = 1;
  while (t--) {
    scanf("%lld", &n);
    for (i = 0; i < n; i++) scanf("%lld%lld", &a[i], &b[i]);
    ans = 0;
    for (i = 0; i < n; i++) {
      if (a[i] != b[i]) ans = 1;
    }
    if (ans == 0) {
      for (i = 0; i < n; i++) {
        for (j = i + 1; j < n; j++) {
          if (a[i] < a[j]) {
            ans = -1;
          }
        }
      }
    }
    if (ans == 1) {
      printf("rated\n");
    } else if (ans == -1) {
      printf("unrated\n");
    } else {
      printf("maybe\n");
    }
  }
  return 0;
}
