F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

Refrigerator Magnets

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 471    Accepted Submission(s): 274


Problem Description
Like many families with small children, my family¡¯s refrigerator is adorned with a set of alphabet magnets: 26 separate magnets, each containing one letter of the alphabet. These magnets can be rearranged to create words and phrases. I feel it is my parental duty to use these magnets to create messages that are witty and insightful, yet at the same time caring and supportive. Unfortunately, I am somewhat hindered in this task by the fact that I can only make phrases that use each letter once.
For example, a nice inspiring message to leave for the children might be, ¡°I LOVE YOU.¡± Unfortunately, I cannot make this message using my magnets because it requires two letter "O"s. I can, however, make the message, ¡°I LOVE MUSTARD.¡± Admittedly this message isn't as meaningful, but it does manage to not use any letters more than once.
You are to write a program that will look at a list of possible phrases and report which phrases can be written using refrigerator magnets.
 

Input
The input will consist of one or more lines, ending with a line that contains only the word ¡°END¡±.
Each line will be 60 characters or less, and will consist of one or more words separated by a single space each, with words using only uppercase letters (A¨CZ). There will not be any leading or trailing whitespace, and there will not be any blank lines.
 

Output
Output only the lines which can be written in refrigerator magnets¡ªthat is, the lines which have no duplicate letters. Output them exactly the same as they were in the input¡ªwhite spaces and all. Do not output the final ¡°END¡± string.
 

Sample Input
I LOVE YOU I LOVE MUSTARD HAPPY BIRTHDAY GLAD U BORN SMILE IMAGINE WHATS UP DOC HAVE A NICE DAY END
 

Sample Output
I LOVE MUSTARD GLAD U BORN SMILE WHATS UP DOC
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-11-22 16:50:20, Gzip enabled