#include <bits/stdc++.h>
using namespace std;
int direction(int asc) {
  int UP = 94;
  int LEFT = 60;
  int RIGHT = 62;
  int DOWN = 118;
  if (asc == UP) {
    return 0;
  } else if (asc == RIGHT) {
    return 1;
  } else if (asc == DOWN) {
    return 2;
  } else {
    return 3;
  }
}
int main(int argc, char *argv[]) {
  char s_in, e_in;
  int t;
  cin >> s_in >> e_in;
  cin >> t;
  int s = int(s_in);
  int e = int(e_in);
  int remainder = t % 4;
  int sdir = direction(s);
  int edir = direction(e);
  string answer = "undefined";
  int move = (sdir + remainder) % 4;
  if (move == edir) {
    answer = "cw";
  } else {
    answer = "ccw";
  }
  if (sdir == edir || remainder == 2) {
    answer = "undefined";
  }
  cout << answer;
}
