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