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