#include <bits/stdc++.h>
using namespace std;
string s, c;
vector<string> v, s1, s2;
bool b1(string &d) {
  if (d.size()) {
    if (d[0] == '0' && d.size() == 1) {
      return true;
    } else if (d[0] == '0') {
      return false;
    } else {
      bool ans = true;
      for (int i = 0; i < d.size(); ++i) {
        if (!('0' <= d[i] && d[i] <= '9')) {
          ans = false;
          break;
        }
      }
      return ans;
    }
  } else {
    return false;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.precision(11);
  cout.setf(ios::fixed);
  getline(cin, s);
  c = "";
  for (int i = 0; i < s.size(); ++i) {
    if (s[i] == ',' || s[i] == ';') {
      if (b1(c)) {
        s1.push_back(c);
        c = "";
      } else {
        s2.push_back(c);
        c = "";
      }
    } else {
      c.append(1, s[i]);
    }
  }
  if (b1(c)) {
    s1.push_back(c);
    c = "";
  } else {
    s2.push_back(c);
    c = "";
  }
  if (s1.size()) {
    cout << '"' << s1[0];
    for (int i = 1; i < s1.size(); ++i) {
      cout << ',' << s1[i];
    }
    cout << '"' << endl;
  } else {
    cout << '-' << endl;
  }
  if (s2.size()) {
    cout << '"' << s2[0];
    for (int i = 1; i < s2.size(); ++i) {
      cout << ',' << s2[i];
    }
    cout << '"' << endl;
  } else {
    cout << '-' << endl;
  }
  return 0;
}
