#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
int t;
int n;
string ans;
int sz[maxn];
void in();
void out();
void solve();
int main() {
  ios::sync_with_stdio(false);
  cout.tie(0);
  cin.tie(0);
  t = 1;
  for (int i = 0; i < t; i++) {
    in();
    solve();
    out();
  }
}
void in() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> sz[i];
}
void solve() {
  if (sz[n - 1] == 15)
    ans = "DOWN";
  else if (sz[n - 1] == 0)
    ans = "UP";
  else if (n == 1)
    ans = "-1";
  else if (sz[n - 2] - sz[n - 1] == 1)
    ans = "DOWN";
  else
    ans = "UP";
}
void out() { cout << ans; }
