import sys
import json

if __name__ == '__main__':

    for line in sys.stdin:
        array = line.strip().split('\t')
        if len(array) != 2:
            continue
        pkg_list = json.loads(array[0])
        platform = array[1]
        platform = 'ios' if platform == 'ios' else 'adr'
        for pkg in pkg_list:
            if 'package_name' in pkg:
                print('\t'.join([pkg['package_name'], platform]))