def main():

    N, L = (int(i) for i in input().split())

    A = [eval(input()) for i in range(N)]

    A.sort()

    print(("".join(A)))





if __name__ == '__main__':

    main()

def main():

    N, K = (int(i) for i in input().split())

    A = [eval(input()) for i in range(N)]

    A.sort()

    print(("".join(A)))





if __name__ == '__main__':

    main()

def main():
    N, L = (int(i) for i in input().split())
    A = [eval(input()) for i in range(N)]
    A.sort()
    print(("".join(A)))


if __name__ == "__main__":
    main()

def main():
    N, K = (int(i) for i in input().split())
    A = [eval(input()) for i in range(N)]
    A.sort()
    print(("".join(A)))


if __name__ == "__main__":
    main()

-    N, L = (int(i) for i in input().split()) +    N, K = (int(i) for i in input().split())