#include <bits/stdc++.h>
using namespace std;
const long double EPS = 1e-10;
const long long MOD = 1000000007ll;
const long long mod1 = 1000000009ll;
const long long mod2 = 1100000009ll;
int INF = (int)1e9 + 5;
long long INFINF = (long long)1e18;
int arr[100];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", &arr[i]);
  if (n == 1) {
    if (arr[0] == 0)
      cout << "UP" << endl;
    else if (arr[0] == 15)
      cout << "DOWN" << endl;
    else
      cout << "-1" << endl;
    return 0;
  }
  if (arr[n - 2] < arr[n - 1] && arr[n - 1] < 15) {
    cout << "UP" << endl;
    return 0;
  }
  if (arr[n - 2] < arr[n - 1] && arr[n - 1] == 15) {
    cout << "DOWN" << endl;
    return 0;
  }
  if (arr[n - 2] > arr[n - 1] && arr[n - 1] > 0) {
    cout << "DOWN" << endl;
    return 0;
  }
  if (arr[n - 2] > arr[n - 1] && arr[n - 1] == 0) {
    cout << "UP" << endl;
    return 0;
  }
  return 0;
}
