#include <bits/stdc++.h>
using namespace std;
inline void FAST_IO() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
template <class F, class S>
ostream& operator<<(ostream& os, pair<F, S>& p) {
  os << "(" << p.first << "," << p.second << ")";
  return os;
}
template <class T, class S>
ostream& operator<<(ostream& os, map<T, S>& v) {
  os << "{";
  for (auto& i : v) cout << "{" << i.first << "," << i.second << "}";
  os << "}";
  return os;
}
template <class T>
ostream& operator<<(ostream& os, set<T>& v) {
  os << "{";
  for (auto& i : v) cout << i << ",";
  os << "}";
  return os;
}
template <class T>
ostream& operator<<(ostream& os, vector<T>& v) {
  os << "[";
  if (v.size()) os << v[0];
  for (int i = 1; i < v.size(); ++i) os << "," << v[i];
  os << "]";
  return os;
}
int main() {
  int n;
  vector<bool> in(1002);
  while (cin >> n) {
    in[n] = true;
    getchar();
  }
  int first = true;
  for (int i = 0; i < in.size(); ++i) {
    if (!in[i]) continue;
    int begin = i;
    while (in[i]) i++;
    if (!first) printf(",");
    if (i - begin > 1)
      printf("%d-%d", begin, i - 1);
    else
      printf("%d", i - 1);
    first = false;
  }
  cout << endl;
  return 0;
}
