#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, a, b, r = 0, m = 0, t1, t2, t3;
  cin >> t;
  t3 = t - 1;
  while (t--) {
    cin >> a >> b;
    if (t != t3)
      if (a > t1 && b > t2) m++;
    t1 = a;
    t2 = b;
    if (a != b) r++;
  }
  if (r > 0)
    cout << "rated";
  else if (m > 0)
    cout << "unrated";
  else
    cout << "maybe";
  return 0;
}
