#include <bits/stdc++.h>
using namespace std;
int a[100];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  if (n == 1) {
    if (a[0] == 15)
      cout << "DOWN";
    else if (a[0] == 0)
      cout << "UP";
    else
      cout << -1;
  } else if (a[n - 2] == 14 && a[n - 1] == 15)
    cout << "DOWN";
  else if (a[n - 2] == 1 && a[n - 1] == 0)
    cout << "UP";
  else if (a[n - 2] < a[n - 1])
    cout << "UP";
  else if (a[n - 2] > a[n - 1])
    cout << "DOWN";
  return 0;
}
