#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n];
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  if (n == 1 && a[n] != 15 && a[n] != 0) cout << -1 << endl;
  if (a[n] == 15) {
    cout << "DOWN" << endl;
  }
  if (a[n] == 0) {
    cout << "UP" << endl;
  } else {
    if (a[n] - a[n - 1] == 1 && a[n] != 15) {
      cout << "UP" << endl;
    }
    if (a[n] - a[n - 1] == -1) {
      cout << "DOWN" << endl;
    }
  }
  return 0;
}
