#include <bits/stdc++.h>
using namespace std;
bool good(string s) {
  int n = s.length();
  if (n == 0) return 0;
  if (s[0] == '0' && n == 1) return 1;
  int res = s[0] != '0';
  for (int i = 0; i < n; i++) res &= isdigit(s[i]);
  return res;
}
void print(vector<string> v) {
  if (v.size() == 0)
    cout << "-\n";
  else {
    cout << '"' << v[0];
    for (int i = 1; i < v.size(); i++) cout << ',' << v[i];
    cout << "\"\n";
  }
}
void solve() {
  string s;
  cin >> s;
  int n = s.length();
  vector<string> a, b;
  cerr << '\n';
  for (int i = 0, first = 0; i <= n; i++) {
    if (i == n || s[i] == ',' || s[i] == ';') {
      string cur = first == n ? "" : s.substr(first, i - first);
      if (good(cur))
        a.push_back(cur);
      else
        b.push_back(cur);
      first = i + 1;
    }
  }
  print(a);
  print(b);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  solve();
  return 0;
}
