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