#! /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')
        category_list = json.loads(fields[2])
        category = category_list[0]["name"]
        try:
            print '\t'.join([fields[0],fields[1],category.encode('utf-8')])
        except ValueError,e:
            continue

if __name__ == "__main__":
    main()

