#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c, d, e, f, g, h;
  scanf("%d", &a);
  if (a == 1) {
    scanf("%d", &e);
    if (e != 15 && e != 0)
      printf("-1\n");
    else if (e) {
      printf("DOWN\n");
    } else
      printf("UP\n");
  } else {
    for (d = 0; d < a - 2; d++) scanf("%d", &e);
    scanf("%d%d", &e, &f);
    if ((f > e && f < 15) || f == 0) {
      printf("UP\n");
    } else
      printf("DOWN\n");
  }
}
