Codeforces Beta Round 40(Div. 2)
C
电子邮件地址
Email address
Codeforces
1300
原题
← BD →

电子邮件地址AI (CI翻译)

Sometimes one has to spell email addresses over the phone. Then one usually pronounces a dot as dot, an at sign as at. As a result, we get something like vasyaatgmaildotcom. Your task is to transform it into a proper email address (vasya@gmail.com).

有时人们需要通过电话拼读电子邮件地址。这时,通常会将点读作 dot,将 at 符号读作 at。因此,我们会得到类似于 vasyaatgmaildotcom 的字符串。你的任务是将其转换为正确的电子邮件地址(vasya@gmail.com)。AI (CI翻译)

It is known that a proper email address contains only such symbols as . @ and lower-case Latin letters, doesn't start with and doesn't end with a dot. Also, a proper email address doesn't start with and doesn't end with an at sign. Moreover, an email address contains exactly one such symbol as @, yet may contain any number (possible, zero) of dots.

已知,一个正确的电子邮件地址只包含 .@ 和小写拉丁字母,不以点开头,也不以点结尾。此外,正确的电子邮件地址不以 at 符号开头,也不以 at 符号结尾。而且,电子邮件地址中恰好包含一个 @ 符号,但可以包含任意数量(也可以为零)的点。AI (CI翻译)

You have to carry out a series of replacements so that the length of the result was as short as possible and it was a proper email address. If the lengths are equal, you should print the lexicographically minimal result.

你需要进行一系列替换,使结果的长度尽可能短,并且结果是一个正确的电子邮件地址。如果长度相同,则输出字典序最小的结果。AI (CI翻译)

Overall, two variants of replacement are possible: dot can be replaced by a dot, at can be replaced by an at.

总共有两种可能的替换:可以将 dot 替换为点,也可以将 at 替换为 at 符号。AI (CI翻译)

Input

输入格式

AI (CI翻译)

The first line contains the email address description. It is guaranteed that that is a proper email address with all the dots replaced by dot an the at signs replaced by at. The line is not empty and its length does not exceed 100 symbols.

第一行包含电子邮件地址的描述。保证该描述是将一个正确的电子邮件地址中的所有点替换为 dot、所有 at 符号替换为 at 后得到的结果。该行非空,长度不超过 100 个字符。AI (CI翻译)

Output

输出格式

AI (CI翻译)

Print the shortest email address, from which the given line could be made by the described above replacements. If there are several solutions to that problem, print the lexicographically minimal one (the lexicographical comparison of the lines are implemented with an operator < in modern programming languages).

输出能够通过上述替换由给定字符串得到的最短电子邮件地址。如果有多个解,则输出字典序最小的一个(现代编程语言中,字符串的字典序比较通过运算符 < 实现)。AI (CI翻译)

In the ASCII table the symbols go in this order: . @ ab...z

在 ASCII 表中,字符的顺序为:. @ ab...z AI (CI翻译)

样例

Input #1
vasyaatgmaildotcom
Output #1
vasya@gmail.com
InputCopy OutputCopy
Input #2
dotdotdotatdotdotat
Output #2
dot..@..at
InputCopy OutputCopy
Input #3
aatt
Output #3
a@t
InputCopy OutputCopy
题目信息
题号
41C
时间限制
2 s
内存限制
256 MB
标签
表达式解析
模拟

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(gpt-6.1-sol),如有出入请以原文为准。