#include using namespace std; #define ld long double #define ll long long ll n, m, t; int main() { ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0); cin >> n >> m >> t; for (ll trck = 1; trck <= m; trck++) { ll pos, speed; char dirCh; ll len; cin >> pos >> speed >> dirCh >> len; ll dir = 1; if (dirCh == 'L') dir = -1; ll p_new = pos + dir * speed * t; ll L = p_new; ll R = p_new + len - 1; ll origL = L; ll origR = R; if (L < 0) L = 0; if (R >= n) R = n - 1; for (ll i = 0; i < n; i++) { if (L <= i && i <= R) { if (dirCh == 'L' && i == origL) cout << "!"; else if (dirCh == 'R' && i == origR) cout << "!"; else cout << "#"; } else { cout << "="; } } cout << '\n'; } return 0; } /* 10 3 3 0 1 R 1 9 1 L 1 7 0 R 2 6 2 8 -2 1 R 5 4 0 L 5 5 3 3 10 0 R 3 0 1 R 1 -5 2 R 1 */