#include <bits/stdc++.h>
using namespace std;
int x=0,y=0;
int main(){
string ss;
cin >> ss;
int t;
cin >> t;
while(t>0){
for(int i=0;i<ss.size() && t>0;i++,t--){
if(ss[i]=='W')x--;
else if(ss[i]=='E')x++;
else if(ss[i]=='N')y--;
else y++;
}
}
cout << x << ' ' << y;
return 0;
}
希望各位大佬帮忙看看