#include <bits/stdc++.h>
using namespace std;
const int Mod = 1e9 + 7;
bool add(string temp) {
  if (temp.length() == 0) {
    return false;
  }
  for (int j = 0; j < temp.length(); j++) {
    if (temp[j] < '0' || temp[j] > '9') {
      return false;
    }
  }
  if (temp.length() > 1 && temp[0] == '0') return false;
  return true;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long int i, j;
  string s, temp;
  cin >> s;
  temp = "";
  vector<string> a, b;
  for (i = 0; i < s.length(); i++) {
    if (s[i] == ',' || s[i] == ';') {
      if (add(temp))
        a.push_back(temp);
      else
        b.push_back(temp);
      temp = "";
    } else {
      temp += s[i];
    }
  }
  if (add(temp))
    a.push_back(temp);
  else
    b.push_back(temp);
  if (a.size() == 0)
    cout << "-" << endl;
  else {
    cout << "\"";
    for (i = 0; i < a.size(); i++) {
      if (i) cout << ",";
      cout << a[i];
    }
    cout << "\"" << endl;
  }
  if (b.size() == 0)
    cout << "-" << endl;
  else {
    cout << "\"";
    for (i = 0; i < b.size(); i++) {
      if (i) cout << ",";
      cout << b[i];
    }
    cout << "\"" << endl;
  }
}
