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