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