#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int c1 = 0;
  int c2 = 0;
  int *s = new int[n];
  for (int i = 0; i < n; i++) cin >> s[i];
  if (n == 1 && s[n - 1] != 0 && s[n - 1] != 15)
    cout << -1;
  else if (n == 1 && s[n - 1] == 0)
    cout << "UP";
  else if (n == 1 && s[n - 1] == 15)
    cout << "DOWN";
  else if (s[n - 1] > s[n - 2] && s[n - 1] != 15)
    cout << "UP";
  else if (s[n - 1] < s[n - 2] && s[n - 1] != 0)
    cout << "DOWN";
  else if (s[n - 1] > s[n - 2] && s[n - 1] == 15)
    cout << "DOWN";
  else
    cout << "UP";
}
