Artist Catalog X29767


Statement
 

pdf   zip

html

There are a number of artists that have recorded albums with tracks. Print the catalog of artists on the appropriate format.

Input

The input starts with an integer N denoting the number of artists. The next N lines contain the description of each artist on the format “<artist name>-<isGroup>”, where <artist name> is the name of the artist and <isGroup> equals “Y” if the artist is a group, and “N” otherwise.

The next line contains an integer M denoting the number of albums. The next M lines contain the description of each album on the format “<artist name>-<album name>-<isListed>”, where <artist name> is the name of the artist recording the album, <album name> is the name of the album, and <isListed> equals “Y” if the album is listed, and “N” otherwise.

The next line contains an integer K denoting the number of tracks. The next K lines contain the description of each track on the format “<artist name>-<album name>-<track name>-<master file>-<duration>”. Here, <master file> is the name of the sound file containing the track, and <duration> is its duration in seconds.

Output

For each artist in the order they appear in the input, print its information on the format specified in the example.

Public test cases
  • Input

    5
    Pink Floyd-Y
    Guns'N'Roses-Y
    Eagles-Y
    Queen-Y
    The Beatles-Y
    5
    Pink Floyd-Dark Side Of The Moon-Y
    Guns'N'Roses-Appetite For Destruction-N
    Eagles-Hotel California-Y
    Queen-A Night at the Opera-Y
    The Beatles-Revolver-N
    6
    Pink Floyd-Dark Side Of The Moon-Money-money.wav-390
    Pink Floyd-Dark Side Of The Moon-Us and Them-us.wav-471
    Guns'N'Roses-Appetite For Destruction-Welcome to the Jungle-jungle.wav-271
    Eagles-Hotel California-Hotel California-hotel.wav-390
    Queen-A Night at the Opera-Bohemian Rhapsody-bohemian.wav-357
    The Beatles-Revolver-Yellow Submarine-submarine.wav-159
    

    Output

    Pink Floyd [group]
    	Money [390s]
    		money.wav
    	Us and Them [471s]
    		us.wav
    Album: Dark Side Of The Moon
    1 - Money [390s]
    2 - Us and Them [471s]
    Guns'N'Roses [group]
    	Welcome to the Jungle [271s]
    		jungle.wav
    Album: Appetite For Destruction [unlisted]
    1 - Welcome to the Jungle [271s]
    Eagles [group]
    	Hotel California [390s]
    		hotel.wav
    Album: Hotel California
    1 - Hotel California [390s]
    Queen [group]
    	Bohemian Rhapsody [357s]
    		bohemian.wav
    Album: A Night at the Opera
    1 - Bohemian Rhapsody [357s]
    The Beatles [group]
    	Yellow Submarine [159s]
    		submarine.wav
    Album: Revolver [unlisted]
    1 - Yellow Submarine [159s]
    
  • Information
    Author
    Anders Jonsson
    Language
    English
    Official solutions
    C++
    User solutions
    C++