#include <bits/stdc++.h>
using namespace std;
const int N = 1001;
int n, m, used[N][N], x, y;
string g[N];
const int di[4] = {0, 1, 0, -1}, dj[4] = {1, 0, -1, 0};
bool f = false;
void dfs(int x, int y, int j, int cnt) {
  used[x][y] = true;
  if (g[x][y] == 'T' && cnt < 3) f = true;
  if (!f) {
    for (int i = 0; i < 4; i++) {
      int newx = x + di[i], newy = y + dj[i];
      if (!f && 0 <= newx && newx < n && 0 <= newy && newy < m &&
          !used[newx][newy] && (g[newx][newy] == '.' || g[newx][newy] == 'T'))
        dfs(newx, newy, i, cnt + (i != j && j > -1));
    }
  }
}
int main() {
  cin >> n;
  int x1, y1;
  f = false;
  for (int i = 0; i < n; i++) {
    cin >> x >> y;
    if (x != y) {
      cout << "rated";
      return 0;
    }
    if (i && (x1 < x || y1 < y)) {
      f = true;
    }
    x1 = x;
    y1 = y;
  }
  if (f)
    cout << "unrated";
  else
    cout << "maybe";
  return 0;
}
