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