#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  bool cond1 = false, cond2 = false;
  int X, Y;
  cin >> X >> Y;
  if (Y > X || X > Y) cond1 = true;
  int maxx = max(X, Y);
  for (int i = 1; i < n; i++) {
    int x, y;
    cin >> x >> y;
    if (y > x || x > y) cond1 = true;
    if (x > maxx || y > maxx) cond2 = true;
    maxx = max(x, y);
  }
  if (cond1 == true) {
    cout << "rated" << endl;
    return 0;
  }
  if (cond2 == true)
    cout << "unrated" << endl;
  else
    cout << "maybe" << endl;
}
