#include <bits/stdc++.h>
using namespace std;
int n;
bool a[1005];
char ch;
int main() {
  while (ch != '\n') {
    cin >> n;
    ch = getchar();
    a[n] = 1;
  }
  int num = 1;
  bool f = 1;
  while (num <= 1000) {
    if (a[num]) {
      if (!f) printf(",");
      f = 0;
      printf("%d", num);
      if (a[num + 1]) {
        while (a[num + 1]) num++;
        printf("-%d", num);
      }
    }
    num++;
  }
  return 0;
}
