#define rep(i, n) for (int i = 0; i < (int)(n); i++) #define ALL(v) v.begin(), v.end() typedef long long ll; #include using namespace std; int main(){ int n,m; string s; cin>>n>>m>>s; int G[n+1][n+1]; rep(i,n+1){ rep(j,n+1) G[i][j]=1; } G[n][0]=0; int y=n,x=0; rep(i,m){ if(s[i]=='U') y--; else if(s[i]=='D') y++; else if(s[i]=='R') x++; else x--; G[y][x]=0; } rep(i,n+1){ rep(j,n+1){ if(j) cout<<" "; cout<