Subscriptions X36383


Statement
 

pdf   zip

There are a number of artists that have recorded albums with tracks. Moreover, there are a number of users subscribed to artists. Print the catalog of artists on the appropriate format, including the subscribed users of each artist.

Input

The input starts with an integer NN denoting the number of artists. The next NN 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 MM denoting the number of albums. The next MM 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 KK denoting the number of tracks. The next KK 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.

The next line contains an integer PP denoting the number of users. The next PP lines contain the description of each user on the format “<<user name>>-<<user email>>.

The next line containt an integer QQ denoting the number of subscriptions. The next QQ lines contain the description of each subscription on the format “<<user name>>-<<artist name>>.

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
    2
    A user-a@mail.org
    Another user-another@mail.org
    4
    A user-Pink Floyd
    Another user-Queen
    A user-Eagles
    Another user-The Beatles
    

    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]
    A user
    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]
    A user
    Queen [group]
    	Bohemian Rhapsody [357s]
    		bohemian.wav
    Album: A Night at the Opera
    1 - Bohemian Rhapsody [357s]
    Another user
    The Beatles [group]
    	Yellow Submarine [159s]
    		submarine.wav
    Album: Revolver [unlisted]
    1 - Yellow Submarine [159s]
    Another user
    
  • Information
    Author
    Anders Jonsson
    Language
    English
    Official solutions
    C++
    User solutions
    C++