#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int cnt = 0;
  cin >> n;
  int a[n];
  int b[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    cin >> b[i];
  }
  for (int i = 0; i < n; i++) {
    if (a[i] != b[i]) {
      cout << "rated" << endl;
      return 0;
    }
  }
  int m = a[0];
  for (int i = 1; i < n; i++) {
    if (m >= a[i]) {
      m = a[i];
    } else {
      cout << "unrated" << endl;
      return 0;
    }
  }
  cout << "maybe" << endl;
  return 0;
}
