#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int ar[n];
  for (auto &it : ar) cin >> it;
  ;
  if (n == 1) {
    if (ar[0] == 15)
      cout << "DOWN" << endl;
    else if (ar[0] == 0)
      cout << "UP" << endl;
    else
      cout << "-1" << endl;
  } else {
    if (ar[n - 1] == 15)
      cout << "DOWN" << endl;
    else if (ar[n - 1] == 0)
      cout << "UP" << endl;
    else if (ar[n - 1] > ar[n - 2])
      cout << "UP" << endl;
    else
      cout << "DOWN" << endl;
  }
}
