#include <bits/stdc++.h>
using namespace std;
void SelectionSort(int A[], int N) {
  int count = 0;
  int minj;
  for (int i = 0; i < N; i++) {
    minj = i;
    for (int j = i; j < N; j++) {
      if (A[j] < A[minj]) {
        minj = j;
      }
    }
    if (minj != i) {
      int tmp = A[i];
      A[i] = A[minj];
      A[minj] = tmp;
      count++;
    }
  }
  for (int i = 0; i < N; i++) {
    cout << A[i] << " ";
  }
  cout << endl;
  cout << "???????????°???" << count << "??§??????" << endl;
}
int main() {
  const int num = 6;
  int Array[num];
  for (int i = 0; i < num; i++) {
    cin >> Array[i];
  }
  SelectionSort(Array, num);
  return 0;
}
