#include <stdio.h>
#include <strings.h>

#define SIZE 4

int main() {
  int tab[SIZE] = {1, -1, 10, 4};
  int new_tab[SIZE];
  for (int index = 0; index < SIZE - 1; ++index) {

    int min_index = index;
    int min = tab[min_index];

    for (int i = min_index + 1; i < SIZE; ++i) {
      if (tab[i] < min) {
        min = tab[i];
        min_index = i;
      }
    }
    new_tab[index] = min;
  }
  for (int i = 0; i < SIZE; ++i) {
    printf("%d ", new_tab[i]);
  }
  printf("\n");
}
