#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, a, b, cnt = 0, i = 0;
  cin >> n;
  multiset<int, greater<int> > s;
  vector<int> v;
  for (int i = 1; i <= n; i++) {
    cin >> a >> b;
    if (a != b) cnt++;
    s.insert(a);
    v.push_back(a);
  }
  if (cnt)
    cout << "rated" << endl;
  else {
    for (int x : s) {
      if (x == v[i]) cnt++;
      i++;
    }
    if (cnt == n)
      cout << "maybe" << endl;
    else
      cout << "unrated" << endl;
  }
  return 0;
}
