#include using namespace std; int dx[4] = {1, -1, 0, 0}; int dy[4] = {0, 0, 1, -1}; int main(){ int N, M, x, y = 0; string S; cin >> N >> M >> S; assert (0 < N && N <= 200 && 0 < M && M <= 1000000); x = N; vector> seen(N + 1, vector(N + 1, true)); seen[x][y] = false; for (auto c : S) { assert (c == 'D' || c == 'U' || c == 'R' || c == 'L'); int flag = -1; if (c == 'D') { flag = 0; } else if (c == 'U') { flag = 1; } else if (c == 'R') { flag = 2; } else { flag = 3; } x += dx[flag]; y += dy[flag]; seen[x][y] = false; } for (int i = 0; i < N + 1; i++) { for (int j = 0; j < N + 1; j++) { cout << seen[i][j] << " "; } cout << endl; } }