#include #include using namespace std; static inline void output(const string& T) { bool parenthesis_mode = false; for (uint32_t i = 0; i != T.size(); ++i) switch (T[i]) { case '(': parenthesis_mode = true; break; case ')': parenthesis_mode = false; cout << '@'; break; default: if (!parenthesis_mode) cout << T[i]; break; } cout << '\n'; } int main() { cin.tie(nullptr); ios::sync_with_stdio(false); string T; T.reserve(100000); cin >> T; output(T); return 0; }