#include <bits/stdc++.h>
using namespace std;
string getSpinDirection(int start, int end, int spinCount) {
  string result = "undefined";
  vector<int> rotor = {94, 62, 118, 60};
  int start_index;
  for (int i = 0; i < 4; ++i)
    if (rotor[i] == start) {
      start_index = i;
      break;
    }
  if (spinCount % 2 == 0) return result;
  spinCount = spinCount % 4;
  if (rotor[(start_index + spinCount) % 4] == end)
    result = "cw";
  else if (rotor[(start_index + (4 - spinCount)) % 4] == end)
    result = "ccw";
  return result;
}
int main() {
  char start, end;
  int spinCount;
  cin >> start >> end;
  cin >> spinCount;
  cout << getSpinDirection(start, end, spinCount) << endl;
  return 0;
}
