#!/usr/bin/env python2.7

import sys
import argparse

parser = argparse.ArgumentParser()
parser.add_argument("-s", "--separator", help="The character(s) used to separate the line into a list of fields (default: \";\")", default=";", metavar="STRING")
parser.add_argument("-d", "--delimiter", help="The character(s) that separates key/value pairs (default: \"=\")", default="=", metavar="STRING")
parser.add_argument("-k", "--out-key", help="The key/value pair to be printed out (mandatory)",  required=True, metavar="STRING")
args = parser.parse_args()

INPUT = sys.stdin

for line in INPUT:
	lst = line.rstrip().split(args.separator)
	dic = {}
	for item in lst:
		try:
			dic[item.split(args.delimiter)[0]] = item.split(args.delimiter)[1]
		except IndexError:
			pass
	#
	sys.stdout.write(args.out_key + args.delimiter + dic[args.out_key] + "\n")
