#include <bits/stdc++.h>
using namespace std;
bool is_num(string &w) {
  if (w == "0") return true;
  if (w[0] == '0') return false;
  for (char c : w) {
    if ('0' > c || '9' < c) return false;
  }
  return true;
}
void print(vector<string> &v) {
  if (v.size() == 0) {
    cout << '-' << '\n';
    return;
  }
  cout << '"';
  cout << (v[0] == "#" ? "" : v[0]);
  for (int i = 1; i < v.size(); ++i) {
    cout << ',' << (v[i] == "#" ? "" : v[i]);
  }
  cout << '"';
  cout << '\n';
}
int main() {
  string s;
  cin >> s;
  replace(s.begin(), s.end(), ',', ' ');
  replace(s.begin(), s.end(), ';', ' ');
  if (s[0] == ' ') s.insert(0, "#");
  if (s[s.size() - 1] == ' ') s.append("#");
  for (int i = 1; i < s.size(); ++i) {
    if (s[i] == ' ' && s[i - 1] == ' ') {
      s.insert(i, "#");
    }
  }
  istringstream iss(s);
  vector<string> u, v;
  string w;
  while (iss >> w) {
    if (is_num(w))
      u.push_back(w);
    else
      v.push_back(w);
  }
  print(u);
  print(v);
}
