#include using namespace std; using ll = long long; using vi = vector; int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); ll n, m, t; cin >> n >> m >> t; for (ll i = 0; i < m; ++i) { char d; ll p, s, l, engine, end; cin >> p >> s >> d >> l; if (d == 'R') { engine = (p - 1 + l); end = p; } else { engine = p; end = (p - 1 + l); } ll distance = s * t; for (ll j = 0; j < n; ++j) { ll position = 0; if (d == 'R') { position = j - distance; } else { position = j + distance; } if (position == engine) { cout << "!"; continue; } if (d == 'R') { if (position < engine && position >= end) { cout << "#"; continue; } } else { if (position > engine && position <= end) { cout << "#"; continue; } } cout << "="; } cout << "\n"; } return 0; }