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