#K76582. Library Management

    ID: 34674 Type: Default 1000ms 256MiB

Library Management

Library Management

This problem requires you to process a sequence of library events to determine the final status of each book in a library. Each event is either a check-in or a check-out, and the final status for a book is determined by its last event. The books should be listed in lexicographical order based on their IDs.

Formally, given \(T\) events where each event is in the form "CheckIn " or "CheckOut ", update each book's status: when a book is checked in, its state becomes "Available", and when it is checked out, its state becomes "Checked Out". Finally, output the status of every book sorted by the book's ID.

inputFormat

The input is read from stdin and has the following format:

  • The first line contains an integer \(T\), the number of events.
  • The following \(T\) lines each contain an event of the format "CheckIn " or "CheckOut ".

outputFormat

Print each book's ID and its final status separated by a space on a new line. The books must be printed in lexicographical order based on the book ID on stdout.

## sample
6
CheckIn book1
CheckOut book1
CheckIn book2
CheckOut book2
CheckIn book3
CheckOut book3
book1 Checked Out

book2 Checked Out book3 Checked Out

</p>