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