#include <bits/stdc++.h>
int integer(char *aa, int n) {
  int i;
  if (n == 0) return 0;
  for (i = 0; i < n; i++)
    if (!isdigit(aa[i])) return 0;
  return n == 1 || aa[0] != '0';
}
int main() {
  static char s[100000 + 1], aa[100000 + 100000 + 2 + 1],
      bb[100000 + 100000 + 2 + 1];
  int n, na, nb, i, j;
  scanf("%s", s);
  n = strlen(s);
  na = nb = 0;
  aa[na++] = bb[nb++] = '"';
  for (i = 0; i <= n; i++) {
    for (j = i; j < n && s[j] != ',' && s[j] != ';'; j++)
      ;
    if (integer(s + i, j - i)) {
      strncpy(aa + na, s + i, j - i);
      na += j - i;
      aa[na++] = ',';
    } else {
      strncpy(bb + nb, s + i, j - i);
      nb += j - i;
      bb[nb++] = ',';
    }
    i = j;
  }
  aa[na - 1] = bb[nb - 1] = '"';
  printf("%s\n", na == 1 ? "-" : aa);
  printf("%s\n", nb == 1 ? "-" : bb);
  return 0;
}
