#include #include using namespace std; typedef long long ll; signed main() { ll n, m, t; cin >> n >> m >> t; for(ll i = 0; i < m; i++) { ll pi, si, li; char di; cin >> pi >> si >> di >> li; ll engine; ll back; // std::cout << i << "\n"; if(di == 'R') { engine = pi+li-1 + (t*si); back = engine - li + 1; // cout << "B " << back << " E " << engine << "\n"; for(ll x = 0; x < n; x++) { if(x == engine) cout << "!"; else if(x < engine && x >= back) cout << "#"; else cout << "="; } } else { engine = pi - (t*si); back = engine + li - 1; // cout << "B " << back << " E " << engine << "\n"; for(ll x = 0; x < n; x++) { if(x == engine) cout << "!"; else if(x > engine && x <= back) cout << "#"; else cout << "="; } } cout << "\n"; } }