#include<bits/stdc++.h>
using namespace std;
int t;
int main(){
char a,b;
int n;
scanf(" %c %c",&a,&b);
scanf("%d",&n);
n%=4;
t=0,t=1,t=2,t=3;
int c=(t-t+4)%4;
if(n==0||n==2)puts("undefined");
else puts(n!=c?"cw":"ccw");
}
#include<bits/stdc++.h>
typedef long long ll;
const int N=100010;
const ll mo=1000000007;
int n,x,i,l,r,m,mid,g,j,k;
ll hs,ht,q;
char s,t;
inline ll...