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