#include using namespace std; int main() { int n, m; cin >> n >> m; string s; cin >> s; vector> v(n+1, vector(n+1, 1)); int x = 0; int y = 0; v[x][y] = 0; for(char c : s) { if(c == 'R') ++x; else if(c == 'L') --x; else if(c == 'U') ++y; else if(c == 'D') --y; v[y][x] = 0; } for(int i = n; i >= 0; --i) { for(int j = 0; j <= n; ++j) { printf("%d ", v[i][j]); } printf("\n"); } return 0; }