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