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