#include <bits/stdc++.h>
using namespace std;
void Append(const string& w, string& a) {
  a += w;
  a += ',';
}
bool IsNumber(const string& w) {
  for (char c : w) {
    if (!isdigit(c)) return false;
  }
  return !w.empty() && (w == "0" || w[0] != '0');
}
void Process(const string& s, int start, int end, string& a, string& b) {
  assert(end - start + 1 >= 0);
  const string w = s.substr(start, end - start + 1);
  if (IsNumber(w)) {
    Append(w, a);
  } else {
    Append(w, b);
  }
}
void Output(string& s) {
  if (s.empty())
    cout << "-\n";
  else
    cout << '"' << s.substr(0, s.size() - 1) << "\"\n";
}
int main() {
  string s;
  cin >> s;
  s += ',';
  string a, b;
  int start = 0;
  for (int i = 0; i < (int)s.size(); ++i) {
    if (s[i] == ';' || s[i] == ',') {
      Process(s, start, i - 1, a, b);
      start = i + 1;
    }
  }
  Output(a);
  Output(b);
}
