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