a=max, while 1:a+=input(),;print(*map(*a),sep='')