n, l = list(map(int, input().split()))

s = [eval(input()) for _ in range(n)]

s.sort()

print((''.join(s)))

def main():

    n, _ = list(map(int, input().split()))

    s = [eval(input()) for _ in range(n)]

    s.sort()

    print((''.join(s)))





if __name__ == '__main__':

    main()

n, l = list(map(int, input().split()))
s = [eval(input()) for _ in range(n)]
s.sort()
print(("".join(s)))

def main():
    n, _ = list(map(int, input().split()))
    s = [eval(input()) for _ in range(n)]
    s.sort()
    print(("".join(s)))


if __name__ == "__main__":
    main()

-n, l = list(map(int, input().split())) -s = [eval(input()) for _ in range(n)] -s.sort() -print(("".join(s))) +def main(): +    n, _ = list(map(int, input().split())) +    s = [eval(input()) for _ in range(n)] +    s.sort() +    print(("".join(s))) + + +if __name__ == "__main__": +    main()