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