while True: try: first_num = int(input()) first_list = list(map(int, input().split(" "))) second_num = int(input()) second_list = list(map(int, input().split(" "))) total_list = first_list + second_list total_list = list(set(total_list)) total_list.sort() res = ''.join(list(map(str, total_list))) print(res) except EOFError: break要注意字符串可能存在 -1 -3 排序有问题的情况,因此一定要转换成整型排序