#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-9;
const int INF = 0x3f3f3f3f;
int sgn(double a) { return ((a > EPS) ? (1) : ((a < -EPS) ? (-1) : (0))); }
int cmp(double a, double b = 0.0) { return sgn(a - b); }
struct node {
  int x, y;
  node(int x = 0, int y = 0) : x(x), y(y) {}
};
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  bool rated = false;
  vector<int> rating;
  for (int i = 0; i < n; i++) {
    int x, y;
    cin >> x >> y;
    if (x != y)
      rated = true;
    else
      rating.push_back(y);
  }
  if (rated)
    cout << "rated\n";
  else {
    for (int i = 0; i < n - 1; i++)
      if (rating[i] < rating[i + 1]) {
        cout << "unrated\n";
        return 0;
      }
    cout << "maybe\n";
  }
  return 0;
}
