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