More and more of our daily life takes place online. To confirm our identity online services often require a password. However, these services are often not satisfied with just any password. This is, of course, completely justified. Usually several conditions are imposed in order to prevent passwords from being easily guessed. A password provides strong protection if all of the following conditions are met.
If three or four of these conditions apply, the password provides moderate protection, and if less than three conditions are met it provides weak protection.

Input

The first line of the input contains an integer $$t$$ ($$1\leq t \leq 100$$) which indicates how many test cases there are. This is followed by $$t$$ lines, each containing one password.

Output

For each password one of the words must be printed as strong, moderate or weak, as an indication of the strength of the password protection.

Example

Input:

3
password
Prog2011
five+1=SIX

Output:

weak
moderate
strong