#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 1e6 + 100;
const long long INF = 1e18;
const int MOD = 1e9 + 7;
int main() {
  int n;
  vector<int> v;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    int a;
    cin >> a;
    v.push_back(a);
  }
  if (v[v.size() - 1] == 0) {
    cout << "UP";
    return 0;
  }
  if (v[v.size() - 1] == 15) {
    cout << "DOWN";
    return 0;
  }
  if (v.size() == 1) {
    cout << -1;
    return 0;
  }
  int a = v[v.size() - 2];
  int b = v[v.size() - 1];
  if (a < b) {
    cout << "UP";
  } else
    cout << "DOWN";
}
