#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 4, M = 1e9 + 7;
const long long oo = 1e18;
const long double PI = acos(-1), eps = 1e-9;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  string s;
  cin >> s;
  string a = "\"", b = "\"";
  string plus = "";
  bool is = true;
  for (int i = 0; i < (int)s.size(); i++) {
    if (s[i] == ';' || s[i] == ',') {
      if (is && plus.size() > 1 && plus[0] == '0') is = false;
      if (plus.empty()) is = false;
      if (is)
        a += plus + ',';
      else
        b += plus + ',';
      plus = "";
      is = true;
      continue;
    }
    if (!(s[i] >= '0' && s[i] <= '9')) is = false;
    plus += s[i];
  }
  if (is && plus.size() > 1 && plus[0] == '0') is = false;
  if (plus.empty()) is = false;
  if (is)
    a += plus + ',';
  else
    b += plus + ',';
  if (a.size() > 1) {
    a.pop_back();
    a += "\"";
  } else
    a = "-";
  if (b.size() > 1) {
    b.pop_back();
    b += "\"";
  } else
    b = "-";
  cout << a << '\n';
  cout << b << '\n';
  return 0;
}
