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