#K82442. Shopping List Manager

    ID: 35976 Type: Default 1000ms 256MiB

Shopping List Manager

Shopping List Manager

You are given a series of operations to manage a shopping list. There are three types of operations:

  • ADD name category: Add an item with the specified name and category.
  • REMOVE name: Remove the earliest added occurrence of an item with the given name.
  • LIST category: List all items in the specified category in the order they were added. If the category is empty, output No items.

Process the operations in the order provided and output the results of each LIST command. The items must preserve their insertion order.

inputFormat

The first line contains an integer \(n\) representing the number of operations. The following \(n\) lines each contain an operation in one of the following formats:

  • ADD name category
  • REMOVE name
  • LIST category

outputFormat

For every LIST operation, output each item of the requested category on a new line, in the order they were added. If the requested category has no items, output No items.

## sample
7
ADD apple Fruits
ADD milk Dairy
ADD banana Fruits
REMOVE apple
LIST Fruits
LIST Dairy
REMOVE milk
banana

milk

</p>