#K80937. Find Disqualified Participants
Find Disqualified Participants
Find Disqualified Participants
You are given a list of team registrations. Each registration record consists of an email and a team code. A participant is disqualified if they have registered for more than one distinct team. Your task is to identify all such disqualified participants.
Note: Email addresses are case-sensitive, i.e. alice@example.com
and Alice@example.com
are treated as different.
The emails of disqualified participants should be output in lexicographical (alphabetical) order, one per line. If no participant is disqualified, output nothing.
inputFormat
The first line of input contains an integer n representing the number of team registrations.
The next n lines each contain a registration record presented as two strings separated by a space: the participant's email and a team code.
You can assume that each team code is a single word and each email contains no spaces.
outputFormat
Output the email addresses of all participants who registered for more than one team, sorted in lexicographical order, with one email per line. If no participant is disqualified, print nothing.
## sample8
alice@example.com teamA
bob@example.com teamB
alice@example.com teamC
carol@example.com teamD
dave@example.com teamE
eve@example.com teamF
carol@example.com teamG
alice@example.com teamH
alice@example.com
carol@example.com
</p>