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