#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 7;
const long long inf = 1e9 + 7;
const long long mod = 1e9 + 7;
int n, a[101];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
  }
  if (a[n] == 15) {
    printf("DOWN");
    return 0;
  }
  if (a[n] == 0) {
    printf("UP");
    return 0;
  }
  if (n == 1 && a[1] != 15 && a[1] != 0) {
    printf("-1");
    return 0;
  }
  if (a[n] < a[n - 1]) {
    printf("DOWN");
    return 0;
  }
  if (a[n] > a[n - 1]) {
    printf("UP");
    return 0;
  }
  printf("-1");
  return 0;
}
