#include <bits/stdc++.h>
using namespace std;
void print(string n) {
  cout << (n != "" ? "\"" + n.substr(0, n.size() - 1) + "\"\n" : "-\n");
}
int main() {
  string s, n, nn, word;
  cin >> s;
  replace(s.begin(), s.end(), ';', ',');
  stringstream ss;
  ss << s;
  while (getline(ss, word, ',')) {
    if (word.size() > 0 &&
        word.find_first_not_of("0123456789") == string::npos &&
        (word[0] != '0' || word == "0"))
      n.append(word + ",");
    else
      nn.append(word + ",");
  }
  if (s[s.size() - 1] == ',') nn.append(",");
  print(n);
  print(nn);
  return 0;
}
