#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  std::ios::sync_with_stdio(false);
  char a, b;
  long long int n;
  cin >> a >> b >> n;
  if (n % 4 == 3) {
    if ((a == 'v' && b == '>') || (a == '<' && b == 'v') ||
        (a == '^' && b == '<') || (a == '>' && b == '^'))
      cout << "cw\n";
    else
      cout << "ccw\n";
  } else if (n % 4 == 1) {
    if ((a == 'v' && b == '<') || (a == '<' && b == '^') ||
        (a == '^' && b == '>') || (a == '>' && b == 'v'))
      cout << "cw\n";
    else
      cout << "ccw\n";
  } else
    cout << "undefined\n";
  return 0;
}
