#include <bits/stdc++.h>
using namespace std;
int main() {
  char a, b;
  int n;
  cin >> a >> b >> n;
  if (n % 2 == 0 || n == 0) {
    cout << "undefined";
    return 0;
  }
  if ((a == 94 && b == 62) || (a == 62 && b == 118) || (a == 118 && b == 60) ||
      (a == 60 && b == 94)) {
    if (n % 4 == 1)
      cout << "cw";
    else
      cout << "ccw";
  }
  if ((a == 94 && b == 60) || (a == 60 && b == 118) || (a == 118 && b == 62) ||
      (a == 62 && b == 94)) {
    if (n % 4 == 1)
      cout << "ccw";
    else
      cout << "cw";
  }
}
