#include <bits/stdc++.h>
const long long inf = 1e9;
const int Maxn = 1e5 + 100;
const double PI = 3.142857142857143;
using namespace std;
int main(void) {
  ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  int n;
  cin >> n;
  pair<int, int> a[n];
  for (int i = 0; i < n; i++) cin >> a[i].first >> a[i].second;
  for (int i = 0; i < n; i++)
    if (a[i].first != a[i].second) return cout << "rated\n", 0;
  for (int i = 1; i < n; i++)
    if (a[i].first > a[i - 1].first) return cout << "unrated\n", 0;
  cout << "maybe\n";
  return 0;
}
