title: Form a number according to the given conditions
body: <p>Given three single digit numbers, write a code to find the largest number with smallest middle digit. For example, given the input as 3, 9, 8 the number to be formed is 938.</p>
  <p><strong>Input Format</strong></p>
  <p>First line contains the first single digit number, d1</p>
  <p>Next line contains the second single digit number, d2</p>
  <p>Next line contains the third single digit number, d3</p>
  <p><strong>Output Format</strong></p>
  <p>Print the number formed</p>
  <p>Why is my code wrong?</p>
  <pre><code>d1=int(input())
  d2=int(input())
  d3=int(input())
  lists=[d1,d2,d3]
  y=lists.sort()
  a=y[2]
  b=y[1]
  c=y[0]
  num=(int(a)*100)+(int(c)*10)+int(b)
  print(num)
  </code></pre>