#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int x;
  cin >> x;
  int* y = new int[x];
  for (int i = 0; i < x; i++) {
    cin >> y[i];
  }
  if (y[x - 1] == 0)
    cout << "UP\n";
  else if (y[x - 1] == 15)
    cout << "DOWN\n";
  else if (x == 1)
    cout << "-1";
  else
    cout << (y[x - 2] > y[x - 1] ? "DOWN\n" : "UP\n");
  return 0;
}
