#!/usr/bin/perl
print 1,sort"@{[2..<>]}"=~/\d/g