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