#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < (n); ++i) cin >> a[i];
  string ans;
  if (n == 1) {
    if (a[0] == 0)
      ans = "UP";
    else if (a[0] == 15)
      ans = "DOWN";
    else
      ans = "-1";
  } else if (a[n - 2] < a[n - 1]) {
    if (a[n - 1] != 15)
      ans = "UP";
    else
      ans = "DOWN";
  } else {
    if (a[n - 1] != 0)
      ans = "DOWN";
    else
      ans = "UP";
  }
  cout << ans << endl;
  return 0;
}
