#include <bits/stdc++.h>
using namespace std;
const int MOD = int(1e9 + 7);
int n;
pair<int, int> a[1005];
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i].first >> a[i].second;
  for (int i = 0; i < n; i++)
    if (a[i].first != a[i].second) {
      cout << "rated" << endl;
      return 0;
    }
  int mmax = a[0].first;
  for (int i = 1; i < n; i++) {
    if (a[i].first > mmax) {
      cout << "unrated" << endl;
      return 0;
    }
    mmax = a[i].first;
  }
  cout << "maybe" << endl;
  return 0;
}
