#include <bits/stdc++.h>
using namespace std;
const long double pi = 3.141592653589793;
int main(int argc, char const *argv[]) {
  int n;
  cin >> n;
  int preva, prevb;
  int ch = 0, may = 0;
  int mnum;
  for (int i = 0; i < n; i++) {
    int a, b;
    cin >> a >> b;
    if (a - b != 0) ch = 1;
    if (i != 0) {
      if (b <= mnum)
        mnum = b;
      else {
        may = 1;
      }
    } else {
      mnum = b;
    }
  }
  if (ch == 1) {
    cout << "rated";
  } else {
    if (may == 1) {
      cout << "unrated";
    } else
      cout << "maybe";
  }
  return 0;
}
