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