#define _USE_MATH_DEFINES
#include <array>
#include <cassert>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <queue>
#include <stack>
#include <list>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>
#include <complex>
#include <cmath>
#include <numeric>
#include <bitset>
#include <functional>
#include <random>
#include <ctime>
using namespace std;
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
cerr << name << ": " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
const char* comma = strchr(names + 1, ',');
cerr.write(names, comma - names) << ": " << arg1 << " |";
__f(comma + 1, args...);
}
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(),x.end()
typedef long long ll;
typedef long l;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<l> vl;
typedef vector<ll> vll;
const int INF = 1 << 29;
const int MOD = 1e9 + 7;
const int dx[]={0,1,0,-1};
const int dy[]={1,0,-1,0};
mt19937 mrand(random_device{}());
int rnd(int x) { return mrand() % x; }
char ocean[102][102];
int n,m;
int bx,by,as;
bool cmp(const pair<int,char> &a,const pair<int,char> &b) {
if(a.first==b.first){
return (a.second-'A'<b.second-'A');
}
else return (a.first<b.first);
}
void dfs(int x,int y,int cnt){
//cout<<ocean[x][y]<<" ";
if(ocean[x][y]=='x') return;
if(ocean[x][y]=='.') as=1e6;
if(ocean[x][y]=='^') dfs(x-1,y,++as);
if(ocean[x][y]=='v') dfs(x+1,y,++as);
if(ocean[x][y]=='<') dfs(x,y-1,++as);
if(ocean[x][y]=='>') dfs(x,y+1,++as);
}
void solve(){
cin>>n>>m;
for(int i=0;i<n;i++)
for(int j=0;j<m;j++){
cin>>ocean[i][j];
if(ocean[i][j]=='o')
bx=i,by=j;
}
pair<int,char> anns[4];
anns[0].s='S';
anns[0].f=1e6;
anns[1].s='E';
anns[1].f=1e6;
anns[2].f=1e6;
anns[2].s='N';
anns[3].f=1e6;
anns[3].s='W';
for(int i=0;i<4;i++){
as=1;
if(bx+dy[i]>=0 && bx+dy[i]<n && by+dx[i]>=0 && by+dx[i]<m){
dfs(bx+dy[i],by+dx[i],1);
anns[i].f=as;
}
else anns[i].f=1e6;
// cout<<anns[i].first<<" "<<anns[i].second<<endl;
}
sort(anns,anns+4,cmp);
/* for(int i=0;i<4;i++)
cout<<anns[i].first<<" "<<anns[i].second<<endl;
*/ if(anns[0].f==1e6) cout<<":(\n";
else cout<<":)\n"<<anns[0].s<<endl;
//for(int i=0;i<4;i++) cout<<ans[i]<<" ";
}
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
solve();
return 0;
}
I2RlZmluZSBfVVNFX01BVEhfREVGSU5FUwojaW5jbHVkZSA8YXJyYXk+CiNpbmNsdWRlIDxjYXNzZXJ0PgojaW5jbHVkZSA8Y3N0ZGlvPgojaW5jbHVkZSA8Y3N0cmluZz4KI2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3RyaW5nPgojaW5jbHVkZSA8c3N0cmVhbT4KI2luY2x1ZGUgPHZlY3Rvcj4KI2luY2x1ZGUgPHF1ZXVlPgojaW5jbHVkZSA8c3RhY2s+CiNpbmNsdWRlIDxsaXN0PgojaW5jbHVkZSA8c2V0PgojaW5jbHVkZSA8bWFwPgojaW5jbHVkZSA8dW5vcmRlcmVkX3NldD4KI2luY2x1ZGUgPHVub3JkZXJlZF9tYXA+CiNpbmNsdWRlIDxhbGdvcml0aG0+CiNpbmNsdWRlIDxjb21wbGV4PgojaW5jbHVkZSA8Y21hdGg+CiNpbmNsdWRlIDxudW1lcmljPgojaW5jbHVkZSA8Yml0c2V0PgojaW5jbHVkZSA8ZnVuY3Rpb25hbD4KI2luY2x1ZGUgPHJhbmRvbT4KI2luY2x1ZGUgPGN0aW1lPgogCnVzaW5nIG5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