#include <bits/stdc++.h>
using namespace std;
long long pow(long long a, long long b, long long mod) {
  stack<int> k;
  int j = 2048;
  int l = 1;
  int an = 1;
  while (b) {
    if (b >= j) {
      k.push(j);
      b -= j;
    }
    j /= 2;
  }
  while (!k.empty()) {
    if (k.top() == l) {
      an = (an * a) % mod;
      k.pop();
    }
    a = (a * a) % mod;
    l *= 2;
  }
  return an;
}
long long an = 0;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  char x, y;
  int n;
  cin >> x >> y >> n;
  n = n % 4;
  string s;
  if (x == '>') {
    if (n == 1 && y == 'v' || (n == 3 && y == '^')) {
      s = "cw";
    } else if (n == 1 && y == '^' || (n == 3 && y == 'v')) {
      s = "ccw";
    } else {
      s = "undefined";
    }
  } else if (x == '<') {
    if (n == 1 && y == 'v' || (n == 3 && y == '^')) {
      s = "ccw";
    } else if (n == 1 && y == '^' || (n == 3 && y == 'v')) {
      s = "cw";
    } else {
      s = "undefined";
    }
  } else if (x == '^') {
    if (n == 1 && y == '>' || (n == 3 && y == '<')) {
      s = "cw";
    } else if (n == 1 && y == '<' || (n == 3 && y == '>')) {
      s = "ccw";
    } else {
      s = "undefined";
    }
  } else {
    if (n == 1 && y == '>' || (n == 3 && y == '<')) {
      s = "ccw";
    } else if (n == 1 && y == '<' || (n == 3 && y == '>')) {
      s = "cw";
    } else {
      s = "undefined";
    }
  }
  cout << s << endl;
  return 0;
}
