#include <stdio.h>

void swap(int *a, int *b) {
    int t = *a;
    *a = *b;
    *b = t;
}

void sort3(int *x, int *y, int *z) {
    if (*x > *y) swap(x, y);
    if (*y > *z) swap(y, z);
    if (*x > *y) swap(x, y);
}

int main(void) {
    int a,b,c;

    printf("Input 3 integers separated by ',': ");
    scanf("%d,%d,%d", &a, &b, &c);

    sort3(&a, &b, &c);

    printf("Result: %d, %d, %d\n", a, b, c);

    return 0;
}
