
Option Strict On
Imports System.IO
Module Module1

    Sub Main()

        Dim input As StreamReader = New StreamReader("input.txt")
        Dim n, p As Integer
        n = Integer.Parse(input.ReadLine())
        Dim A(n - 1) As Integer
        Dim stri As String = input.ReadLine()
        Dim b As String
        For i As Integer = 0 To (n - 2)
            p = stri.IndexOf(";")
            b = stri.Substring(0, p)
            A(i) = Integer.Parse(b)
            Console.Write("{0},", A(i))
            stri = stri.Substring(p + 1)
        Next i
        A(n - 1) = Integer.Parse(stri)
        Console.WriteLine("{0}", A(n - 1))
        For k = 1 To n - 2
            For i As Integer = 0 To n - 2
                If A(i + 1) < A(i) Then
                    A(i) = A(i + 1) + A(i)
                    A(i + 1) = A(i) - A(i + 1)
                    A(i) = A(i) - A(i + 1)
                End If
            Next i
        Next k
        Console.WriteLine()
        Console.WriteLine("{0},{1},{2},{3},{4},{5},{6},{7},{8},{9}", A(0), A(1), A(2), A(3), A(4), A(5), A(6), A(7), A(8), A(9))
        input.Close()
        Console.ReadLine()
    End Sub

End Module
