Attendance
InterviewTime limit1sMemory limit1024 MB
Given a log of called names and Present! replies, print the names of students who never answered Present!, in the order they were called.
- Level
Easy2 of 10
- Topics
- String, Implementation
- Solved
- No attempts yet
Problem
Taking attendance in your class is a tedious task. You call out student names one at a time in alphabetical order. If a student is present, they respond by saying "Present!" before you call the next name.
The task is so boring that you sometimes zone out and fail to keep a proper record of attendance. Write a program that summarizes the absences.
Input
The first line contains a single integer , the number of callouts. The next lines contain the callouts in the order they were made. Each line is either a student's name or the response Present!.
A name is between 2 and 10 characters long. The first character is an uppercase letter ('A'-'Z'), and the remaining characters are lowercase letters ('a'-'z').
Student names appear in alphabetical order in the input. A Present! line appears only if the previous line was a student's name. In particular, Present! never appears as the first callout.
Output
Output the names of all absent students in the order they were called, one per line. If no students were absent, output No Absences.