#include <bits/stdc++.h>
int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }
int lcm(int a, int b) { return ((a * b) / gcd(a, b)); }
using namespace std;
int main() {
  int a, b, c, i, j, k, tc, t;
  int n, m, cnt = 0;
  pair<int, int> pp[100005];
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> a >> b;
    pp[i] = make_pair(a, b);
  }
  for (i = 0; i < n; i++) {
    if (pp[i].first != pp[i].second) {
      printf("rated\n");
      return 0;
    }
  }
  for (i = 1; i < n; i++) {
    if (pp[i].first > pp[i - 1].first) {
      printf("unrated\n");
      return 0;
    }
  }
  printf("maybe\n");
  return 0;
}
