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