#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  string s, t1, t2, tmp;
  cin >> s;
  s += ";";
  for (int i = 0; i < s.length(); ++i) {
    if (s[i] == ';' || s[i] == ',') {
      bool is = true;
      if (tmp.length() == 0) is = false;
      for (int j = 0; j < tmp.length(); ++j)
        if (tmp[j] < 48 || tmp[j] > 57) {
          is = false;
          break;
        }
      if (is && tmp.length() > 1 && tmp[0] == '0') is = false;
      if (is)
        t1 += tmp + ",";
      else
        t2 += tmp + ",";
      tmp = "";
    } else
      tmp += s[i];
  }
  if (t1 == "")
    cout << "-\n";
  else {
    t1.erase(t1.length() - 1, 1);
    cout << "\"" << t1 << "\"\n";
  }
  if (t2 == "")
    cout << "-\n";
  else {
    t2.erase(t2.length() - 1, 1);
    cout << "\"" << t2 << "\"\n";
  }
}
