Algorithm title: UVA 620 Cellular Structure (DP)

Source: Internet
Author: User

Cellular Structure

A chain of connected cells of two types A and B composes a cellular structure of some microorganisms of species.

If no mutation had happened during growth of a organism, its cellular chain would take one of the following forms:

Sample notation O = OA means that if we added to chain of a healthy organism a cell a from the right hand side, we would E nd up also with a chain of healthy organism. It would grow by one cell A.

A laboratory researches a cluster of these organisms. Your task is to write a program which could find out a current stage of growth and health of a organism, given its Cellul AR chain sequence.

Input

A integer n being a number of cellular chains to test, and then n consecutive lines containing chains of tested organisms.

Output

For each tested chain give (in separate lines) proper answers:

If a organism were in two stages of growth on the same time the ' I ' from the list above should to given as an Swer.

Sample Input

4
A
AAB
Baab
Baaba

Sample Output

Simple
fully-grown
mutant
mutagenic

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.