#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, j, k, l, p = 0, q = 0, r = 0, t = 0, a[92];
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> a[i];
  }
  if (n > 1) {
    if (((a[n - 1] - a[n - 2] > 0) || (a[n - 1] == 0)) && (a[n - 1] != 15))
      cout << "UP";
    else
      cout << "DOWN";
  } else {
    if (a[n - 1] == 15)
      cout << "DOWN";
    else {
      if (a[n - 1] == 0)
        cout << "UP";
      else
        cout << "-1";
    }
  }
  return 0;
}
