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