Problem:
Score : 100 points

Problem Statement

You have decided to give an allowance to your child depending on the outcome of the game that he will play now.

The game is played as follows:

There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a + printed on it.

The player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)

Then, the amount of the allowance will be equal to the resulting value of the formula.

Given the values A, B and C printed on the integer panels used in the game, find the maximum possible amount of the allowance.

Constraints

All values in input are integers.

1 \leq A, B, C \leq 9

Input

Input is given from Standard Input in the following format:

A B C

Output

Print the maximum possible amount of the allowance.

Sample Input 1

1 5 2

Sample Output 1

53

The amount of the allowance will be 53 when the panels are arranged as 52+1, and this is the maximum possible amount.

Sample Input 2

9 9 9

Sample Output 2

108

Sample Input 3

6 6 7

Sample Output 3

82

Solution in Fortran (gfortran v4.8.4) (judge verdict: Accepted)

module ABC110

  ! <module>s to import
  use, intrinsic :: iso_fortran_env

  ! require all variables to be explicitly declared
  implicit none

  ! accessibility of <subroutine>s and <function>s in this <module>
  public  :: task_A
  private :: calculate_maximum_allowance

  ! contained <subroutine>s and <function>s are below
  contains

  subroutine task_A

    ! variables for this <subroutine>
    integer(INT8) :: A, B, C

    ! STEP.01
    ! read out the given data
    read(unit=INPUT_UNIT, fmt=*) A, B, C

    ! STEP.02
    ! calculate & output the answer of the task
    write(unit=OUTPUT_UNIT, fmt='(I0)', advance='yes') calculate_maximum_allowance (A, B, C)

    ! STEP.END
    return

  end subroutine task_A

  pure function calculate_maximum_allowance (A, B, C) result(allowance)

    ! arguments for this <function>
    integer(INT8), intent(in) :: A, B, C

    ! return value of this <function>
    integer(INT8) :: allowance

    allowance =     10_INT8 * A + B + C
    allowance = max(10_INT8 * B + C + A, allowance)
    allowance = max(10_INT8 * C + A + B, allowance)

    return

  end function calculate_maximum_allowance

end module ABC110


program main

  ! <module>s to import
  use, non_intrinsic :: ABC110

  ! require all variables to be explicitly declared
  implicit none

  call task_A

end program main