#include <bits/stdc++.h>
using namespace std;
int arr[1005];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &arr[i]);
  }
  string res = "";
  if (n == 1 || arr[n - 1] == 0 || arr[n - 1] == 15) {
    if (arr[n - 1] == 0) {
      res = "UP";
    } else if (arr[n - 1] == 15) {
      res = "DOWN";
    } else {
      res = "-1";
    }
  } else {
    if (arr[n - 1] - arr[n - 2] > 0)
      res = "UP";
    else
      res = "DOWN";
  }
  printf("%s\n", res.c_str());
}
