#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c, d, n, flag = 0;
  cin >> n;
  cin >> a >> b;
  if (a != b) {
    cout << "rated";
    return 0;
  }
  while (--n) {
    cin >> c >> d;
    if (c != d) {
      cout << "rated";
      return 0;
    }
    if (a < c) flag = 1;
    a = c;
    b = d;
  }
  if (!flag)
    cout << "maybe";
  else
    cout << "unrated";
  return 0;
}
