#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c, d, e;
  cin >> a;
  int A[a];
  for (b = 0; b < a; b++) {
    cin >> A[b];
  }
  if (a <= 1) {
    if (A[0] == 15)
      cout << "DOWN" << endl;
    else if (A[0] == 0)
      cout << "UP" << endl;
    else
      cout << -1 << endl;
  } else {
    if (A[a - 1] == 15) {
      cout << "DOWN" << endl;
    } else if (A[a - 1] == 0) {
      cout << "UP" << endl;
    } else {
      if ((A[a - 1] - A[a - 2]) >= 0)
        cout << "UP" << endl;
      else
        cout << "DOWN" << endl;
    }
  }
}
