#include using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); int n, m, t; cin >> n >> m >> t; for (int i = 0; i < m; i++) { int p, s, l; char d; cin >> p >> s >> d >> l; if (d == 'L') { d = -1; } else if (d == 'R') { d = 1; } else { exit(1); } int front = p + s * t * d; int back = front + l - 1; for (int j = 0; j < n; j++) { if (j < front || j > back) { cout << '='; } else if ((j == front && d == -1) || (j == back && d == 1)) { cout << '!'; } else { cout << '#'; } } cout << '\n'; } return 0; }