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