#include <bits/stdc++.h>
using namespace std;
int main() {
  int num;
  cin >> num;
  int arr[num];
  for (int i = 0; i < num; i++) {
    cin >> arr[i];
  }
  if (num == 1 && arr[num - 1] != 0 && arr[num - 1] != 15) {
    cout << "-1";
    return 0;
  }
  int x, y;
  x = arr[num - 2];
  y = arr[num - 1];
  if (y == 0) {
    cout << "UP";
  } else if (y == 15) {
    cout << "DOWN";
  } else {
    if (x < y) {
      cout << "UP";
    } else if (x > y) {
      cout << "DOWN";
    }
  }
  return 0;
}
