<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 async def print_what_is_playing(loop):
 """Connect to device and print what is playing."""

    details = conf.AppleTV(ADDRESS, NAME)
    details.add_service(conf.DmapService(HSGID))

    print('Connecting to {}'.format(details.address))
    atv = pyatv.connect_to_apple_tv(details, loop)

    try:
        print((await atv.metadata.playing()))
    finally:
        # Do not forget to logout
        await atv.logout()