#include <bits/stdc++.h>
using namespace std;
const int N = 205000;
const int SQRTN = 320;
const int LOGN = 20;
const long double PI = acos(-1);
vector<string> w, a, b;
string s1, s2;
bool check(string& s) {
  if (s.size() == 0) return 0;
  if (s[0] == '0') return s.size() == 1;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] > '9' || s[i] < '0') return 0;
  }
  return 1;
}
signed main() {
  cin >> s1;
  for (int i = 0; i < s1.size(); i++) {
    if (s1[i] == ',' || s1[i] == ';') {
      w.push_back(s2);
      s2 = "";
    } else {
      s2 += s1[i];
    }
    if (i == s1.size() - 1) w.push_back(s2);
  }
  for (int i = 0; i < w.size(); i++) {
    if (check(w[i])) {
      a.push_back(w[i]);
    } else
      b.push_back(w[i]);
  }
  if (a.size() == 0) {
    cout << "-" << endl;
  } else {
    cout << "\"";
    for (int i = 0; i < a.size(); i++) {
      cout << a[i];
      if (i != a.size() - 1) cout << ",";
    }
    cout << "\"\n";
  }
  if (b.size() == 0) {
    cout << "-" << endl;
  } else {
    cout << "\"";
    for (int i = 0; i < b.size(); i++) {
      cout << b[i];
      if (i != b.size() - 1) cout << ",";
    }
    cout << "\"\n";
  }
}
