import java.util.*; class Main{ public static void main(String[] args) { try(Scanner sc = new Scanner(System.in)){ int n = Integer.valueOf(sc.next()); ArrayList line = new ArrayList(); for(int i = 0; i < n; i++){ int value = Integer.valueOf(sc.next()); if(i != 0){ for(int j = 0; j < line.size(); j++){ if(line.get(j) > value){ line.add(j - 1, value); break; } } } } System.out.println(line); }catch(Exception e){ e.printStackTrace(); } } }