#! /usr/bin/python
# -*- coding:utf-8 -*-

import sys, os
import re
import json

def main():
    for line in sys.stdin:
        line = line.strip()
        fields = line.split('\t')
        pak = json.loads(fields[2])
        for package_name in pak :
            try:
                print '\t'.join([fields[0],fields[1],package_name.encode('utf-8'),fields[3]])
            except ValueError,e:
                continue

if __name__ == "__main__":
    main()