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