#include <bits/stdc++.h>
using namespace std;
const int IINF = 1 << 28;
const long long MOD = 1000000007;
const int dx[] = {1, 0, -1, 0}, dy[] = {0, 1, 0, -1};
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  vector<int> v(n);
  for (int i = 0; i < (int)(n); i++) cin >> v[i];
  if (n == 1 && v[0] == 0)
    cout << "UP" << endl;
  else if (n == 1 && v[0] == 15)
    cout << "DOWN" << endl;
  else if (n < 2)
    cout << -1 << endl;
  else if (v[n - 2] > v[n - 1] && v[n - 1] == 0)
    cout << "UP" << endl;
  else if (v[n - 2] < v[n - 1] && v[n - 1] == 15)
    cout << "DOWN" << endl;
  else if (v[n - 2] > v[n - 1])
    cout << "DOWN" << endl;
  else if (v[n - 2] < v[n - 1])
    cout << "UP" << endl;
  else
    cout << -1 << endl;
  return 0;
}
