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