def rearrange_digits(input_list):
    """
    Rearrange Array Elements so as to form two number such that their sum is maximum.
    Args:
       input_list(list): Input List
    Returns:
       (int),(int): Two maximum sums
    """
    frequency = [0 for i in range(10)]
    for i in input_list:
        frequency[i]+= 1

    first_number, second_number = 0,0
    first = True
    for i in range(10):
        while frequency[9-i] > 0:
            if first:
                first_number *= 10
                first_number += 9-i
                first = False
            else:
                second_number *= 10
                second_number += 9-i
                first = True
            frequency[9-i] -= 1
    return (first_number, second_number)