#include <bits/stdc++.h>
using namespace std;
const int tp0 = 1;
const int tp1 = 10;
const int tp2 = 100;
const int tp3 = 1000;
const int tp4 = 10000;
const int tp5 = 100000;
const int tp6 = 1000000;
const int tp7 = 10000000;
const int tp8 = 100000000;
const int tp9 = 1000000000;
const int mod = 1000000000 + 7;
int a[10000];
int b[10000];
int main() {
  int n;
  bool t = false;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i] >> b[i];
    if (a[i] != b[i]) t = true;
  }
  if (t == true) {
    cout << "rated";
    return 0;
  }
  for (int i = 0; i < n - 1; i++) {
    if (a[i] < a[i + 1]) {
      cout << "unrated";
      return 0;
    }
  }
  cout << "maybe";
}
