#include <bits/stdc++.h>
using namespace std;
const long long N = 1e9;
long long n, a, b, c, d, ans = N, m;
vector<long long> v;
string s, s1;
int main() {
  cin >> n;
  for (long long i = 1; i <= n; i++) {
    cin >> m;
    v.push_back(m);
  }
  if (v.size() == 1 and v[0] != 0 and v[0] != 15) {
    cout << "-1";
    return 0;
  }
  if (v.size() == 1 and v[0] == 0) {
    cout << "UP";
    return 0;
  }
  if (v.size() == 1 and v[0] == 15) {
    cout << "DOWN";
    return 0;
  }
  if (v[v.size() - 1] > v[v.size() - 2] and v[v.size() - 1] != 15) {
    cout << "UP";
    return 0;
  }
  if (v[v.size() - 1] > v[v.size() - 2] and v[v.size() - 1] == 15) {
    cout << "DOWN";
    return 0;
  }
  if (v[v.size() - 1] < v[v.size() - 2] and v[v.size() - 1] != 0) {
    cout << "DOWN";
    return 0;
  }
  if (v[v.size() - 1] < v[v.size() - 2] and v[v.size() - 1] == 0) {
    cout << "UP";
    return 0;
  }
}
