http://codeforces.com/problemset/problem/834/A
#include <bits/stdc++.h>
using namespace std;
int main(){
int a[5];
a[0]=118;
a[1]=60;
a[2]=94;
a[3]=62;
char ch1,ch2;
int k,kk;
while (cin >> ch1 >> ch2){
int n;
cin >> n;
for (int i=0;i<4;i++){
if ((int) ch1 == a[i]){
k=i;
}
if ((int) ch2 == a[i]){
kk=i;
}
}
if ( (k+n)%4==kk&& ((k-n)%4+4)%4==kk ){
cout << "undefined" << endl;
}
else{
if ((k+n)%4==kk){
cout << "cw" << endl;
}
else{
cout << "ccw" << endl;
}
}
}
}