P10397 『STA - R5』5k.sync.closer

Description

Given a [`std::freopen`](https://zh.cppreference.com/w/cpp/io/c/freopen) statement, output the name of the file it operates on. Formally, every [`std::freopen`](https://zh.cppreference.com/w/cpp/io/c/freopen) statement should be exactly ```cpp std::freopen("","",); ``` where `` is the name of the file it operates on. It contains at least one character, and can only contain the following characters: - uppercase English letters; - lowercase English letters; - Arabic digits; - the ASCII dot `.`. `` is the file access mode, and can only be one of `r`, `w`, `a`. `` is the file stream, and can only be one of `stdin`, `stdout`, `stderr`. You need to answer $T$ queries.

Input Format

**This problem contains multiple queries in a single test case.** The first line contains a positive integer $T$, representing the number of queries. For each query: one line contains a string, representing a [`std::freopen`](https://zh.cppreference.com/w/cpp/io/c/freopen) statement.

Output Format

For each query, output one line with a string, representing the name of the file it operates on.

Explanation/Hint

**This problem uses bundled tests.** For $100\%$ of the testdata: - $1 \le T \le 1000$. - The length of each statement does not exceed $1000$. The detailed score distribution is as follows: - Subtask 1 (30pts): the filename is guaranteed to be `5k.sync.closer`. - Subtask 2 (30pts): the filename length is guaranteed to be $1$. - Subtask 3 (40pts): no special restrictions. Translated by ChatGPT 5