#include <bits/stdc++.h>
using namespace std;
const long long MAXN = 2e6 + 10, inf = 1e18, mod = 1e9 + 7;
long long n, flag;
pair<long long, long long> a[MAXN];
void Read_input() {
  cin >> n;
  for (long long i = 1; i <= n; i++) {
    cin >> a[i].first >> a[i].second;
    if (a[i].first != a[i].second) flag++;
  }
}
void Solve() {
  if (flag) {
    cout << "rated";
    exit(0);
  }
  for (long long i = 1; i <= n; i++)
    for (long long j = i + 1; j <= n; j++)
      if (a[i].first < a[j].first)
        flag = 3;
      else if (a[i].first == a[j].first and !flag)
        flag = 2;
  if (flag == 1) cout << "rated";
  if (flag == 2 or !flag) cout << "maybe";
  if (flag == 3) cout << "unrated";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  Read_input(), Solve();
  return 0;
}
