#include <bits/stdc++.h>
using namespace std;
int c[100005];
int main() {
  long long int n;
  cin >> n;
  int a[n][2], f = 0;
  for (long long int i = 0; i < n; i++) cin >> a[i][0] >> a[i][1];
  for (long long int i = 0; i < n; i++) {
    if (a[i][0] != a[i][1]) {
      cout << "rated";
      f = 1;
      break;
    }
  }
  if (f == 0) {
    for (long long int i = 0; i < n - 1; i++) {
      if (a[i][0] < a[i + 1][0]) {
        cout << "unrated";
        f = 1;
        break;
      }
    }
  }
  if (f == 0) cout << "maybe";
  return 0;
}
