#include using namespace std; template inline void chmin(T1 &a,T2 b){if(a>b) a=b;} template inline void chmax(T1 &a,T2 b){if(a>n>>m; vector ans(n+1,string(n+1,'1')); int y=n,x=0; ans[y][x]='0'; string s; cin>>s; for(char c:s){ if(c=='U') y--; if(c=='D') y++; if(c=='L') x--; if(c=='R') x++; ans[y][x]='0'; } for(auto a:ans){ int f=0; for(char c:a){ if(exchange(f,1)) cout<<' '; cout<