#include <bits/stdc++.h>
bool check(const char* s) {
  if (!*s) return false;
  if (*s == '0') return !*(s + 1);
  while (*s) {
    if (*s < '0') return false;
    if ('9' < *s) return false;
    ++s;
  }
  return true;
}
int main() {
  char s[100001] = "";
  std::vector<std::string> r[2];
  int e, k;
  bool f;
  std::scanf("%s", s);
  for (int i(0);; ++i) {
    e = i;
    while (s[e] && s[e] != ';' && s[e] != ',') ++e;
    f = s[e] == '\0';
    s[e] = '\0';
    k = !check(s + i);
    r[k].push_back(s + i);
    if (f) break;
    i = e;
  }
  for (int i(0); i < 2; ++i) {
    if (r[i].empty()) {
      std::puts("-");
    } else {
      std::printf("\"");
      for (int j(0); j < r[i].size(); ++j) {
        if (0 < j) std::printf(",");
        std::printf("%s", r[i][j].c_str());
      }
      std::printf("\"\n");
    }
  }
  return 0;
}
