310922: CF1910A. Username

Memory Limit:256 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

A. Usernametime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard output

On the official website of Berland, each account has two parameters: username and ID.

Username is a string consisting of lowercase Latin letters and/or digits, which contains at least one letter. For example, user0, 1fox1, zzzz are correct usernames, but 1337 and User22 are not.

The ID of the account for a given username is generated as follows: a positive integer without leading zeroes is appended to the end of the username. For example, the ID user0125 can be generated by the following usernames: user012, user01, user0; but neither by user nor us.

You are given a string $s$ — a valid ID. Your task is to determine any valid username that can generate the given ID. If there are several correct usernames, you can print any of them.

Input

The first line contains a single integer $t$ ($1 \le t \le 10^3$) — the number of test cases.

The only line of each test case contains a string $s$ ($2 \le |s| \le 50$), consisting of lowercase Latin letters and/or digits.

Additional constraint on input: there is at least one valid username that can generate the given ID.

Output

For each test case on a separate line, print a string — any valid username that can generate the given ID. If there are multiple correct usernames, you can print any of them.

ExampleInput
4
user0125
a1
kotlin990000
1code0forces101
Output
user0
a
kotlin9
1code0forces

Output

题目大意:
在贝尔兰的官方网站上,每个账户有两个参数:用户名和ID。用户名是由小写拉丁字母和/或数字组成的字符串,且至少包含一个字母。例如,`user0`、`1fox1`、`zzzz` 是正确的用户名,但 `1337` 和 `User22` 不是。给定用户名的ID生成方式是在用户名后附加一个没有前导零的正整数。例如,ID `user0125` 可以由用户名 `user012`、`user01`、`user0` 生成,但不能由 `user` 或 `us` 生成。给你一个字符串 $ s $ —— 一个有效的ID,你的任务是确定可以生成给定ID的任何有效用户名。如果有多个正确的用户名,你可以打印其中任何一个。

输入数据格式:
第一行包含一个整数 $ t $ ($ 1 \le t \le 10^3 $) —— 测试用例的数量。
每个测试用例只有一行,包含一个字符串 $ s $ ($ 2 \le |s| \le 50 $),由小写拉丁字母和/或数字组成。
输入的附加约束:至少有一个有效的用户名可以生成给定的ID。

输出数据格式:
对于每个测试用例,在单独的一行中打印一个字符串 —— 可以生成给定ID的任何有效用户名。如果有多个正确的用户名,你可以打印其中任何一个。

示例:
```
Input
4
user0125
a1
kotlin990000
1code0forces101

Output
user0
a
kotlin9
1code0forces
```

注意:由于您请求使用LaTeX格式表示公式,但上述内容中没有公式,因此没有使用LaTeX格式。题目大意: 在贝尔兰的官方网站上,每个账户有两个参数:用户名和ID。用户名是由小写拉丁字母和/或数字组成的字符串,且至少包含一个字母。例如,`user0`、`1fox1`、`zzzz` 是正确的用户名,但 `1337` 和 `User22` 不是。给定用户名的ID生成方式是在用户名后附加一个没有前导零的正整数。例如,ID `user0125` 可以由用户名 `user012`、`user01`、`user0` 生成,但不能由 `user` 或 `us` 生成。给你一个字符串 $ s $ —— 一个有效的ID,你的任务是确定可以生成给定ID的任何有效用户名。如果有多个正确的用户名,你可以打印其中任何一个。 输入数据格式: 第一行包含一个整数 $ t $ ($ 1 \le t \le 10^3 $) —— 测试用例的数量。 每个测试用例只有一行,包含一个字符串 $ s $ ($ 2 \le |s| \le 50 $),由小写拉丁字母和/或数字组成。 输入的附加约束:至少有一个有效的用户名可以生成给定的ID。 输出数据格式: 对于每个测试用例,在单独的一行中打印一个字符串 —— 可以生成给定ID的任何有效用户名。如果有多个正确的用户名,你可以打印其中任何一个。 示例: ``` Input 4 user0125 a1 kotlin990000 1code0forces101 Output user0 a kotlin9 1code0forces ``` 注意:由于您请求使用LaTeX格式表示公式,但上述内容中没有公式,因此没有使用LaTeX格式。

加入题单

上一题 下一题 算法标签: