x=input()[::-1]while x[5:]:x.remove(min(x))print x[::-1]
[6, 3, 2, 0, 69, 22, 0, 37, 0, 2, 1, 0, 0, 0, 5, 0, 1, 2, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 2]
[6, 69, 22, 37, 5]
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!