#include <bits/stdc++.h>
using namespace std;
int a[100010];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  if (n == 1) {
    if (a[0] == 0) {
      cout << "UP\n";
      return 0;
    } else if (a[0] == 15) {
      cout << "DOWN\n";
      return 0;
    } else {
      cout << -1 << endl;
      return 0;
    }
  }
  if (a[n - 1] == 15) {
    cout << "DOWN\n";
    return 0;
  }
  if (a[n - 2] == 1 and a[n - 1] == 0) {
    cout << "UP\n";
    return 0;
  }
  if (a[n - 2] < a[n - 1]) {
    cout << "UP\n";
  }
  if (a[n - 2] > a[n - 1]) {
    cout << "DOWN\n";
  }
}
