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