import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;

public class Main {
    public static void main (String[] args) throws IOException {
        File file = new File(args[0]);
        BufferedReader buffer = new BufferedReader(new FileReader(file));
        String line;
        while ((line = buffer.readLine()) != null) {
            line = line.trim();

            String[] pairs = (line.replaceAll(";+$", "")).split(";");

            int numbers[] = new int[pairs.length];
            for (int i = 0; i < pairs.length; i++) {
                numbers[i] = Integer.parseInt(pairs[i].split(",")[1]);
            }

            //quick sort from smallest to highest
            sort(numbers, 0, numbers.length-1);

            int start = numbers[0];
            String answer = start + ",";
            for (int i = 1; i < numbers.length; i++) {
                answer += (numbers[i]-start) + ",";
                start = numbers[i];
            }

            System.out.println(answer.replaceAll(",+$", ""));
        }
    }

    public static void sort(int[] array, int left, int right) {
        int index = left + (right - left) / 2;
        int val = array[index];

        int i = left, j = right;

        while(i <= j) {

            while(array[i] < val) {
                i++;
            }

            while(array[j] > val) {
                j--;
            }

            if(i <= j) {
                int temp = array[i];
                array[i] = array[j];
                array[j] = temp;
                i++;
                j--;
            }

            if(left < i) {
                sort(array, left, j);
            }

            if(right > i) {
                sort(array, i, right);
            }

        }
    }
}