#include <bits/stdc++.h>
using namespace std;
long long a[100000];
map<long long, long long> mp;
map<long long, long long> mp1;
int main() {
  cin.sync_with_stdio(false);
  long long i, j, k, l, c, v, b[1000], aa[1009], bb[1000], n, m, r, t;
  long long x1, x2, y1, y2, x3, x4, x5, x6;
  string s, s1, s2, s3, ss[10000];
  while (cin >> n) {
    {
      c = 0;
      for (i = 0; i < n; i++) {
        cin >> a[i];
      }
      if (n == 1) {
        if (a[n - 1] == 15)
          cout << "DOWN";
        else if (a[n - 1] == 0)
          cout << "UP";
        else
          cout << "-1";
      } else if (a[n - 2] < a[n - 1] && a[n - 1] != 15)
        cout << "UP";
      else if (a[n - 2] < a[n - 1] && a[n - 1] == 15)
        cout << "DOWN";
      else if (a[n - 2] > a[n - 1] && a[n - 1] == 0)
        cout << "UP";
      else if (a[n - 2] > a[n - 1])
        cout << "DOWN";
    }
  }
}
