def sort_array_012(array):
    """Sort an array of 0s, 1s and 2s."""
    # Dictionary of numbers encountered
    data = {0: 0, 1: 0, 2: 0}
    output = ''
    for x in array:
        data[x] = data[x] + 1

    for key, value in data.items():
        output += f'{key},' * value

    return output.split(',')[:-1]