#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n, i, cnt = 0, f = 0, x, y;
  cin >> n;
  int a[n];
  for (i = 0; i < n; i++) {
    cin >> a[i];
  }
  if (n == 1 && a[0] != 0 && a[0] != 15) {
    cout << -1 << '\n';
  } else if (a[n - 1] == 0) {
    cout << "UP" << '\n';
  } else if (a[n - 1] == 15) {
    cout << "DOWN" << '\n';
  } else if (a[n - 1] > a[n - 2]) {
    cout << "UP" << '\n';
  } else if (a[n - 1] < a[n - 2]) {
    cout << "DOWN" << '\n';
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  solve();
  return 0;
}
