#include <bits/stdc++.h>
using namespace std;
int n;
int a[101000];
int read() {
  if (scanf("%d", &n) < 1) {
    return 0;
  }
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  return 1;
}
int solver(char w) {
  int nr = (n / 2) + (n % 2 > 0);
  int hr = 0;
  for (int i = 0; i < n; i++) {
    if (a[i] == w) hr++;
  }
  int is = 0;
  if (nr < hr) {
    is = hr - nr;
  } else if (nr > hr) {
    is = nr - hr;
  }
  for (int i = 0; i < n; i += 2) {
    if (a[i] != w) is++;
  }
  return is;
}
void solve() {
  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[n - 2] == 14 && a[n - 1] == 15) {
      printf("DOWN\n");
    } else if (a[n - 2] == 1 && a[n - 1] == 0) {
      printf("UP\n");
    } else {
      if (a[n - 1] - a[n - 2] < 0) {
        printf("DOWN\n");
      } else {
        printf("UP\n");
      }
    }
  }
}
int main(int argc, char *argv[]) {
  while (read()) {
    solve();
  }
}
