#include <bits/stdc++.h>
#pragma warning(disable : 4786)
#pragma comment(linker, "/STACK:102400000,102400000")
using namespace std;
const int INF = 0x3f3f3f3f;
const int mod = 1e9 + 7;
const double PI = acos(-1.0);
const double eps = 1e-6;
int a[100];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
  }
  if (n == 1 && (a[n] != 15) && (a[n] != 0)) {
    printf("-1\n");
    return 0;
  } else if (n == 1 && a[n] == 15) {
    printf("DOWN\n");
    return 0;
  } else if (n == 1 && a[n] == 0) {
    printf("UP\n");
    return 0;
  }
  if (a[n - 1] - a[n] < 0 && a[n] <= 14) {
    printf("UP\n");
    return 0;
  } else if (a[n - 1] - a[n] < 0 && a[n] == 15) {
    printf("DOWN\n");
    return 0;
  } else if (a[n - 1] - a[n] > 0 && a[n] != 0) {
    printf("DOWN\n");
    return 0;
  } else if (a[n - 1] - a[n] > 0 && a[n] == 0) {
    printf("UP\n");
    return 0;
  }
  return 0;
}
