#include <bits/stdc++.h>
int N = 100;
void out(int A[], int n, int count) {
  int i;
  for (i = 0; i < n; i++) {
    if (i > 0) printf(" ");
    printf("%d", A[i]);
  }
  printf("\n");
}
void swap(int *x, int *y) {
  int tmp;
  tmp = *x;
  *x = *y;
  *y = tmp;
}
void selectionSort(int *A, int n) {
  int i, j, min, count = 0;
  for (i = 0; i < n - 1; i++) {
    min = i;
    for (j = i + 1; j < n; j++) {
      if (A[j] < A[min]) {
        min = j;
      }
    }
    swap(&A[i], &A[min]);
    count++;
  }
  out(A, n, count);
}
int main(void) {
  int n, i;
  int A[N + 1];
  scanf("%d", &n);
  for (i = 0; i < n; i++) scanf("%d", &A[i]);
  selectionSort(A, n);
  return 0;
}
