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