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