#include <bits/stdc++.h>
using namespace std;
void print(vector<string>& A) {
  if (A.empty()) {
    cout << "-\n";
    return;
  }
  cout << "\"";
  cout << A[0];
  for (int i = 1; i < A.size(); i++) cout << "," << A[i];
  cout << "\"\n";
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  string s;
  cin >> s;
  s += ";";
  vector<string> A, B;
  int last = 0;
  for (int i = 0; i < s.size(); i++)
    if (s[i] == ',' || s[i] == ';') {
      bool ok = 1;
      string z = (i == last ? "" : s.substr(last, i - last));
      for (auto& ch : z)
        if (!(ch >= '0' && ch <= '9')) ok = 0;
      if (z.empty()) ok = 0;
      if (!z.empty() && z[0] == '0' && z.size() > 1) ok = 0;
      if (ok)
        A.push_back(z);
      else
        B.push_back(z);
      last = i + 1;
    }
  print(A);
  print(B);
}
