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