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