#include <bits/stdc++.h>
using namespace std;
const long long int MOD = 1e9 + 7;
const long long int INF = 1e18;
const long long int MAX_N = 1e6 + 4;
vector<string> v;
bool check(int i) {
  if (v[i].size() == 0) return false;
  for (auto a : v[i]) {
    if (a < '0' || a > '9') return false;
  }
  if (v[i][0] == '0' && v[i].size() > 1)
    return 0;
  else
    return 1;
}
void solve() {
  string s;
  cin >> s;
  string temp = "";
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == ',' || s[i] == ';') {
      v.push_back(temp);
      temp = "";
    } else
      temp += s[i];
  }
  v.push_back(temp);
  string ans1 = "";
  string ans2 = "";
  for (int i = 0; i < v.size(); i++) {
    if (check(i)) {
      ans1 += v[i] + string(1, ',');
    } else
      ans2 += v[i] + string(1, ',');
  }
  string k = "";
  string k2 = "";
  if (ans1.size() >= 1) {
    k = ans1.substr(0, ans1.size() - 1);
  } else
    k = "-";
  if (ans2.size() >= 1) {
    k2 = ans2.substr(0, ans2.size() - 1);
  } else
    k2 = "-";
  if (k == "-") {
    cout << k << '\n';
  } else {
    cout << "\"" << k << "\"" << '\n';
  }
  if (k2 == "-") {
    cout << k2;
  } else {
    cout << "\"" << k2 << "\"";
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  solve();
  cerr << endl
       << "[ Time : " << (float)clock() / CLOCKS_PER_SEC << " secs ]" << endl;
}
