#K52162. Valid Email Printer

    ID: 29249 Type: Default 1000ms 256MiB

Valid Email Printer

Valid Email Printer

You are given a list of email addresses. The first line of input contains an integer \(n\) representing the number of email addresses. Each of the following \(n\) lines contains an email address.

Your task is to print each email address if it is valid. An email is considered valid if it contains the character '@'. Once an invalid email (an email without '@') is encountered, you must stop processing further emails.

For example, if the input is:

6
john.doe@example.com
jane-doe123@example.co.in
admin@website
fake.email#example.com
user@company.org
marketing@firm.com

Then the output should be:

john.doe@example.com
jane-doe123@example.co.in
admin@website

Note: The validation here is simplistic and only requires the presence of the '@' character.

inputFormat

The input is given via stdin and is formatted as follows:

  • The first line contains an integer \(n\), the number of email addresses.
  • The following \(n\) lines each contain a single email address.

outputFormat

Output the valid email addresses (those containing the '@' character) in the order they appear, one per line. Stop printing immediately when an invalid email is encountered. The output should be written to stdout.

## sample
5
john.doe@example.com
jane-doe123@example.co.in
admin@website
user@company.org
marketing@firm.com
john.doe@example.com

jane-doe123@example.co.in admin@website user@company.org marketing@firm.com

</p>