if __name__ == "__main__":
ref_tokens = ref.strip().split(' ')
input_line = sys.stdin.readline().strip()
tokens = input_line.split(' ')
# We assume that stdin has more tokens than reference input.
for ref_token in ref_tokens:
if tokens[idx].strip() == '':
if ''.join(tmp_buf) == ref_token:
buf += [STR + tmp_buf[0].strip()] + tmp_buf[1:]
sys.stdout.write(' '.join(buf) + '\n')