Problem:
Sorting Three Numbers

Write a program which reads three integers, and prints them in ascending order.

Input

Three integers separated by a single space are given in a line.

Output

Print the given integers in ascending order in a line. Put a single space between two integers.

Constraints

1 ≤ the three integers ≤ 10000

Sample Input 1

3 8 1

Sample Output 1

1 3 8

Solution in Ruby (judge verdict: Wrong Answer)

def three_sort(a,b,c)
  #  result = Array.new(3)
  if b > a
    ia = a
    ib = b
    a = ia
    b = ib
    if b > c
      ib = b
      ic = c
      b = ic
      c = ib
    end
    if a > b
      ia = a
      ib = b
      a = ib
      b = ia
    end
  else
    if b > c
      ib = b
      ic = c
      b = ic
      c = ib
    end
    if a > b
      ia = a
      ib = b
      a = ib
      b = ia
    end
  end
#  result[0]=a
#  result[1]=b
#  result[2]=c
  result = a.to_s + " " + b.to_s + " " + c.to_s + "\n"
  return result
end

abc = gets()
ar = abc.split(" ")
a = ar[0].to_i()
b = ar[1].to_i()
c = ar[2].to_i()
print three_sort(a,b,c)