#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  int A[n], i;
  for (i = 0; i < n; i++) scanf("%d", &A[i]);
  if (n == 1 && A[0] == 0)
    printf("UP");
  else if (n == 1 && A[0] == 15)
    printf("DOWN");
  else if (n == 1)
    printf("-1");
  else {
    if (A[n - 1] == 15)
      printf("DOWN");
    else {
      if (A[n - 1] > A[n - 2])
        printf("UP");
      else if (A[n - 1] != 0)
        printf("DOWN");
      else
        printf("UP");
    }
  }
  return 0;
}
