#include using namespace std; typedef long long ll; typedef long double ld; #define REP(i, n) for (int i = 0; i < (n); ++i) #define REPR(i, n) for (int i = n - 1; i >= 0; --i) #define FOR(i, m, n) for (int i = m; i < n; ++i) #define FORR(i, m, n) for (int i = m; i >= n; --i) #define ALL(v) (v).begin(),(v).end() templatebool chmax(T &a, const T &b) { if (abool chmin(T &a, const T &b) { if (b> n >> m; vector> b(n+1,vector(n+1,true)); int nx=0,ny=0; b[nx][ny]=false; string s;cin >> s; REP(i,m){ if(s[i]=='U') ny++; if(s[i]=='D') ny--; if(s[i]=='R') nx++; if(s[i]=='L') nx--; b[nx][ny]=false; } REP(i,n+1){ REP(j,n+1){ cout << (b[j][n-i]?1:0) << " "; } cout << endl; } }