#include <bits/stdc++.h>
using namespace std;
const int a[] = {0,  1,  2,  3,  4,  5,  6, 7, 8, 9, 10, 11, 12, 13, 14,
                 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5,  4,  3,  2,  1};
int b[1000];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &b[i]);
  }
  if (n == 1 && b[n - 1] != 0 && b[n - 1] != 15)
    printf("-1\n");
  else if (n == 1 && b[n - 1] == 15)
    printf("DOWN\n");
  else if (n == 1 && b[n - 1] == 0)
    printf("UP\n");
  else {
    if (b[n - 2] < b[n - 1] && b[n - 1] != 15)
      printf("UP\n");
    else if (b[n - 2] < b[n - 1] && b[n - 1] == 15)
      printf("DOWN\n");
    else if (b[n - 2] > b[n - 1] && b[n - 1] != 0)
      printf("DOWN\n");
    else
      printf("UP\n");
  }
  return 0;
}
