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