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