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