#include <bits/stdc++.h>
using namespace std;
const int LEN = 1e5 + 5;
char s[LEN];
char a[LEN];
char b[LEN];
bool is_sp(char c) { return c == ';' || c == ','; }
void solve() {
  int n = strlen(s);
  s[n] = ';';
  int i = -1, j = 0, p = 0, q = 0;
  bool has_alp = false;
  for (; j <= n; j++) {
    if (is_sp(s[j])) {
      if (j > i + 1) {
        if (has_alp) {
          memcpy(b + q, s + i + 1, j - i - 1);
          q += j - i - 1;
          b[q++] = ',';
        } else {
          if (j - i - 1 > 1 && s[i + 1] == '0') {
            memcpy(b + q, s + i + 1, j - i - 1);
            q += j - i - 1;
            b[q++] = ',';
          } else {
            memcpy(a + p, s + i + 1, j - i - 1);
            p += j - i - 1;
            a[p++] = ',';
          }
        }
      } else
        b[q++] = ',';
      i = j;
      has_alp = false;
    } else {
      if (!has_alp && (isalpha(s[j]) || s[j] == '.')) has_alp = true;
    }
  }
  bool f2 = q;
  if (p) {
    a[--p] = 0;
  }
  if (f2) {
    b[--q] = 0;
  }
  if (p)
    printf("\"%s\"\n", a);
  else
    puts("-");
  if (f2)
    printf("\"%s\"\n", b);
  else
    puts("-");
}
int main() {
  gets(s);
  solve();
  return 0;
}
