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