Problem:


List of Top 3 Hills

There is a data which provides heights (in meter) of mountains. The data is only for ten mountains.

Write a program which prints heights of the top three mountains in descending order.

Input

Height of mountain 1
Height of mountain 2
Height of mountain 3
 .
 .
Height of mountain 10

Constraints

0 ≤ height of mountain (integer) ≤ 10,000

Output

Height of the 1st mountain
Height of the 2nd mountain
Height of the 3rd mountain

Sample Input 1

1819
2003
876
2840
1723
1673
3776
2848
1592
922

Output for the Sample Input 1

3776
2848
2840

Sample Input 2

100
200
300
400
500
600
700
800
900
900

Output for the Sample Input 2

900
900
800



Sample input:
1819
2003
876
2840
1723
1673
3776
2848
1592
922


Sample output:
3776
2848
2840

Submission status: Runtime Error

Solution code:
<?php
$hi = fopen('php://stdin', "r");
$ho = fopen('php://stdout', "w");

# 空の配列を作成
$arr = array();

# 標準入力からデータをセット
for($i = 0; $i < 10; $i++)
{
	fscanf($hi, "%d", $arr[]);
}

# 降順ソート
rsort($arr);

# 出力
for($i = 0; $i < 3; $i++)
{
	fwrite($ho, sprintf("%d\n", $arr[$i]));
}

fclose($ho);
fclose($hi);

Submission status: Runtime Error

Solution code:
out = []

def out.higher?(v)
  return true if self.size < 3
  self.each do |h|
    return true if v > h
  end
  return false
end

def out.push(v)
  if self.size < 3
    self << v
    return
  end
  min = 10000
  min_i = 3
  self.each_with_index do |h, i|
    min, min_i = h, i if min > h
  end
  self[min_i] = v
end

def out.puts_desc
  order = []
  3.times do
    max = 0
    max_i = 3
    self.each_with_index do |h, i|
      max, max_i = h, i if max < h
    end
    order << max
    self.delete_at(max_i)
  end
  order.each do |v|
    puts v
  end
end

10.times do |count|
  num = readline.to_i
  if out.higher? num
    out.push num
  end
end

out.puts_desc

Submission status: Runtime Error

Solution code:
a = [0 for i in range(10)]

for i in range(10):
    a[i] = int(raw_input())

a.sort().reverse()

print a[0]
print a[1]
print a[2]

Submission status: Runtime Error

Solution code:
#!/usr/bin/python

array = []

for i in range(10):
  array[i] = raw_input()

for j in range(3):
  print max(array) + "\n"
  array.remove(max(array))

Submission status: Runtime Error

Solution code:
#!/usr/bin/python

import sys

array = []

for i in range(10):
  array[i] = raw_input()

for j in range(3):
  print max(array) + "\n"
  array.remove(max(array))

sys.exit()

Submission status: Runtime Error

Solution code:
from sys import stdin
x = [int(input()) for i range(10)]

x.sort(reverse=True)

for i in x[:3]: print(i)

Submission status: Runtime Error

Solution code:
from sys import stdin

x = [int(input()) for i range(10)]

x.sort(reverse=True)

for i in x[:3]: print(i)

Submission status: Runtime Error

Solution code:
a = sorted(map(int,input().split(" ")),reverse=True)
for i in range(0,3):
	print(a[i])

Submission status: Runtime Error

Solution code:
m=[1819,2003,876,2840,1723,1673,3776,2848,1592,922]
m.sort().reverse()
print m[0|2]

Submission status: Runtime Error

Solution code:
mountain=[a,b,c,d,e,f,g,h,i,j]

mountain.sort()

print mountain[-1]
print mountain[-2]
print mountain[-3]

Submission status: WA: Presentation Error

Solution code:
# -*- coding:utf-8 -*-

first = 0
second = 0
third = 0
i = 0

for i in range(0,9):
    line = int(input())
    
    if first < int(line):
        third = second
        second = first
        first = int(line)
    elif second < int(line):
        third = second
        second = int(line)
    elif third < int(line):
        third = int(line)

print()
print(first)
print(second)
print(third)

Submission status: WA: Presentation Error

Solution code:
first = 0
second = 0
third = 0
i = 0

for i in range(0,9):
    line = int(input())
    
    if first < int(line):
        third = second
        second = first
        first = int(line)
    elif second < int(line):
        third = second
        second = int(line)
    elif third < int(line):
        third = int(line)

print()
print(first)
print(second)
print(third)

Submission status: WA: Presentation Error

Solution code:
# -*- coding:utf-8 -*-

first = 0
second = 0
third = 0
i = 0

for i in range(0,9):
    line = int(input())
    
    if first < int(line):
        third = second
        second = first
        first = int(line)
    elif second < int(line):
        third = second
        second = int(line)
    elif third < int(line):
        third = int(line)

print(first)
print(second)
print(third)
print()

Submission status: WA: Presentation Error

Solution code:
# -*- coding:utf-8 -*-

first = 0
second = 0
third = 0
i = 0

for i in range(0,9):
    line = int(input())
    
    if first < int(line):
        third = second
        second = first
        first = int(line)
    elif second < int(line):
        third = second
        second = int(line)
    elif third < int(line):
        third = int(line)

print()
print()

print(first)
print(second)
print(third)

Submission status: WA: Presentation Error

Solution code:
# -*- coding:utf-8 -*-

first = 0
second = 0
third = 0
i = 0

for i in range(0,9):
    line = int(input())
    
    if first < int(line):
        third = second
        second = first
        first = int(line)
    elif second < int(line):
        third = second
        second = int(line)
    elif third < int(line):
        third = int(line)
print()
print(first)
print(second)
print(third)

exit()

Submission status: WA: Presentation Error

Solution code:
# -*- coding:utf-8 -*-

first = 0
second = 0
third = 0
i = 0

for i in range(0,10):
    line = int(input())
    
    if first < int(line):
        third = second
        second = first
        first = int(line)
    elif second < int(line):
        third = second
        second = int(line)
    elif third < int(line):
        third = int(line)
print()
print(first)
print(second)
print(third)

exit()

Submission status: WA: Presentation Error

Solution code:
values = []
for i in range(10):
    values.append(int(input()))

top3 = []
for i in range(3):
    Max = max(values)
    top3.append(Max)
    values.remove(Max)

print(''.join(str(x) + '\n' for x in top3))

Submission status: WA: Presentation Error

Solution code:
rank = sorted([int(input()) for i in range(10)], reverse=True)
print('\n'.join(map(str, rank[:3])) + '\n')

Submission status: WA: Presentation Error

Solution code:
li2 = sorted([int(input()) for i in range(10)], reverse=True)
print()
print(li2[0])
print(li2[1])
print(li2[2])

Submission status: WA: Presentation Error

Solution code:
data = []
for i in range(0,10):
    data.append(int(input()))

print()

data.sort()
data.reverse()

for i in range(0,3):
    print(data[i])