Nihongo wa Muzukashii D
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld

题目描述

Japanese is one of the most difficult languages to learn in the world. Among all those twisted grammar rules, the most troublesome ones for the beginners must be the rules.

Japanese verbs appear in different forms under different contexts. By the conjugation rules between their different forms, Japanese verbs can be roughly grouped into three types. We now introduce you the to conjugation rule for the first type of verbs.
  • We say a verb is in masu form if it ends with “masu” (ます). For example, “naraimasu” (習います,learn) and “nomimasu” (飲みます, drink) are all masu form verbs.
  • We say a verb is in te form if it ends with “te” (て) or “de” (で). For example, “naratte” (習って,learn) and “nonde” (飲んで, drink) are all te form verbs.
  • If the masu form of a verb ends with “imasu” (います), “chimasu” (ちます) or “rimasu” (ります),to change it into its te form, we remove the “imasu”, “chimasu” or “rimasu” at the end and append“tte” (って) to it. For example, “kaimasu” (買います, buy) → “katte” (買って), “machimasu” (待ちます, wait) → “matte” (待って) and “kaerimasu” (帰ります, return) → “kaette” (帰って).
  • If the masu form of a verb ends with “mimasu” (みます), “bimasu” (びます) or “nimasu” (にます),to change it into its te form, we remove the “mimasu”, “bimasu” or “nimasu” at the end and append“nde” (んで) to it. For example, “nomimasu” (飲みます, drink) → “nonde” (飲んで), “yobimasu”(呼びます, call) → “yonde” (呼んで) and “shinimasu” (死にます, die) → “shinde” (死んで).
  • If the masu form of a verb ends with “kimasu” (きます), to change it into its te form, we removethe “kimasu” at the end append “ite” (いて) to it. For example, “kakimasu” (書きます, write) →“kaite” (書いて). But there is only one verb this rule does not apply, which is the verb “ikimasu”(行きます, go) → “itte” (行って).
  • If the masu form of a verb ends with “gimasu” (ぎます), to change it into its te form, we removethe “gimasu” at the end and append “ide” (いで) to it. For example, “isogimasu” (急ぎます, hurry)→ “isoide” (急いで).
  • If the masu form of a verb ends with “shimasu” (します), to change it into its te form, we removethe “shimasu” at the end and append “shite” (して) to it. For example, “kashimasu” (貸します,lend) → “kashite” (貸して).
It's time to check how much you've learnt in this lesson! Given a Japanese verb of the first type in its masu form represented in romaji (which means in lower-cased English letters), please change it into its te form.

You might have noticed that if we represent a Japanese verb in romaji, for example ``nomimasu'', it's hard to tell whether this verb ends with ``imasu'' or ``mimasu'' for the beginners (actually it ends with ``mimasu'' as ``mi'' is one syllable). To simplify this problem, we will not provide you with verbs ending with ``imasu''.

输入描述:

There are multiple test cases. The first line of the input contains an integer  (about 100) indicating the number of test cases. For each test case:

The first and only line contains a string s () which is a Japanese verb of the first type in its masu form presented in romaji. This verb is guaranteed to end with ``chimasu'', ``rimasu'', ``mimasu'', ``bimasu'', ``nimasu'', ``kimasu'', ``gimasu'' or ``shimasu''.

输出描述:

For each test case output one line containing one string indicating the te form of the verb in romaji.
示例1

输入

复制
10
machimasu
kaerimasu
nomimasu
yobimasu
shinimasu
kakimasu
ikimasu
kikimasu
isogimasu
kashimasu

输出

复制
matte
kaette
nonde
yonde
shinde
kaite
itte
kiite
isoide
kashite