#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define ld long double
#define db double
#define str string
#define pb push_back
#define nl '\n'
#define X first
#define Y second
#define nimble ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define all(v) (v).begin(),(v).end()
#define rall(v) rbegin(v),rend(v)
#define selp(a) for(auto i:a)cout<<i<<" ";cout<<nl;
#define mod(x,m) ((((x)%(m))+(m))%(m))
#define _sz(x) (int)x.size()
#define rep(i,a,b) for(int i=a;i<b;i++)
#define repv(v) for(int i=0;i<_sz(v);i++)
#define rep1(i,b,a) for(int i=b;i>=a;i--)
#define preci(x) fixed<<setprecision(x)

#define TRACE
#ifdef TRACE
#define see(...) __f(#__VA_ARGS__,__VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
	cerr<<name<<" : "<<arg1<<nl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
	const char* comma=strchr(names+1,',');cerr.write(names,comma-names)<<" : "<<arg1<<" | ";__f(comma+1, args...);
}
#else
#endif

int inf=0x3f3f3f3f;
ll infl=0x3f3f3f3f3f3f3f3fLL;
ld infd=1.0/0.0;
const ll MOD=1e9+7;// 998244353 // = (119<<23)+1
const db pi=2*acos(0.0);

int main(){
  nimble;
  int tt=1;//cin>>tt;
  while(tt--){
    string s;
    getline(cin,s);
    vector<string> x;
    vector<string> x1;
    vector<string> xy;
    rep(i,0,_sz(s)){
      if(s[i]=='"' || s[i]==';' || s[i]==',')
        s[i]='.';
    }
    rep(i,0,_sz(s)){
      string r="";
      rep(j,i,_sz(s)){
        if(s[j]=='.'){
          i=j;
          break;
        }
        r+=s[j];
      }
      x.pb(r);
    }
    int f=0;
    char sd='"';
    rep(i,0,_sz(x)){
      string gg=x[i];
      if(_sz(gg)==0){
        xy.pb(gg);
        continue;
      }
      f=0;
      rep(j,0,_sz(gg)){
        if(gg[j]<'0' || gg[j]>'9'||(gg[0]=='0'&&_sz(gg)>1)){
          xy.pb(gg);
          f=1;
          break;
        }
      }
      if(!f){
        x1.pb(gg);
      }
    }
    if(_sz(x1)==0){
      cout<<'-'<<nl;
    }
    else{
      cout<<sd;
      rep(i,0,_sz(x1)-1){
        cout<<x1[i]<<',';
      }
      cout<<x1[_sz(x1)-1];
      cout<<sd<<nl;
    }
    if(_sz(xy)==0){
      cout<<'-'<<nl;
    }
    else{
      cout<<sd;
      rep(i,0,_sz(xy)-1){
        cout<<xy[i]<<',';
      }
      cout<<xy[_sz(xy)-1];
      if(s[_sz(s)-1]=='.')
        cout<<',';
      cout<<sd<<nl;
    }
  }
  return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define ld long double
#define db double
#define str string
#define pb push_back
#define nl '\n'
#define X first
#define Y second
#define nimble ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define all(v) (v).begin(),(v).end()
#define rall(v) rbegin(v),rend(v)
#define selp(a) for(auto i:a)cout<<i<<" ";cout<<nl;
#define mod(x,m) ((((x)%(m))+(m))%(m))
#define _sz(x) (int)x.size()
#define rep(i,a,b) for(int i=a;i<b;i++)
#define repv(v) for(int i=0;i<_sz(v);i++)
#define rep1(i,b,a) for(int i=b;i>=a;i--)
#define preci(x) fixed<<setprecision(x)

#define TRACE
#ifdef TRACE
#define see(...) __f(#__VA_ARGS__,__VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
	cerr<<name<<" : "<<arg1<<nl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
	const char* comma=strchr(names+1,',');cerr.write(names,comma-names)<<" : "<<arg1<<" | ";__f(comma+1, args...);
}
#else
#endif

int inf=0x3f3f3f3f;
ll infl=0x3f3f3f3f3f3f3f3fLL;
ld infd=1.0/0.0;
const ll MOD=1e9+7;// 998244353 // = (119<<23)+1
const db pi=2*acos(0.0);

int main(){
  nimble;
  int tt=1;//cin>>tt;
  while(tt--){
    string s;
    getline(cin,s);
    vector<string> x;
    vector<string> x1;
    vector<string> xy;
    rep(i,0,_sz(s)){
      if(s[i]=='"' || s[i]==';' || s[i]==',')
        s[i]='.';
    }
    rep(i,0,_sz(s)){
      string r="";
      rep(j,i,_sz(s)){
        if(s[j]=='.'){
          i=j;
          break;
        }
        r+=s[j];
      }
      x.pb(r);
    }
    int f=0;
    char sd='"';
    rep(i,0,_sz(x)){
      string gg=x[i];
      if(_sz(gg)==0){
        xy.pb(gg);
        continue;
      }
      f=0;
      rep(j,0,_sz(gg)){
        if(gg[j]<'0' || gg[j]>'9'||gg[0]=='0'){
          xy.pb(gg);
          f=1;
          break;
        }
      }
      if(!f){
        x1.pb(gg);
      }
    }
    if(_sz(x1)==0){
      cout<<'-'<<nl;
    }
    else{
      cout<<sd;
      rep(i,0,_sz(x1)-1){
        cout<<x1[i]<<',';
      }
      cout<<x1[_sz(x1)-1];
      if(s[_sz(s)-1]=='.')
        cout<<',';
      cout<<sd<<nl;
    }
    if(_sz(xy)==0){
      cout<<'-'<<nl;
    }
    else{
      cout<<sd;
      rep(i,0,_sz(xy)-1){
        cout<<xy[i]<<',';
      }
      cout<<xy[_sz(xy)-1];
      cout<<sd<<nl;
    }
  }
  return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define ld long double
#define db double
#define str string
#define pb push_back
#define nl '\n'
#define X first
#define Y second
#define nimble ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define all(v) (v).begin(),(v).end()
#define rall(v) rbegin(v),rend(v)
#define selp(a) for(auto i:a)cout<<i<<" ";cout<<nl;
#define mod(x,m) ((((x)%(m))+(m))%(m))
#define _sz(x) (int)x.size()
#define rep(i,a,b) for(int i=a;i<b;i++)
#define repv(v) for(int i=0;i<_sz(v);i++)
#define rep1(i,b,a) for(int i=b;i>=a;i--)
#define preci(x) fixed<<setprecision(x)

#define TRACE
#ifdef TRACE
#define see(...) __f(#__VA_ARGS__,__VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
	cerr<<name<<" : "<<arg1<<nl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
	const char* comma=strchr(names+1,',');cerr.write(names,comma-names)<<" : "<<arg1<<" | ";__f(comma+1, args...);
}
#else
#endif

int inf=0x3f3f3f3f;
ll infl=0x3f3f3f3f3f3f3f3fLL;
ld infd=1.0/0.0;
const ll MOD=1e9+7;// 998244353 // = (119<<23)+1
const db pi=2*acos(0.0);

int main(){
  nimble;
  int tt=1;//cin>>tt;
  while(tt--){
    string s;
    getline(cin,s);
    vector<string> x;
    vector<string> x1;
    vector<string> xy;
    rep(i,0,_sz(s)){
      if(s[i]==';' || s[i]==',')
        s[i]='#';
    }
    rep(i,0,_sz(s)){
      string r="";
      rep(j,i,_sz(s)){
        if(s[j]=='#'){
          i=j;
          break;
        }
        i=j;
        r+=s[j];
      }
      x.pb(r);
    }
    int f=0;
    char sd='"';
    rep(i,0,_sz(x)){
      string gg=x[i];
      if(_sz(gg)==0){
        xy.pb(gg);
        continue;
      }
      f=0;
      rep(j,0,_sz(gg)){
        if(gg[j]<'0' || gg[j]>'9'||(gg[0]=='0'&&_sz(gg)>1)){
          xy.pb(gg);
          f=1;
          break;
        }
      }
      if(!f){
        x1.pb(gg);
      }
    }
    if(_sz(x1)==0){
      cout<<'-'<<nl;
    }
    else{
      cout<<sd;
      rep(i,0,_sz(x1)-1){
        cout<<x1[i]<<',';
      }
      cout<<x1[_sz(x1)-1];
      cout<<sd<<nl;
    }
    if(_sz(xy)==0){
      if(s[_sz(s)-1]=='#'){
        cout<<sd;
        cout<<sd<<nl;
        continue;
      }
      cout<<'-'<<nl;
    }
    else{
      cout<<sd;
      rep(i,0,_sz(xy)-1){
        cout<<xy[i]<<',';
      }
      cout<<xy[_sz(xy)-1];
      if(s[_sz(s)-1]=='#')
        cout<<',';
      cout<<sd<<nl;
    }
  }
  return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define ld long double
#define db double
#define str string
#define pb push_back
#define nl '\n'
#define X first
#define Y second
#define nimble ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define all(v) (v).begin(),(v).end()
#define rall(v) rbegin(v),rend(v)
#define selp(a) for(auto i:a)cout<<i<<" ";cout<<nl;
#define mod(x,m) ((((x)%(m))+(m))%(m))
#define _sz(x) (int)x.size()
#define rep(i,a,b) for(int i=a;i<b;i++)
#define repv(v) for(int i=0;i<_sz(v);i++)
#define rep1(i,b,a) for(int i=b;i>=a;i--)
#define preci(x) fixed<<setprecision(x)

#define TRACE
#ifdef TRACE
#define see(...) __f(#__VA_ARGS__,__VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
	cerr<<name<<" : "<<arg1<<nl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
	const char* comma=strchr(names+1,',');cerr.write(names,comma-names)<<" : "<<arg1<<" | ";__f(comma+1, args...);
}
#else
#endif

int inf=0x3f3f3f3f;
ll infl=0x3f3f3f3f3f3f3f3fLL;
ld infd=1.0/0.0;
const ll MOD=1e9+7;// 998244353 // = (119<<23)+1
const db pi=2*acos(0.0);

int main(){
  nimble;
  int tt=1;//cin>>tt;
  while(tt--){
    string s;
    getline(cin,s);
    vector<string> x;
    vector<string> x1;
    vector<string> xy;
    rep(i,0,_sz(s)){
      if(s[i]==';' || s[i]==',')
        s[i]='#';
    }
    rep(i,0,_sz(s)){
      string r="";
      rep(j,i,_sz(s)){
        if(s[j]=='#'){
          i=j;
          break;
        }
        i=j;
        r+=s[j];
      }
      x.pb(r);
    }
    int f=0;
    char sd='"';
    rep(i,0,_sz(x)){
      string gg=x[i];
      if(_sz(gg)==0){
        xy.pb(gg);
        continue;
      }
      f=0;
      rep(j,0,_sz(gg)){
        if(gg[j]<'0' || gg[j]>'9'||(gg[0]=='0'&&_sz(gg)>1)){
          xy.pb(gg);
          f=1;
          break;
        }
      }
      if(!f){
        x1.pb(gg);
      }
    }
    if(_sz(x1)==0){
      cout<<'-'<<nl;
    }
    else{
      cout<<sd;
      rep(i,0,_sz(x1)-1){
        cout<<x1[i]<<',';
      }
      cout<<x1[_sz(x1)-1];
      cout<<sd<<nl;
    }
    if(_sz(xy)==0){
      cout<<'-'<<nl;
    }
    else{
      cout<<sd;
      rep(i,0,_sz(xy)-1){
        cout<<xy[i]<<',';
      }
      cout<<xy[_sz(xy)-1];
      if(s[_sz(s)-1]=='#')
        cout<<',';
      cout<<sd<<nl;
    }
  }
  return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define ld long double
#define db double
#define str string
#define pb push_back
#define nl '\n'
#define X first
#define Y second
#define nimble ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define all(v) (v).begin(),(v).end()
#define rall(v) rbegin(v),rend(v)
#define selp(a) for(auto i:a)cout<<i<<" ";cout<<nl;
#define mod(x,m) ((((x)%(m))+(m))%(m))
#define _sz(x) (int)x.size()
#define rep(i,a,b) for(int i=a;i<b;i++)
#define repv(v) for(int i=0;i<_sz(v);i++)
#define rep1(i,b,a) for(int i=b;i>=a;i--)
#define preci(x) fixed<<setprecision(x)

#define TRACE
#ifdef TRACE
#define see(...) __f(#__VA_ARGS__,__VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
	cerr<<name<<" : "<<arg1<<nl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
	const char* comma=strchr(names+1,',');cerr.write(names,comma-names)<<" : "<<arg1<<" | ";__f(comma+1, args...);
}
#else
#endif

int inf=0x3f3f3f3f;
ll infl=0x3f3f3f3f3f3f3f3fLL;
ld infd=1.0/0.0;
const ll MOD=1e9+7;// 998244353 // = (119<<23)+1
const db pi=2*acos(0.0);

int main(){
  nimble;
  int tt=1;//cin>>tt;
  while(tt--){
    string s;
    getline(cin,s);
    vector<string> x;
    vector<string> x1;
    vector<string> xy;
    rep(i,0,_sz(s)){
      if(s[i]=='"' || s[i]==';' || s[i]==',')
        s[i]='.';
    }
    rep(i,0,_sz(s)){
      string r="";
      rep(j,i,_sz(s)){
        if(s[j]=='.'){
          i=j;
          break;
        }
        r+=s[j];
      }
      x.pb(r);
    }
    int f=0;
    char sd='"';
    rep(i,0,_sz(x)){
      string gg=x[i];
      if(_sz(gg)==0){
        xy.pb(gg);
        continue;
      }
      f=0;
      rep(j,0,_sz(gg)){
        if(gg[j]<'0' || gg[j]>'9'||(gg[0]=='0'&&_sz(gg)>1)){
          xy.pb(gg);
          f=1;
          break;
        }
      }
      if(!f){
        x1.pb(gg);
      }
    }
    if(_sz(x1)==0){
      cout<<'-'<<nl;
    }
    else{
      cout<<sd;
      rep(i,0,_sz(x1)-1){
        cout<<x1[i]<<',';
      }
      cout<<x1[_sz(x1)-1];
      if(s[_sz(s)-1]=='.')
        cout<<',';
      cout<<sd<<nl;
    }
    if(_sz(xy)==0){
      cout<<'-'<<nl;
    }
    else{
      cout<<sd;
      rep(i,0,_sz(xy)-1){
        cout<<xy[i]<<',';
      }
      cout<<xy[_sz(xy)-1];
      cout<<sd<<nl;
    }
  }
  return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define ld long double
#define db double
#define str string
#define pb push_back
#define nl '\n'
#define X first
#define Y second
#define nimble ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define all(v) (v).begin(),(v).end()
#define rall(v) rbegin(v),rend(v)
#define selp(a) for(auto i:a)cout<<i<<" ";cout<<nl;
#define mod(x,m) ((((x)%(m))+(m))%(m))
#define _sz(x) (int)x.size()
#define rep(i,a,b) for(int i=a;i<b;i++)
#define repv(v) for(int i=0;i<_sz(v);i++)
#define rep1(i,b,a) for(int i=b;i>=a;i--)
#define preci(x) fixed<<setprecision(x)

#define TRACE
#ifdef TRACE
#define see(...) __f(#__VA_ARGS__,__VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
	cerr<<name<<" : "<<arg1<<nl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
	const char* comma=strchr(names+1,',');cerr.write(names,comma-names)<<" : "<<arg1<<" | ";__f(comma+1, args...);
}
#else
#endif

int inf=0x3f3f3f3f;
ll infl=0x3f3f3f3f3f3f3f3fLL;
ld infd=1.0/0.0;
const ll MOD=1e9+7;// 998244353 // = (119<<23)+1
const db pi=2*acos(0.0);

int main(){
  nimble;
  int tt=1;//cin>>tt;
  while(tt--){
    string s;
    getline(cin,s);
    vector<string> x;
    vector<string> x1;
    vector<string> xy;
    rep(i,0,_sz(s)){
      if(s[i]==';' || s[i]==',')
        s[i]='#';
    }
    rep(i,0,_sz(s)){
      string r="";
      rep(j,i,_sz(s)){
        if(s[j]=='#'){
          break;
        }
        i=j;
        r+=s[j];
      }
      x.pb(r);
    }
    int f=0;
    char sd='"';
    rep(i,0,_sz(x)){
      string gg=x[i];
      if(_sz(gg)==0){
        xy.pb(gg);
        continue;
      }
      f=0;
      rep(j,0,_sz(gg)){
        if(gg[j]<'0' || gg[j]>'9'||(gg[0]=='0'&&_sz(gg)>1)){
          xy.pb(gg);
          f=1;
          break;
        }
      }
      if(!f){
        x1.pb(gg);
      }
    }
    if(_sz(x1)==0){
      cout<<'-'<<nl;
    }
    else{
      cout<<sd;
      rep(i,0,_sz(x1)-1){
        cout<<x1[i]<<',';
      }
      cout<<x1[_sz(x1)-1];
      cout<<sd<<nl;
    }
    if(_sz(xy)==0){
      cout<<'-'<<nl;
    }
    else{
      cout<<sd;
      rep(i,0,_sz(xy)-1){
        cout<<xy[i]<<',';
      }
      cout<<xy[_sz(xy)-1];
      if(s[_sz(s)-1]=='#')
        cout<<',';
      cout<<sd<<nl;
    }
  }
  return 0;
}


#include<iostream>
#include<string>
#include<vector>                                                      //sin(x)=sin(x*PI\180);
#include<set>
#include<math.h>
#include<map>
#include<queue>
#include<deque>
#include<cmath>
#include<algorithm>
#include<iomanip>
#include<stack>
#include<fstream>
#include<sstream>
#include<functional>
using namespace std;
long double dis(double x, double y, double x1, double y1) {
	return sqrt((x - x1)*(x - x1) + (y - y1)*(y - y1));
}
double PI = 3.14159265359;
double e = 2.718281828;
void EnGz() {
	ios::sync_with_stdio(0);
	ios_base::sync_with_stdio(0);
	cin.tie(0), cout.tie(0);
}
long long GCD_(long long a, long long b) {
	return b ? GCD_(b, a % b) : a;
}
long long LCM_(long long a, long long b) {
	return (a*b) / GCD_(a, b);
}
bool num(string s) {
	if (s[0] == '0'&&s.length()>1)return false;
	for (int i = 0; i < s.length(); i++)
		if (!(s[i] >= '0' && s[i] <= '9'))
			return false;
	return true;
}
int main(){
	EnGz();
	//freopen("mahdi.in" , "r" , stdin);
	//freopen("output.txt", "w", stdout);
	string s; cin >> s;
	vector<string>v;
	string tmp = "";
	for (int i = 0; i < s.length(); i++) {
		if (s[i] == ',' || s[i] == ';') {
			v.push_back(tmp);
			tmp = "";
		}
		else tmp += s[i];
	}
	if (tmp != "")v.push_back(tmp);
	if (s[s.length() - 1] == ',' || s[s.length() - 1] == ';')
		v.push_back("");
	char ch = '"';
	string first = "", second = "";
	bool f = false, sec = false;
	for(int i =0 ;i<v.size();i++)
		if (v[i]!=""&&num(v[i])) {
			if (f)
				first += ",";
			f = true;
			first += v[i];
		}
		else {
			if (sec)
				second += ",";
			sec = true;
			second += v[i];
		}
		if (!f)
			cout << "-" << endl;
		else
			cout << ch<<first<<ch<<endl;
		if (!sec)
			cout << "-" << endl;
		else
			cout << ch << second << ch << endl;

		return 0;
}


#include<iostream>
#include<string>
#include<vector>                                                      //sin(x)=sin(x*PI\180);
#include<set>
#include<math.h>
#include<map>
#include<queue>
#include<deque>
#include<cmath>
#include<algorithm>
#include<iomanip>
#include<stack>
#include<fstream>
#include<sstream>
#include<functional>
using namespace std;
long double dis(double x, double y, double x1, double y1) {
	return sqrt((x - x1)*(x - x1) + (y - y1)*(y - y1));
}
double PI = 3.14159265359;
double e = 2.718281828;
void EnGz() {
	ios::sync_with_stdio(0);
	ios_base::sync_with_stdio(0);
	cin.tie(0), cout.tie(0);
}
long long GCD_(long long a, long long b) {
	return b ? GCD_(b, a % b) : a;
}
long long LCM_(long long a, long long b) {
	return (a*b) / GCD_(a, b);
}
bool num(string s) {
	if (s[0] == '0'&&s.length()>1)return false;
	for (int i = 0; i < s.length(); i++)
		if (!(s[i] >= '0' && s[i] <= '9'))
			return false;
	return true;
}
int main(){
	EnGz();
	//freopen("mahdi.in" , "r" , stdin);
	//freopen("output.txt", "w", stdout);
	string s; cin >> s;
	vector<string>v;
	string tmp = "";
	for (int i = 0; i < s.length(); i++) {
		if (s[i] == ',' || s[i] == ';') {
			v.push_back(tmp);
			tmp = "";
		}
		else tmp += s[i];
	}
	if (tmp != "")v.push_back(tmp);
	if (s[s.length() - 1] == ',' || s[s.length() - 1] == ';')
		v.push_back("");
	char ch = '"';
	string first = "", second = "";
	bool f = false, sec = false;
	for(int i =0 ;i<v.size();i++)
		if (v[i]!=""&&num(v[i])) {
			if (f)
				first += ",";
			f = true;
			first += v[i];
		}
		else {
			if (sec)
				second += ",";
			sec = true;
			second += v[i];
		}
		if (first == "")
			cout << "-" << endl;
		else
			cout << ch<<first<<ch<<endl;
		if (second == "")
			cout << "-" << endl;
		else
			cout << ch << second << ch << endl;

		return 0;
}


#include<iostream>
#include<string>
#include<vector>
#include<set>
#include<map>
#include<queue>
#include<deque>
#include<cmath>
#include<algorithm>
#include<iomanip>
#include<stack>
#include<fstream>
using namespace std;
void Braka(){
 ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
}
int main(){
	Braka();
	string s; cin>>s;
	string s1="",s2;
	s1+='"'; s2+='"';
	for(int i=0;i<s.length();i++){
		bool go=false;
		if(s[i]=='0'&&(!(i+1<s.length())||s[i+1]==','||s[i+1]==';')||(s[i]>='1'&&s[i]<='9')){
			string tmp; bool is=true;
			int j=i;
			for(;j<s.length()&&s[j]!=','&&s[j]!=';';j++)
				if(s[j]>='0'&&s[j]<='9')
				  tmp+=s[j];
				else {
				   is=false;
				   break;
				}
				if(is){ s1+=tmp+','; i=j; }
				else go=true;
		}
		else {
			for(;i<s.length()&&s[i]!=','&&s[i]!=';';i++)
				s2+=s[i];
			s2+=',';
			if(i==s.length()-1)s2+=',';
		}
		if(go){
		   for(;i<s.length()&&s[i]!=','&&s[i]!=';';i++)
			   s2+=s[i];
		   s2+=',';
		}
	}
	s1.pop_back(); s2.pop_back();
	if(s1.empty())cout<<"-\n";
	else cout<<s1<<'"'<<endl;
	if(s2.empty())cout<<"-\n";
	else cout<<s2<<'"'<<endl;
  return 0;
}


#include<iostream>
#include<string>
#include<vector>
#include<set>
#include<map>
#include<queue>
#include<deque>
#include<cmath>
#include<algorithm>
#include<iomanip>
#include<stack>
#include<fstream>
using namespace std;
void Braka(){
 ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
}
int main(){
	Braka();
	string s; cin>>s;
	string s1="",s2;
	s1+='"'; s2+='"';
	for(int i=0;i<s.length();i++){
		bool go=false;
		if(s[i]=='0'&&(!(i+1<s.length())||s[i+1]==','||s[i+1]==';')||(s[i]>='1'&&s[i]<='9')){
			string tmp; bool is=true;
			int j=i;
			for(;j<s.length()&&s[j]!=','&&s[j]!=';';j++)
				if(s[j]>='0'&&s[j]<='9')
				  tmp+=s[j];
				else {
				   is=false;
				   break;
				}
				if(is){ s1+=tmp+','; i=j; }
				else go=true;
		}
		else {
			for(;i<s.length()&&s[i]!=','&&s[i]!=';';i++)
				s2+=s[i];
			s2+=',';
		}
		if(go){
		   for(;i<s.length()&&s[i]!=','&&s[i]!=';';i++)
			   s2+=s[i];
		   s2+=',';
		}
	}
	s1.pop_back(); s2.pop_back();
	if(s1.empty())cout<<"-\n";
	else cout<<s1<<'"'<<endl;
	if(s2.empty())cout<<"-\n";
	else cout<<s2<<'"'<<endl;
  return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define nfs ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define f first
#define s second
#define m_p make_pair
#define pb push_back
#define ii pair<int,int>
#define N int(5e5)+10
#define ll long long
#define ld long double
#define ef else if
#define loc(x) (x).begin(),(x).end()
#define no puts("No")
#define yes puts("Yes")
#define en puts("")
#define outV(v) for(int i = 0 ; i < v.size() ; i++)cout << v[i] << ' ';
#define outA(x,n) for(int i = 0 ; i < n ; i++)cout << x[i] << ' ';
const ld EPS = 1e-18;
const ld PI = 3.141592653589793238;;

string x,a = "\"",b = "\"";

int main()
{
        cin >> x;

        x = "," + x;
        x += ",";

        for(int i = 0 ; i < x.size() ; i++)
        {
                if(x[i] == ';' || x[i] == '.')x[i] = ',';
        }

        for(int i = 1 ; i < x.size(); i++)
        {
                if(x[i] == ',' && x[i-1] == x[i])
                {
                        b += ',';
                }else
                {
                        bool alp = 0;
                        string cs = "";

                        while(i < x.size() && x[i] != ',' && x[i] != ';')
                        {
                                cs += x[i];
                                i++;
                        }

                        alp = (cs[0] == '0' && cs.size() > 1);
                        //cout << cs << endl;
                        for(int j = 0 ; j < cs.size() ; j++)
                        {
                                if(isalpha(cs[j]))
                                {
                                        alp = 1;
                                        break;
                                }
                        }

                        if(alp) b += cs + ',';
                                else a += cs + ',';
                }
        }

        if(a == "\"")a = "-"; else a = a.substr(0,a.size() - 1) + "\"";
        if(b == "\"")b = "-"; else b = b.substr(0,b.size() - 1) + "\"";

        cout << a << endl << b;
}


 #include <bits/stdc++.h>

using namespace std;

#define nfs ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define f first
#define s second
#define m_p make_pair
#define pb push_back
#define ii pair<int,int>
#define N int(5e5)+10
#define ll long long
#define ld long double
#define ef else if
#define loc(x) (x).begin(),(x).end()
#define no puts("No")
#define yes puts("Yes")
#define en puts("")
#define outV(v) for(int i = 0 ; i < v.size() ; i++)cout << v[i] << ' ';
#define outA(x,n) for(int i = 0 ; i < n ; i++)cout << x[i] << ' ';
const ld EPS = 1e-18;
const ld PI = 3.141592653589793238;;

string x,a = "\"",b = "\"";

int main()
{
        cin >> x;

        x = "," + x;
        x += ",";

        for(int i = 1 ; i < x.size(); i++)
        {
                if((x[i] == ',' || x[i] == ';') && x[i-1] == x[i])
                {
                        b += ',';
                }else
                {
                        bool alp = 0;
                        string cs = "";

                        while(i < x.size() && x[i] != ',' && x[i] != ';')
                        {
                                cs += x[i];
                                i++;
                        }

                        alp = (cs[0] == '0' && cs.size() > 1);
                        //cout << cs << endl;
                        for(int j = 0 ; j < cs.size() ; j++)
                        {
                                if(isalpha(cs[j]))
                                {
                                        alp = 1;
                                        break;
                                }
                        }

                        if(alp) b += cs + ',';
                                else a += cs + ',';
                }
        }

        if(a == "\"")a = "-"; else a = a.substr(0,a.size() - 1) + "\"";
        if(b == "\"")b = "-"; else b = b.substr(0,b.size() - 1) + "\"";

        cout << a << endl << b;
}


#include <bits/stdc++.h>

using namespace std;

#define nfs ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define f first
#define s second
#define m_p make_pair
#define pb push_back
#define ii pair<int,int>
#define N int(5e5)+10
#define ll long long
#define ld long double
#define ef else if
#define loc(x) (x).begin(),(x).end()
#define no puts("No")
#define yes puts("Yes")
#define en puts("")
#define outV(v) for(int i = 0 ; i < v.size() ; i++)cout << v[i] << ' ';
#define outA(x,n) for(int i = 0 ; i < n ; i++)cout << x[i] << ' ';
const ld EPS = 1e-18;
const ld PI = 3.141592653589793238;;

string x,a = "\"",b = "\"";

int main()
{
        cin >> x;

        x = "," + x;
        x += ",";

        for(int i = 0 ; i < x.size() ; i++)
        {
                if(x[i] == ';')x[i] = ',';
        }

        for(int i = 1 ; i < x.size(); i++)
        {
                if(x[i] == ',' && x[i-1] == x[i])
                {
                        b += ',';
                }else
                {
                        bool alp = 0;
                        string cs = "";

                        while(i < x.size() && x[i] != ',' && x[i] != ';')
                        {
                                cs += x[i];
                                i++;
                        }

                        alp = (cs[0] == '0' && cs.size() > 1);
                        //cout << cs << endl;
                        for(int j = 0 ; j < cs.size() ; j++)
                        {
                                if(isalpha(cs[j]))
                                {
                                        alp = 1;
                                        break;
                                }
                        }

                        if(alp) b += cs + ',';
                                else a += cs + ',';
                }
        }

        if(a == "\"")a = "-"; else a = a.substr(0,a.size() - 1) + "\"";
        if(b == "\"")b = "-"; else b = b.substr(0,b.size() - 1) + "\"";

        cout << a << endl << b;
}


#include <bits/stdc++.h>

using namespace std;

#define nfs ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define f first
#define s second
#define m_p make_pair
#define pb push_back
#define ii pair<int,int>
#define N int(5e5)+10
#define ll long long
#define ld long double
#define ef else if
#define loc(x) (x).begin(),(x).end()
#define no puts("No")
#define yes puts("Yes")
#define en puts("")
#define outV(v) for(int i = 0 ; i < v.size() ; i++)cout << v[i] << ' ';
#define outA(x,n) for(int i = 0 ; i < n ; i++)cout << x[i] << ' ';
const ld EPS = 1e-18;
const ld PI = 3.141592653589793238;;

string x,a = "\"",b = "\"";

int main()
{
        cin >> x;

        x = "," + x;
        x += ",";

        for(int i = 0 ; i < x.size() ; i++)
        {
                if(x[i] == ';')x[i] = ',';
        }

        for(int i = 1 ; i < x.size(); i++)
        {
                if(x[i] == ',' && x[i-1] == x[i])
                {
                        b += ',';
                }else
                {
                        bool alp = 0;
                        string cs = "";

                        while(i < x.size() && x[i] != ',' && x[i] != ';')
                        {
                                cs += x[i];
                                i++;
                        }

                        alp = (cs[0] == '0' && cs.size() > 1);
                        //cout << cs << endl;
                        for(int j = 0 ; j < cs.size() ; j++)
                        {
                                if(!isdigit(cs[j]))
                                {
                                        alp = 1;
                                        break;
                                }
                        }

                        if(alp) b += cs + ',';
                                else a += cs + ',';
                }
        }

        if(a == "\"")a = "-"; else a = a.substr(0,a.size() - 1) + "\"";
        if(b == "\"")b = "-"; else b = b.substr(0,b.size() - 1) + "\"";

        cout << a << endl << b;
}


#include<bits/stdc++.h>
using namespace std;
#define FOR(i,n) for(int i=0;i<n;i++)
int main()
{
	int flag,flag2,j,stt1;
	string str,st,str1="",str2="";
	cin>>str;
	FOR(i,str.length())
	{
		st="";
		flag=flag2=0;
		j=i;
		stt1=(int)str[j];
		while(stt1!=44 && stt1!=46 && stt1!=59 && j<str.length())
		{
			st+=str[j];
			if(stt1<48 || stt1>57 )
			  flag=1;
			j++;
			stt1=(int)str[j];
			flag2=1;
		}
		i=j;
		if(st[0]=='0' && flag==0)
		    flag=1;
		if(flag2==0)
		    flag=1;
		if(flag==1)
		    str1+=st+",";
		else
		    str2+=st+",";
	}
	str1[str1.length()-1]='\"';
	str2[str2.length()-1]='\"';
	if(str2[0]=='\0')
	cout<<"-"<<endl<<"\""<<str1;
	else if(str1[0]=='\0')
	cout<<"\""<<str2<<endl<<"-";
	else
	cout<<"\""<<str2<<endl<<"\""<<str1;
}


#include<bits/stdc++.h>
using namespace std;
#define FOR(i,n) for(int i=0;i<n;i++)
int main()
{
	int flag,flag2,j,stt1;
	string str,st,str1="",str2="";
	cin>>str;
	str+=",";
	FOR(i,str.length())
	{
		st="";
		flag=flag2=0;
		j=i;
		stt1=(int)str[j];
		while(stt1!=44 &&  stt1!=59 && j<str.length())
		{
			st+=str[j];
			if(stt1<48 || stt1>57 )
			  flag=1;
			j++;
			stt1=(int)str[j];
			flag2=1;
		}
		i=j;
		if(st[0]=='0' && flag==0 && st.length()!=1)
		    flag=1;
		if(flag2==0)
		    flag=1;
		if(flag==1)
		    str1+=st+",";
		else
		    str2+=st+",";
	}
	str1[str1.length()-1]='\"';
	str2[str2.length()-1]='\"';
	if(str2[0]=='\0')
	cout<<"-"<<endl<<"\""<<str1;
	else if(str1[0]=='\0')
	cout<<"\""<<str2<<endl<<"-";
	else
	cout<<"\""<<str2<<endl<<"\""<<str1;
}


#include<bits/stdc++.h>
using namespace std;
#define FOR(i,n) for(int i=0;i<n;i++)
int main()
{
	int flag,flag2,j,stt1;
	string str,st,str1="",str2="";
	cin>>str;
	FOR(i,str.length())
	{
		st="";
		flag=flag2=0;
		j=i;
		stt1=(int)str[j];
		while(stt1!=44 && stt1!=46 && stt1!=59 && j<str.length())
		{
			st+=str[j];
			if(stt1<48 || stt1>57 )
			  flag=1;
			j++;
			stt1=(int)str[j];
			flag2=1;
		}
		i=j;
		if(st[0]=='0' && flag==0 && st.length()!=1)
		    flag=1;
		if(flag2==0)
		    flag=1;
		if(flag==1)
		    str1+=st+",";
		else
		    str2+=st+",";
	}
	str1[str1.length()-1]='\"';
	str2[str2.length()-1]='\"';
	if(str2[0]=='\0')
	cout<<"-"<<endl<<"\""<<str1;
	else if(str1[0]=='\0')
	cout<<"\""<<str2<<endl<<"-";
	else
	cout<<"\""<<str2<<endl<<"\""<<str1;
}


#include<bits/stdc++.h>
using namespace std;
#define FOR(i,n) for(int i=0;i<n;i++)
int main()
{
	int flag,flag2,j,stt1;
	string str,st,str1="",str2="";
	cin>>str;
	str+=".";
	FOR(i,str.length())
	{
		st="";
		flag=flag2=0;
		j=i;
		stt1=(int)str[j];
		while(stt1!=44 && stt1!=46 && stt1!=59 && j<str.length())
		{
			st+=str[j];
			if(stt1<48 || stt1>57 )
			  flag=1;
			j++;
			stt1=(int)str[j];
			flag2=1;
		}
		i=j;
		if(st[0]=='0' && flag==0 && st.length()!=1)
		    flag=1;
		if(flag2==0)
		    flag=1;
		if(flag==1)
		    str1+=st+",";
		else
		    str2+=st+",";
	}
	str1[str1.length()-1]='\"';
	str2[str2.length()-1]='\"';
	if(str2[0]=='\0')
	cout<<"-"<<endl<<"\""<<str1;
	else if(str1[0]=='\0')
	cout<<"\""<<str2<<endl<<"-";
	else
	cout<<"\""<<str2<<endl<<"\""<<str1;
}


#include<bits/stdc++.h>
//#define endl "\n"
using namespace std;
string s,a,b;
vector<string> vs;

int check(char c)
{
	if (c==';' || c==',') return 1;
	else return 0;
}

int cnum(string v)
{
	if (v.length()==0 || (v.length()!=1 && v[0]=='0')) return 0;
	for (int i=0; i<(int)v.length(); i++)
		if (v[i]<'0' || v[i]>'9') return 0;
	return 1;
}

int main()
{
	ios::sync_with_stdio(false);
	//cin.tie(0);
	cin>>s;
	int len=s.length();
	s[len]=',';
	len++;
	int pos=0;
	for(int i=0; i<len; i++)
		if(check(s[i]))
		{
			vs.push_back(s.substr(pos,i-pos));
			pos=i+1;
		}
	for (int i=0; i<(int)vs.size(); i++)
	{
		if (cnum(vs[i])) a+=","+vs[i];
		else b+=","+vs[i];
	}
	if (a.length())
	{
		a[0]='"';
		cout<<a<<"\""<<endl;
	}
	else cout<<"-"<<endl;
	if (b.length())
	{
		b[0]='"';
		cout<<b<<"\""<<endl;
	}
	else cout<<"-"<<endl;
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define pb push_back

string original;
vector<string> all;
vector<string> ints;
vector<string> strs;

void split(string a);
bool isNum(string a);
void print(vector<string> a);

int main() {
	cin >> original;
	split(original);
	for(int i = 0; i < all.size(); i++) {
		if(isNum(all[i])) {
			ints.pb(all[i]);
		} else {
			strs.pb(all[i]);
		}
	}
	print(ints);
	print(strs);
	return 0;
}

void split(string a) {
	string temp = "";
	for(int i = 0; i < a.size(); i++) {
		if(a[i] != ',' && a[i] != ';') {
			temp += a[i];
		} else {
			all.pb(temp);
			temp = "";
		}
	}
	all.pb(temp);
}

bool isNum(string a) {
	for(int i = 0; i < a.size(); i++) {
		if(a == ""){
			return false;
		}
		if(a[0] == '0' &&a.size() > 1) {
			return false;
		}
		if(a[i] > '9' || a[i] < '0') {
			return false;
		}
	}
	return true;
}

void print(vector<string> a) {
	if(a.size() == 0) {
		cout<< "-";
	}else{
		cout<< "\"";
		for(int i = 0; i < a.size(); i++) {
			if(i != a.size()-1){
				cout<< a[i] << ",";
			}
		else {
				cout<< a[i]<<"\"\n";
			}
		}
	}
}


#include <bits/stdc++.h>

using namespace std;

#define pb push_back

string original;
vector<string> all;
vector<string> ints;
vector<string> strs;

void split(string a);
bool isNum(string a);
void print(vector<string> a);

int main() {
	cin >> original;
	split(original);
	for(int i = 0; i < all.size(); i++) {
		if(isNum(all[i])) {
			ints.pb(all[i]);
		} else {
			strs.pb(all[i]);
		}
	}
	print(ints);
	print(strs);
	return 0;
}

void split(string a) {
	string temp = "";
	for(int i = 0; i < a.size(); i++) {
		if(a[i] != ',' && a[i] != ';') {
			temp += a[i];
		} else {
			all.pb(temp);
			temp = "";
		}
	}
	all.pb(temp);
}

bool isNum(string a) {
	if(a == ""){
			return false;
		}
		if(a[0] == '0' &&a.size() > 1) {
			return false;
		}
	for(int i = 0; i < a.size(); i++) {
		if(a[i] > '9' || a[i] < '0') {
			return false;
		}
	}
	return true;
}

void print(vector<string> a) {
	if(a.size() == 0) {
		cout<< "-";
	}else{
		cout<< "\"";
		for(int i = 0; i < a.size(); i++) {
			if(i != a.size()-1){
				cout<< a[i] << ",";
			}
			else {
				cout<< a[i] <<"\"\n";
			}
		}
	}
}


#include <bits/stdc++.h>

using namespace std;

#define pb push_back
#define ll long long

void io()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
}

bool isNum(string s) {
	if (s == "") return false;
	if (s[0] == '0' && s.length() > 1) return false;
	for (int i = 0; i < s.length(); ++i)
		if (!isdigit(s[i])) return false;
	return true;
}

int main()
{
	io();
	string s, temp = "";
	cin >> s;
	vector <string> nums, chars, original;
	for (int i = 0; i < s.length(); ++i) {
		if (s[i] != ',' && s[i] != ';') temp += s[i];
		else {
			original.pb(temp);
			temp = "";
		}
	}
	original.pb(temp);
	for (int i = 0; i < original.size(); ++i) {
		if (isNum(original[i])) nums.pb(original[i]);
		else chars.pb(original[i]);
	}
	if (!nums.size()) cout << "-";
	else {
		cout << '"' << nums[0];
		for (int i = 1; i < nums.size(); ++i) {
			if (nums[i].size() < 1) continue;
			else if (i == nums.size() - 1) cout << "," << nums[i];
			else cout << "," << nums[i];
		}
		cout << '"';
	}
	cout << "\n";
	if (!chars.size()) cout << "-";
	else {
		cout << '"' << chars[0];
		for (int i = 1; i < chars.size(); ++i) {
			if (i == chars.size() - 1) cout << "," << chars[i];
			else cout << "," << chars[i];
		}
		cout << '"';
	}
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define pb push_back
#define mp make_pair
#define ll long long

void io()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
}

vector < string > mix;
vector < string > ints;
vector < string > strs;

bool isDigit(string s) {
	if (s == "") return false;
	if (s[0] == '0' && s.length() > 1) return false;
	for (int i = 0; i < s.length(); ++i)
		if (s[i] > '9' || s[i] < '0') return false;
	return true;
}
int main()
{
	io();
	string s, temp = "";
	cin >> s;
	for (int i = 0; i < s.length(); ++i) {
		if (s[i] != ',' && s[i] != ';') temp += s[i];
		else {
			mix.pb(temp);
			temp = "";
		}
	}
	mix.pb(temp);
	for (int i = 0; i < mix.size(); ++i) {
		if (isDigit(mix[i])) ints.pb(mix[i]);
		else strs.pb(mix[i]);
	}
	if (ints.size()) {
		cout << '"';
		for (int i = 0; i < ints.size() - 1; ++i)
			cout << ints[i] << ", ";
		cout << ints[ints.size() - 1] << '"';
	}
	else cout << "-";
	cout << "\n";
	if (strs.size()) {
		cout << '"';
		for (int i = 0; i < strs.size() - 1; ++i)
			cout << strs[i] << ", ";
		cout << strs[strs.size() - 1] << '"';
	}
	else cout << "-";
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define pb push_back
#define mp make_pair
#define ll long long

void io()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
}

vector < string > mix;
vector < string > ints;
vector < string > strs;

bool isDigit(string s) {
	if (s == "") return false;
	if (s[0] == '0' && s.length() > 1) return false;
	for (int i = 0; i < s.length(); ++i)
		if (s[i] > '9' || s[i] < '0') return false;
	return true;
}
int main()
{
	io();
	string s, temp = "";
	cin >> s;
	for (int i = 0; i < s.length(); ++i) {
		if (s[i] != ',' && s[i] != ';') temp += s[i];
		else {
			mix.pb(temp);
			temp = "";
		}
	}
	mix.pb(temp);
	for (int i = 0; i < mix.size(); ++i) {
		if (isDigit(mix[i])) ints.pb(mix[i]);
		else strs.pb(mix[i]);
	}
	if (ints.size()) {
		cout << '"';
		for (int i = 0; i < ints.size() - 1; ++i)
			cout << ints[i] << ",";
		cout << ints[ints.size() - 1] << '"';
	}
	else cout << "-";
	cout << "\n";
	if (strs.size()) {
		cout << '"';
		for (int i = 0; i < strs.size() - 1; ++i)
			cout << strs[i] << ",";
		cout << strs[strs.size() - 1] << '"';
	}
	else cout << "-";
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define pb push_back

string original;
vector<string> all;
vector<string> ints;
vector<string> strs;

void split(string a);
bool isNum(string a);
void print(vector<string> a);

int main() {
	cin >> original;
	split(original);
	for(int i = 0; i < all.size(); i++) {
		if(isNum(all[i])) {
			ints.pb(all[i]);
		} else {
			strs.pb(all[i]);
		}
	}
	print(ints);
	print(strs);
	return 0;
}

void split(string a) {
	string temp = "";
	for(int i = 0; i < a.size(); i++) {
		if(a[i] != ',' && a[i] != ';') {
			temp += a[i];
		} else {
			all.pb(temp);
			temp = "";
		}
	}
	all.pb(temp);
}

bool isNum(string a) {
	if(a == ""){
			return false;
		}
		if(a[0] == '0' &&a.size() > 1) {
			return false;
		}
	for(int i = 0; i < a.size(); i++) {
		if(a[i] > '9' || a[i] < '0') {
			return false;
		}
	}
	return true;
}

void print(vector<string> a) {
	if(a.size() == 0) {
		cout<< "-\n";
	}else{
		cout<< "\"";
		for(int i = 0; i < a.size(); i++) {
			if(i != a.size()-1){
				cout<< a[i] << ",";
			}
			else {
				cout<< a[i] <<"\"\n";
			}
		}
	}
}


#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define ll long long

int main()
{
    string s;
    cin>>s;
    vector<string>di;
    vector<string>nondi;
    int n=(int)s.length();
    for(int i=0;i<n;++i)
    {
      if(s[i]==','||s[i]==';'){
          nondi.pb("");
      continue;}

            string k;
                int j=i;
                while(j<n && s[j]!=','&&s[j]!=';')
                {
                    k+=s[j];
                    j++;
                }
                //cout<<k<<endl;
                nondi.pb(k);
                i=j;
    }

    for(auto i=nondi.begin();i<nondi.end();++i)
    {
        string x=*i;
        bool flag=true;
        for(int j=0;j<x.length();++j)
        {
            if(x[j]>='a' && x[j]<='z')
            {
                flag=false;
                break;
            }
            if(x[0]=='0'&& x.length()>1)
            {
                flag=false;break;
            }
        }
        if(flag)
        {
            di.pb(x);
             nondi.erase(i);
        }
    }
    if(di.size()==0)
    {
        cout<<"-"<<endl;
    }
    else{
    if(di.size()==1){
         cout<<(char)34;
         cout<<di[0]<<(char)34<<endl;
    }
    else{

    for(auto x:di)
    {
        cout<<x<<',';
    }
    cout<<(char)34<<endl;
    }
    }
    if(nondi.size()==0)
    {
        cout<<"-"<<endl;
    }
    else{
        if(nondi.size()==1){
        cout<<(char)34<<nondi[0]<<(char)34<<endl;}
        else{
            cout<<(char)34;
    for( auto x:nondi)
    {
        cout<<x<<',';
    }
    cout<<(char)34<<endl;
    }
    }

}


#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define ll long long

int main()
{
    string s;
    cin>>s;
    vector<string>di;
    vector<string>nondi;
    int n=(int)s.length();
    for(int i=0;i<n;++i)
    {
      if(s[i]==','||s[i]==';'){
          nondi.pb("");
      continue;}

            string k;
                int j=i;
                while(j<n && s[j]!=','&&s[j]!=';')
                {
                    k+=s[j];
                    j++;
                }
                //cout<<k<<endl;
                nondi.pb(k);
                i=j;
    }

    for(auto i=nondi.begin();i<nondi.end();++i)
    {
        string x=*i;
        bool flag=true;
        for(int j=0;j<x.length();++j)
        {
            if(x[j]>='a' && x[j]<='z')
            {
                flag=false;
                break;
            }
            if(x[0]=='0'&& x.length()>1)
            {
                flag=false;break;
            }
        }
        if(flag)
        {
            di.pb(x);
             nondi.erase(i);
        }
    }
    if(di.size()==0)
    {
        cout<<"-"<<endl;
    }
    else{
    if(di.size()==1){
         cout<<(char)34;
         cout<<di[0]<<(char)34<<endl;
    }
    else{

    cout<<(char)34;
    for(auto x:di)
    {
        cout<<x<<',';
    }
    cout<<(char)34<<endl;
    }
    }
    if(nondi.size()==0)
    {
        cout<<"-"<<endl;
    }
    else{
        if(nondi.size()==1){
        cout<<(char)34<<nondi[0]<<(char)34<<endl;}
        else{
            cout<<(char)34;
    for( auto x:nondi)
    {
        cout<<x<<',';
    }
    cout<<(char)34<<endl;
    }
    }

}


#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define ll long long

int main()
{
    string s;
    cin>>s;
    vector<string>di;
    vector<string>nondi;
    int n=(int)s.length();
    for(int i=0;i<n;++i)
    {
      if(s[i]==','||s[i]==';'){
          nondi.pb("");
         if(s[n-1]==(char)0)
          nondi.pb("");
      continue;}

            string k;
                int j=i;
                while(j<n && s[j]!=','&&s[j]!=';')
                {
                    k+=s[j];
                    j++;
                }
                //cout<<k<<endl;
                nondi.pb(k);
                i=j;
    }

    for(auto i=nondi.begin();i<nondi.end();++i)
    {
        string x=*i;
        bool flag=true;
        for(int j=0;j<x.length();++j)
        {
            if(x[j]>='a' && x[j]<='z')
            {
                flag=false;
                break;
            }
            if(x[0]=='0'&& x.length()>1)
            {
                flag=false;break;
            }
        }
        if(flag)
        {
            di.pb(x);
             nondi.erase(i);
        }
    }
    if(di.size()==0)
    {
        cout<<"-"<<endl;
    }
    else{
    if(di.size()==1){
         cout<<(char)34;
         cout<<di[0]<<(char)34<<endl;
    }
    else{

    cout<<(char)34;
   for(int i=0;i<di.size();++i){
       if(i==(int)di.size()-1)
       {
           cout<<di[i];
       }
       else
       cout<<di[i]<<',';
   }
    cout<<(char)34<<endl;
    }
    }
    if(nondi.size()==0)
    {
        cout<<"-"<<endl;
    }
    else{
        if(nondi.size()==1){
        cout<<(char)34<<nondi[0]<<(char)34<<endl;}
        else{
            cout<<(char)34;
   for(int i=0;i<nondi.size();++i)
   {
       if(i==(int)nondi.size()-1)
       cout<<nondi[i];
       else
       cout<<nondi[i]<<',';
   }
    cout<<(char)34<<endl;
    }
    }

}


#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define ll long long
bool isnumber(string s)
{
    if(s.empty())
    return false;
    if(s.size()>1&& s[0]=='0')
    return false;
    for(int i=0;i<(int)s.length();++i){
    if(s[i]<'0'||s[i]>'9')
    return false;}
    return true;
}

int main()
{
    string s,temp;
    cin>>s;
    vector<string>a,b;
    for(int i=0;i<(int)s.length();++i)
    {
        if(s[i]==';'||s[i]==',')
        {
            if(isnumber(temp))
            a.pb(temp);
            else
            b.pb(temp);
            temp.clear();
        }
        else
        temp+=s[i];
    }
    if(isnumber(temp))
    a.pb(temp);
    else
    b.pb(temp);
    if(a.empty())
    {
        cout<<"-"<<'\n';
    }
    else
    {
        cout<<(char)34;
        for(int i=0;i<a.size();++i)
        {
            cout<<a[i];
            if(i!=a.size()-1)
            cout<<',';

        }
        cout<<(char)34<<endl;
    }
    if(b.empty())
    {
        cout<<"-"<<'\n';
    }
    else
    {
        cout<<(char)34;
        for(int i=0;i<b.size();++i)
        {
            cout<<b[i];
            if(i!=b.size()-1)
            cout<<',';

        }
        cout<<(char)34;
    }

}


            #include<bits/stdc++.h>
            using namespace std;
            //Templatefunctions
            template<typename T>T gcd(T x, T y) { if (y == 0)return x; else return gcd(y, x%y);}
            //datatypes
            typedef long long int ll;
            typedef unsigned long long int ull;
            typedef long double ld;
            typedef set<int>::iterator sit;
            typedef map<int,int>::iterator mit; // pair
            typedef vector<int>::iterator vit;
            //constants
            const double INF = 1e+9;
            const double INFLL = 1e+18;
            const double EPS = 1e-6;
            const double PI = acos(-1);
            const int inightDir[8][2] = {{-2,-1},{-2,1},{-1,2},{1,2},{2,-1},{2,1},{-1,-2},{1,-2}};
    //        const int dx[]={0,0,0,1,1,1,-1,-1,-1};
    //        const int dy[]={-1,0,1,-1,0,1,-1,0,1};
            const int dx[] = {0 , 1 , 0 , -1};
            const int dy[] = {1 , 0 , -1 , 0};
            //helpers
            #define MOD         1000000007LL
            #define MAX         200005
            const int V = sqrt(1e9);
            //globalVariables;

            int main() {
                    //freopen("input.txt","r",stdin);
                    //freopen("output.txt","w",stdout);
                    char s[MAX];
                    vector<string> nums , word;
                    scanf("%s",s);
                    int len = strlen(s);
                    bool f = false;
                    bool havelatin = false,haveZerofirst = false;
                    string temp = "";
                    for(int i = 0 ; i < len ; i++)
                    {
                        if(s[i] == '.' || s[i] == ',' || s[i] == ';')
                        {
                            if(f)
                            {
                                if(havelatin || haveZerofirst)
                                {
                                    if(haveZerofirst && temp.length() == 1)nums.push_back(temp);
                                    else word.push_back(temp);
                                    temp = "";
                                }
                                else
                                {
                                    nums.push_back(temp);
                                    temp = "";
                                }
                                f = false;
                                havelatin = false;
                                haveZerofirst = false;
                            }else word.push_back(temp);
                        }
                        else
                        {
                            if(!f)
                            {
                                f = true;
                                temp += s[i];
                                if(s[i] == '0')haveZerofirst = true;
                                else if(isalpha(s[i]))havelatin = true;
                            }
                            else{
                                temp += s[i];
                                if(isalpha(s[i]))havelatin = true;
                            }
                        }
                    }
                        if(havelatin || haveZerofirst)
                        {
                            if(haveZerofirst && temp.length() == 1)nums.push_back(temp);
                            else word.push_back(temp);

                        }
                        else if(temp.length() == 0)
                        {
                            word.push_back(temp);
                        }
                        else
                        {
                            nums.push_back(temp);

                        }

                    if(nums.size() == 0)printf("-");
                    else
                    {
                        printf("\"");
                        for(int i = 0 ; i < nums.size() ; i++)
                        {
                            cout<<nums[i];
                            if(i != nums.size()-1)printf(",");
                            else printf("\"");
                        }
                    }
                    printf("\n");
                    if(word.size() == 0)printf("-");
                    else
                    {
                        printf("\"");
                        for(int i = 0 ; i < word.size() ; i++)
                        {
                            cout<<word[i];
                            if(i != word.size()-1)printf(",");
                            else printf("\"");
                        }
                    }
            }


            #include<bits/stdc++.h>
            using namespace std;
            //Templatefunctions
            template<typename T>T gcd(T x, T y) { if (y == 0)return x; else return gcd(y, x%y);}
            //datatypes
            typedef long long int ll;
            typedef unsigned long long int ull;
            typedef long double ld;
            typedef set<int>::iterator sit;
            typedef map<int,int>::iterator mit; // pair
            typedef vector<int>::iterator vit;
            //constants
            const double INF = 1e+9;
            const double INFLL = 1e+18;
            const double EPS = 1e-6;
            const double PI = acos(-1);
            const int inightDir[8][2] = {{-2,-1},{-2,1},{-1,2},{1,2},{2,-1},{2,1},{-1,-2},{1,-2}};
    //        const int dx[]={0,0,0,1,1,1,-1,-1,-1};
    //        const int dy[]={-1,0,1,-1,0,1,-1,0,1};
            const int dx[] = {0 , 1 , 0 , -1};
            const int dy[] = {1 , 0 , -1 , 0};
            //helpers
            #define MOD         1000000007LL
            #define MAX         200005
            const int V = sqrt(1e9);
            //globalVariables;

            int main() {
                    //freopen("input.txt","r",stdin);
                    //freopen("output.txt","w",stdout);
                    char s[MAX];
                    vector<string> nums , word;
                    scanf("%s",s);
                    int len = strlen(s);
                    bool f = false;
                    bool havelatin = false,haveZerofirst = false;
                    string temp = "";
                    for(int i = 0 ; i < len ; i++)
                    {
                        if(s[i] == '.' || s[i] == ',' || s[i] == ';')
                        {
                            if(f)
                            {
                                if(havelatin || haveZerofirst)
                                {
                                    if(haveZerofirst && temp.length() == 1)nums.push_back(temp);
                                    else word.push_back(temp);
                                    temp = "";
                                }
                                else
                                {
                                    nums.push_back(temp);
                                    temp = "";
                                }
                                f = false;
                                havelatin = false;
                                haveZerofirst = false;
                            }else word.push_back(temp);
                        }
                        else
                        {
                            if(!f)
                            {
                                f = true;
                                temp += s[i];
                                if(s[i] == '0')haveZerofirst = true;
                                else if(isalpha(s[i]))havelatin = true;
                            }
                            else{
                                temp += s[i];
                                if(isalpha(s[i]))havelatin = true;
                            }
                        }
                    }
                    if(temp.length() > 0)
                    {
                        if(havelatin || haveZerofirst)
                        {
                            if(haveZerofirst && temp.length() == 1)nums.push_back(temp);
                            else word.push_back(temp);

                        }
                        else
                        {
                            nums.push_back(temp);

                        }
                    }
                    if(nums.size() == 0)printf("-\n");
                    else
                    {
                        printf("\"");
                        for(int i = 0 ; i < nums.size() ; i++)
                        {
                            cout<<nums[i];
                            if(i != nums.size()-1)printf(",");
                            else printf("\"");
                        }
                    }
                    printf("\n");
                    if(word.size() == 0)printf("-\n");
                    else
                    {
                        printf("\"");
                        for(int i = 0 ; i < word.size() ; i++)
                        {
                            cout<<word[i];
                            if(i != word.size()-1)printf(",");
                            else printf("\"");
                        }
                    }
            }


            #include<bits/stdc++.h>
            using namespace std;
            //Templatefunctions
            template<typename T>T gcd(T x, T y) { if (y == 0)return x; else return gcd(y, x%y);}
            //datatypes
            typedef long long int ll;
            typedef unsigned long long int ull;
            typedef long double ld;
            typedef set<int>::iterator sit;
            typedef map<int,int>::iterator mit; // pair
            typedef vector<int>::iterator vit;
            //constants
            const double INF = 1e+9;
            const double INFLL = 1e+18;
            const double EPS = 1e-6;
            const double PI = acos(-1);
            const int inightDir[8][2] = {{-2,-1},{-2,1},{-1,2},{1,2},{2,-1},{2,1},{-1,-2},{1,-2}};
    //        const int dx[]={0,0,0,1,1,1,-1,-1,-1};
    //        const int dy[]={-1,0,1,-1,0,1,-1,0,1};
            const int dx[] = {0 , 1 , 0 , -1};
            const int dy[] = {1 , 0 , -1 , 0};
            //helpers
            #define MOD         1000000007LL
            #define MAX         200005
            const int V = sqrt(1e9);
            //globalVariables;

            int main() {
                    //freopen("input.txt","r",stdin);
                    //freopen("output.txt","w",stdout);
                    char s[MAX];
                    vector<string> nums , word;
                    scanf("%s",s);
                    int len = strlen(s);
                    bool f = false;
                    bool havelatin = false,haveZerofirst = false;
                    string temp = "";
                    for(int i = 0 ; i < len ; i++)
                    {
                        if(s[i] == ',' || s[i] == ';')
                        {
                            if(f)
                            {
                                if(havelatin || haveZerofirst)
                                {
                                    if(haveZerofirst && temp.length() == 1)nums.push_back(temp);
                                    else word.push_back(temp);
                                    temp = "";
                                }
                                else
                                {
                                    nums.push_back(temp);
                                    temp = "";
                                }
                                f = false;
                                havelatin = false;
                                haveZerofirst = false;
                            }else word.push_back(temp);
                        }
                        else
                        {
                            if(!f)
                            {
                                f = true;
                                temp += s[i];
                                if(s[i] == '0')haveZerofirst = true;
                                else if(isalpha(s[i]) || s[i] == '.')havelatin = true;
                            }
                            else{
                                temp += s[i];
                                if(isalpha(s[i]) || s[i] == '.')havelatin = true;
                            }
                        }
                    }

                    if(havelatin || haveZerofirst)
                    {
                        if(haveZerofirst && temp.length() == 1)nums.push_back(temp);
                        else word.push_back(temp);
                    }
                    else if(temp.length() == 0)
                    {
                        word.push_back(temp);
                    }
                    else
                    {
                        nums.push_back(temp);

                    }

                    if(nums.size() == 0)printf("-");
                    else
                    {
                        printf("\"");
                        for(int i = 0 ; i < nums.size() ; i++)
                        {
                            cout<<nums[i];
                            if(i != nums.size()-1)printf(",");
                            else printf("\"");
                        }
                    }
                    printf("\n");
                    if(word.size() == 0)printf("-");
                    else
                    {
                        printf("\"");
                        for(int i = 0 ; i < word.size() ; i++)
                        {
                            cout<<word[i];
                            if(i != word.size()-1)printf(",");
                            else printf("\"");
                        }
                    }
            }


            #include<bits/stdc++.h>
            using namespace std;
            //Templatefunctions
            template<typename T>T gcd(T x, T y) { if (y == 0)return x; else return gcd(y, x%y);}
            //datatypes
            typedef long long int ll;
            typedef unsigned long long int ull;
            typedef long double ld;
            typedef set<int>::iterator sit;
            typedef map<int,int>::iterator mit; // pair
            typedef vector<int>::iterator vit;
            //constants
            const double INF = 1e+9;
            const double INFLL = 1e+18;
            const double EPS = 1e-6;
            const double PI = acos(-1);
            const int inightDir[8][2] = {{-2,-1},{-2,1},{-1,2},{1,2},{2,-1},{2,1},{-1,-2},{1,-2}};
    //        const int dx[]={0,0,0,1,1,1,-1,-1,-1};
    //        const int dy[]={-1,0,1,-1,0,1,-1,0,1};
            const int dx[] = {0 , 1 , 0 , -1};
            const int dy[] = {1 , 0 , -1 , 0};
            //helpers
            #define MOD         1000000007LL
            #define MAX         200005
            const int V = sqrt(1e9);
            //globalVariables;

            int main() {
                    //freopen("input.txt","r",stdin);
                    //freopen("output.txt","w",stdout);
                    char s[MAX];
                    vector<string> nums , word;
                    scanf("%s",s);
                    int len = strlen(s);
                    bool f = false;
                    bool havelatin = false,haveZerofirst = false;
                    string temp = "";
                    for(int i = 0 ; i < len ; i++)
                    {
                        if(s[i] == '.' || s[i] == ',' || s[i] == ';')
                        {
                            if(f)
                            {
                                if(havelatin || haveZerofirst)
                                {
                                    if(haveZerofirst && temp.length() == 1)nums.push_back(temp);
                                    else word.push_back(temp);
                                    temp = "";
                                }
                                else
                                {
                                    nums.push_back(temp);
                                    temp = "";
                                }
                                f = false;
                                havelatin = false;
                                haveZerofirst = false;
                            }else word.push_back(temp);
                        }
                        else
                        {
                            if(!f)
                            {
                                f = true;
                                temp += s[i];
                                if(s[i] == '0')haveZerofirst = true;
                                else if(isalpha(s[i]))havelatin = true;
                            }
                            else{
                                temp += s[i];
                                if(isalpha(s[i]))havelatin = true;
                            }
                        }
                    }
                        if(havelatin || haveZerofirst)
                        {
                            if(haveZerofirst && temp.length() == 1)nums.push_back(temp);
                            else word.push_back(temp);

                        }
                        else if(temp.length() == 0)
                        {
                            word.push_back(temp);
                        }
                        else
                        {
                            nums.push_back(temp);

                        }

                    if(nums.size() == 0)printf("-\n");
                    else
                    {
                        printf("\"");
                        for(int i = 0 ; i < nums.size() ; i++)
                        {
                            cout<<nums[i];
                            if(i != nums.size()-1)printf(",");
                            else printf("\"");
                        }
                    }
                    printf("\n");
                    if(word.size() == 0)printf("-\n");
                    else
                    {
                        printf("\"");
                        for(int i = 0 ; i < word.size() ; i++)
                        {
                            cout<<word[i];
                            if(i != word.size()-1)printf(",");
                            else printf("\"");
                        }
                    }
            }


#include <bits/stdc++.h>
using namespace std;
bool allow(string x)
{
    if (x.size() == 0)
    {
        return false;
    }
    if (x == "0")
    {
        return true;
    }
    bool ok = true;
    for (char c : x)
    {
        if (c > 57 || c < 48)
        {
            ok = false;
            break;
        }
    }
    if (!ok)
    {
        return false;
    }
    return (x[0] == '0' ? false : true);
}
int main()
{
    string x;
    cin >> x;
    vector<string> all;
    string curr = "";
    for (char c : x)
    {
        if (c == 44 || c == 59)
        {
            all.push_back(curr);
            curr = "";
        }
        else
        {
            curr.push_back(c);
        }
    }
    all.push_back(curr);
    string a, b;
    a = b = "";
    bool m, n;
    m = n = false;
    for (string x : all)
    {
        if (allow(x))
        {
            if (a.size() == 0 && m == false)
            {
                a += x;
                m = true;
            }
            else
            {
                a.push_back(',');
                a += x;
            }
        }
        else
        {
            if (b.size() == 0 && n == false)
            {
                b += x;
                n = true;
            }
            else
            {
                b.push_back(',');
                b += x;
            }
        }
    }
    char l = 34;
    if (a.size() == 0)
    {
        cout << "-\n";
    }
    else
    {
        cout << l << a << l << "\n";
    }
    if (b.size() == 0)
    {
        cout << "-\n";
    }
    else
    {
        cout << l << b << l << "\n";
    }
}


#include <bits/stdc++.h>
using namespace std;
bool allow(string x)
{
    if (x.size() == 0)
    {
        return false;
    }
    if (x == "0")
    {
        return true;
    }
    bool ok = true;
    for (char c : x)
    {
        if (c > 57 || c < 48)
        {
            ok = false;
            break;
        }
    }
    if (!ok)
    {
        return false;
    }
    return (x[0] == '0' ? false : true);
}
int main()
{
    string x;
    cin >> x;
    vector<string> all;
    string curr = "";
    for (char c : x)
    {
        if (c == 44 || c == 59)
        {
            all.push_back(curr);
            curr = "";
        }
        else
        {
            curr.push_back(c);
        }
    }
    all.push_back(curr);
    string a, b;
    a = b = "";
    bool m, n;
    m = n = false;
    for (string x : all)
    {
        if (allow(x))
        {
            if (a.size() == 0 && m == false)
            {
                a += x;
                m = true;
            }
            else
            {
                a.push_back(',');
                a += x;
            }
        }
        else
        {
            if (b.size() == 0 && n == false)
            {
                b += x;
                n = true;
            }
            else
            {
                b.push_back(',');
                b += x;
            }
        }
    }
    char l = 34;
    if(a.size()==0){
        cout<<"\n";
    }else{
        cout << l << a << l << "\n";
    }if(b.size() == 0){
        cout << "\n";
    }else{
        cout << l << b << l << "\n";
    }
}


#include <bits/stdc++.h>
using namespace std;
bool allow(string x)
{
    if (x.size() == 0)
    {
        return false;
    }
    if (x == "0")
    {
        return true;
    }
    bool ok = true;
    for (char c : x)
    {
        if (c > 57 || c < 48)
        {
            ok = false;
            break;
        }
    }
    if (!ok)
    {
        return false;
    }
    return (x[0] == '0' ? false : true);
}
int main()
{
    string x;
    cin >> x;
    vector<string> all;
    string curr = "";
    for (char c : x)
    {
        if (c == 44 || c == 59)
        {
            all.push_back(curr);
            curr = "";
        }
        else
        {
            curr.push_back(c);
        }
    }
    all.push_back(curr);
    string a, b;
    a = b = "";
    bool m, n;
    m = n = false;
    for (string x : all)
    {
        if (allow(x))
        {
            if (a.size() == 0 && m == false)
            {
                a += x;
                m = true;
            }
            else
            {
                a.push_back(',');
                a += x;
            }
        }
        else
        {
            if (b.size() == 0 && n == false)
            {
                b += x;
                n = true;
            }
            else
            {
                b.push_back(',');
                b += x;
            }
        }
    }
    cout << a << "\n"
         << b << "\n";
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
bool allow(string x)
{
    if (x.size() == 0)
    {
        return false;
    }
    if (x == "0")
    {
        return true;
    }
    bool ok = true;
    for (char c : x)
    {
        if (c > 57 || c < 48)
        {
            ok = false;
            break;
        }
    }
    if (!ok)
    {
        return false;
    }
    return (x[0] == '0' ? false : true);
}
int main()
{
    string x;
    cin >> x;
    vector<string> all;
    string curr = "";
    for (char c : x)
    {
        if (c == 44 || c == 59)
        {
            all.push_back(curr);
            curr = "";
        }
        else
        {
            curr.push_back(c);
        }
    }
    all.push_back(curr);
    string a, b;
    a = b = "";
    bool m, n;
    m = n = false;
    for (string x : all)
    {
        if (allow(x))
        {
            if (a.size() == 0 && m == false)
            {
                a += x;
                m = true;
            }
            else
            {
                a.push_back(',');
                a += x;
            }
        }
        else
        {
            if (b.size() == 0 && n == false)
            {
                b += x;
                n = true;
            }
            else
            {
                b.push_back(',');
                b += x;
            }
        }
    }
    char l = 34;
    cout << l << a << l << "\n"
         << l << b << l << endl;
}


#include <bits/stdc++.h>
using namespace std;
bool allow(string x)
{
    if (x.size() == 0)
    {
        return false;
    }
    if (x == "0")
    {
        return true;
    }
    bool ok = true;
    for (char c : x)
    {
        if (c > 57 || c < 48)
        {
            ok = false;
            break;
        }
    }
    if (!ok)
    {
        return false;
    }
    return (x[0] == '0' ? false : true);
}
int main()
{
    string x;
    cin >> x;
    vector<string> all;
    string curr = "";
    for (char c : x)
    {
        if (c == 44 || c == 59)
        {
            all.push_back(curr);
            curr = "";
        }
        else
        {
            curr.push_back(c);
        }
    }
    all.push_back(curr);
    string a, b;
    a = b = "";
    bool m, n;
    m = n = false;
    for (string x : all)
    {
        if (allow(x))
        {
            if (a.size() == 0 && m == false)
            {
                a += x;
                m = true;
            }
            else
            {
                a.push_back(',');
                a += x;
            }
        }
        else
        {
            if (b.size() == 0 && n == false)
            {
                b += x;
                n = true;
            }
            else
            {
                b.push_back(',');
                b += x;
            }
        }
    }
    char l = 34;
    if (a.size() == 0)
    {
        if (m)
        {
            cout << l << l << "\n";
        }
        else
        {
            cout << "-\n";
        }
    }
    else
    {
        cout << l << a << l << "\n";
    }
    if (b.size() == 0)
    {
        if (n)
        {
            cout << l << l << "\n";
        }
        else
        {
            cout << "-\n";
        }
    }
    else
    {
        cout << l << b << l << "\n";
    }
}


#include<bits/stdc++.h>
using namespace std;

# define C continue;
# define R return

# define D double
# define I insert
# define ll long long
# define ld long double

# define ull unsigned long long
# define ui unsigned int

# define pb push_back
# define pf push_front

# define vi vector < int >
# define vc vector < char >
# define vs vector < string >
# define vb vector < bool >
# define vd vector < D >
# define vll vector < ll >
# define vull vector < ull >
# define vld vector < ld >
# define PQ priority_queue

# define vvi vector < vector < int > >
# define vvb vector < vector < bool > >
# define vvc vector < vector < char > >
# define vvs vector < vs >
# define vvll vector < vector < ll > >
# define vvd vector < vector < D > >
# define vvld vector < vector < ld > >

# define all(v) (v).begin() , (v).end()
# define allrev(v) (v).rbegin() , (v).rend()
# define allcomp(v) v.begin() , v.end() , comp
# define allrevcomp(v) v.rbegin() , v.rend() , comp

# define pii pair < int , int >
# define pll pair < ll , ll >
# define pld pair < ld , ld >
# define pDD pair < D , D >

# define vpld vector < pld >
# define vpii vector < pii >
# define vpll vector < pll >
# define vpDD vector < pDD >

# define vvpii vector < vector < pii > >
# define F first
# define S second
# define mp make_pair

# define dist(a,b,p,q) sqrt((p-a)*(p-a) + (q-b)*(q-b))

# define pp(n) printf("%.10Lf",n);
# define line cout<<"\n";
# define fast ios_base::sync_with_stdio(false) ; cin.tie(0) ; cout.tie(0);

string vow = "aeiou";
int month[] = {-1, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

const int dxhorse[] = {-2, -2, -1, -1, 1, 1, 2, 2};
const int dyhorse[] = {1, -1, 2, -2, 2, -2, 1, -1};

const int dx[] = { -1 , 0 , 1 , 0 } ;
const int dy[] = { 0 , 1 , 0 , -1 } ;

const ld pie = 3.1415926535897932384626 ;
const ll mod = 1e9 + 7 ;

/// Tip : If a and b are positive integers ; we may say - ceil (a/b) = 1 + floor ( (a-1)/b ) .

bool all_digits ( string &temp )
{
    for ( auto &i : temp )
    {
        int d = i - '0' ;
        if ( d >= 0 && d <= 9 ) C ;

        return false ;
    }

    int z = temp.size() ;

    if ( z == 0 )
        return false ;

    if ( z )
    {
        if ( temp[0] == '0' && z != 1 )
            return false ;
    }

    return true ;
}

void solve ( int test_case )
{
    string s ;
    cin >> s ;

    s += '.' ;

    int n = s.size() ;

    vs a , b ;
    string temp = "" ;

    for ( int i=0 ; i < n ; i ++ )
    {
        if ( s[i] == '.' || s[i] == ',' || s[i] == ';' )
        {
            if ( all_digits ( temp ) && ((int)temp.size() != 0 ) )
                a.pb ( temp ) ;

            else
                b.pb ( temp ) ;

            temp = "" ;
        }

        else
        {
            temp += s[i] ;
        }
    }

    int z = a.size() ;

    if ( z == 0 )
    {
        cout << "-" ;
        line ;
    }

    else
    {
        cout << "\"" ;

        for ( int i=0 ; i < z - 1 ; i ++ )
        {
            cout << a[i] << "," ;
        }

        cout << a.back() ;
        cout << "\"" ;
        line ;
    }

    z = b.size() ;

    if ( z == 0 )
    {
        cout << "-" ;
        line ;
    }

    else
    {
        cout << "\"" ;

        for ( int i=0 ; i < z - 1 ; i ++ )
        {
            cout << b[i] << "," ;

        }

        cout << b.back() ;
        cout << "\"" ;

        line ;
    }

}

int main()
{fast
    int t = 1;
    // cin >> t;

    for ( int i=1 ; i <= t ; i ++ ) solve ( i ) ;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

# define C continue;
# define R return

# define D double
# define I insert
# define ll long long
# define ld long double

# define ull unsigned long long
# define ui unsigned int

# define pb push_back
# define pf push_front

# define vi vector < int >
# define vc vector < char >
# define vs vector < string >
# define vb vector < bool >
# define vd vector < D >
# define vll vector < ll >
# define vull vector < ull >
# define vld vector < ld >
# define PQ priority_queue

# define vvi vector < vector < int > >
# define vvb vector < vector < bool > >
# define vvc vector < vector < char > >
# define vvs vector < vs >
# define vvll vector < vector < ll > >
# define vvd vector < vector < D > >
# define vvld vector < vector < ld > >

# define all(v) (v).begin() , (v).end()
# define allrev(v) (v).rbegin() , (v).rend()
# define allcomp(v) v.begin() , v.end() , comp
# define allrevcomp(v) v.rbegin() , v.rend() , comp

# define pii pair < int , int >
# define pll pair < ll , ll >
# define pld pair < ld , ld >
# define pDD pair < D , D >

# define vpld vector < pld >
# define vpii vector < pii >
# define vpll vector < pll >
# define vpDD vector < pDD >

# define vvpii vector < vector < pii > >
# define F first
# define S second
# define mp make_pair

# define dist(a,b,p,q) sqrt((p-a)*(p-a) + (q-b)*(q-b))

# define pp(n) printf("%.10Lf",n);
# define line cout<<"\n";
# define fast ios_base::sync_with_stdio(false) ; cin.tie(0) ; cout.tie(0);

string vow = "aeiou";
int month[] = {-1, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

const int dxhorse[] = {-2, -2, -1, -1, 1, 1, 2, 2};
const int dyhorse[] = {1, -1, 2, -2, 2, -2, 1, -1};

const int dx[] = { -1 , 0 , 1 , 0 } ;
const int dy[] = { 0 , 1 , 0 , -1 } ;

const ld pie = 3.1415926535897932384626 ;
const ll mod = 1e9 + 7 ;

/// Tip : If a and b are positive integers ; we may say - ceil (a/b) = 1 + floor ( (a-1)/b ) .

bool all_digits ( string &temp )
{
    for ( auto &i : temp )
    {
        int d = i - '0' ;
        if ( d >= 0 && d <= 9 ) C ;

        return false ;
    }

    int z = temp.size() ;

    if ( z )
    {
        if ( temp[0] == '0' && z != 1 )
            return false ;
    }

    return true ;
}

void solve ( int test_case )
{
    string s ;
    cin >> s ;

    s += '.' ;

    int n = s.size() ;

    vs a , b ;
    string temp = "" ;

    for ( int i=0 ; i < n ; i ++ )
    {
        if ( s[i] == '.' || s[i] == ',' || s[i] == ';' )
        {
            if ( all_digits ( temp ) && ((int)temp.size() != 0 ) )
                a.pb ( temp ) ;

            else
                b.pb ( temp ) ;

            temp = "" ;
        }

        else
        {
            temp += s[i] ;
        }
    }

    int z = a.size() ;

    if ( z == 0 )
    {
        cout << "-" ;
        line ;
    }

    else
    {
        cout << "\"" ;

        for ( int i=0 ; i < z - 1 ; i ++ )
        {
            cout << a[i] << "," ;
        }

        cout << a.back() ;
        cout << "\"" ;
        line ;
    }

    z = b.size() ;

    if ( z == 0 )
    {
        cout << "-" ;
        line ;
    }

    else
    {
        cout << "\"" ;

        for ( int i=0 ; i < z - 1 ; i ++ )
        {
            cout << b[i] << "," ;

        }

        cout << b.back() ;
        cout << "\"" ;

        line ;
    }

}

int main()
{fast
    int t = 1;
    // cin >> t;

    for ( int i=1 ; i <= t ; i ++ ) solve ( i ) ;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

# define C continue;
# define R return

# define D double
# define I insert
# define ll long long
# define ld long double

# define ull unsigned long long
# define ui unsigned int

# define pb push_back
# define pf push_front

# define vi vector < int >
# define vc vector < char >
# define vs vector < string >
# define vb vector < bool >
# define vd vector < D >
# define vll vector < ll >
# define vull vector < ull >
# define vld vector < ld >
# define PQ priority_queue

# define vvi vector < vector < int > >
# define vvb vector < vector < bool > >
# define vvc vector < vector < char > >
# define vvs vector < vs >
# define vvll vector < vector < ll > >
# define vvd vector < vector < D > >
# define vvld vector < vector < ld > >

# define all(v) (v).begin() , (v).end()
# define allrev(v) (v).rbegin() , (v).rend()
# define allcomp(v) v.begin() , v.end() , comp
# define allrevcomp(v) v.rbegin() , v.rend() , comp

# define pii pair < int , int >
# define pll pair < ll , ll >
# define pld pair < ld , ld >
# define pDD pair < D , D >

# define vpld vector < pld >
# define vpii vector < pii >
# define vpll vector < pll >
# define vpDD vector < pDD >

# define vvpii vector < vector < pii > >
# define F first
# define S second
# define mp make_pair

# define dist(a,b,p,q) sqrt((p-a)*(p-a) + (q-b)*(q-b))

# define pp(n) printf("%.10Lf",n);
# define line cout<<"\n";
# define fast ios_base::sync_with_stdio(false) ; cin.tie(0) ; cout.tie(0);

string vow = "aeiou";
int month[] = {-1, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

const int dxhorse[] = {-2, -2, -1, -1, 1, 1, 2, 2};
const int dyhorse[] = {1, -1, 2, -2, 2, -2, 1, -1};

const int dx[] = { -1 , 0 , 1 , 0 } ;
const int dy[] = { 0 , 1 , 0 , -1 } ;

const ld pie = 3.1415926535897932384626 ;
const ll mod = 1e9 + 7 ;

/// Tip : If a and b are positive integers ; we may say - ceil (a/b) = 1 + floor ( (a-1)/b ) .

bool all_digits ( string &temp )
{
    for ( auto &i : temp )
    {
        int d = i - '0' ;
        if ( d >= 0 && d <= 9 ) C ;

        return false ;
    }

    int z = temp.size() ;

    if ( z == 0 )
        return false ;

    if ( z )
    {
        if ( temp[0] == '0' && z != 1 )
            return false ;
    }

    return true ;
}

void solve ( int test_case )
{
    string s ;
    cin >> s ;

    s += ';' ;

    int n = s.size() ;

    vs a , b ;
    string temp = "" ;

    for ( int i=0 ; i < n ; i ++ )
    {
        if ( s[i] == ',' || s[i] == ';' )
        {
            if ( all_digits ( temp ) && ((int)temp.size() != 0 ) )
                a.pb ( temp ) ;

            else
                b.pb ( temp ) ;

            temp = "" ;
        }

        else
        {
            temp += s[i] ;
        }
    }

    int z = a.size() ;

    if ( z == 0 )
    {
        cout << "-" ;
        line ;
    }

    else
    {
        cout << "\"" ;

        for ( int i=0 ; i < z - 1 ; i ++ )
        {
            cout << a[i] << "," ;
        }

        cout << a.back() ;
        cout << "\"" ;
        line ;
    }

    z = b.size() ;

    if ( z == 0 )
    {
        cout << "-" ;
        line ;
    }

    else
    {
        cout << "\"" ;

        for ( int i=0 ; i < z - 1 ; i ++ )
        {
            cout << b[i] << "," ;

        }

        cout << b.back() ;
        cout << "\"" ;

        line ;
    }

}

int main()
{fast
    int t = 1;
    // cin >> t;

    for ( int i=1 ; i <= t ; i ++ ) solve ( i ) ;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

# define C continue;
# define R return

# define D double
# define I insert
# define ll long long
# define ld long double

# define ull unsigned long long
# define ui unsigned int

# define pb push_back
# define pf push_front

# define vi vector < int >
# define vc vector < char >
# define vs vector < string >
# define vb vector < bool >
# define vd vector < D >
# define vll vector < ll >
# define vull vector < ull >
# define vld vector < ld >
# define PQ priority_queue

# define vvi vector < vector < int > >
# define vvb vector < vector < bool > >
# define vvc vector < vector < char > >
# define vvs vector < vs >
# define vvll vector < vector < ll > >
# define vvd vector < vector < D > >
# define vvld vector < vector < ld > >

# define all(v) (v).begin() , (v).end()
# define allrev(v) (v).rbegin() , (v).rend()
# define allcomp(v) v.begin() , v.end() , comp
# define allrevcomp(v) v.rbegin() , v.rend() , comp

# define pii pair < int , int >
# define pll pair < ll , ll >
# define pld pair < ld , ld >
# define pDD pair < D , D >

# define vpld vector < pld >
# define vpii vector < pii >
# define vpll vector < pll >
# define vpDD vector < pDD >

# define vvpii vector < vector < pii > >
# define F first
# define S second
# define mp make_pair

# define dist(a,b,p,q) sqrt((p-a)*(p-a) + (q-b)*(q-b))

# define pp(n) printf("%.10Lf",n);
# define line cout<<"\n";
# define fast ios_base::sync_with_stdio(false) ; cin.tie(0) ; cout.tie(0);

string vow = "aeiou";
int month[] = {-1, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

const int dxhorse[] = {-2, -2, -1, -1, 1, 1, 2, 2};
const int dyhorse[] = {1, -1, 2, -2, 2, -2, 1, -1};

const int dx[] = { -1 , 0 , 1 , 0 } ;
const int dy[] = { 0 , 1 , 0 , -1 } ;

const ld pie = 3.1415926535897932384626 ;
const ll mod = 1e9 + 7 ;

/// Tip : If a and b are positive integers ; we may say - ceil (a/b) = 1 + floor ( (a-1)/b ) .

bool all_digits ( string &temp )
{
    for ( auto &i : temp )
    {
        int d = i - '0' ;
        if ( d >= 0 && d <= 9 ) C ;

        return false ;
    }

    int z = temp.size() ;

    if ( z )
    {
        if ( temp[0] == '0' )
            return false ;
    }

    return true ;
}

void solve ( int test_case )
{
    string s ;
    cin >> s ;

    s += '.' ;

    int n = s.size() ;

    vs a , b ;
    string temp = "" ;

    for ( int i=0 ; i < n ; i ++ )
    {
        if ( s[i] == '.' || s[i] == ',' || s[i] == ';' )
        {
            if ( all_digits ( temp ) && ((int)temp.size() != 0 ) )
                a.pb ( temp ) ;

            else
                b.pb ( temp ) ;

            temp = "" ;
        }

        else
        {
            temp += s[i] ;
        }
    }

    int z = a.size() ;
    if ( z == 0 ) a.pb ( "-" ) ;

    z = b.size() ;
    if ( z == 0 ) b.pb ( "-" ) ;

    z = a.size() ;

    if ( z != 1 ) cout << "\"" ;
    for ( int  i=0 ; i < z - 1 ; i ++ )
    {
        cout << a[i] << "," ;
    }

    cout << a.back() ;
    if ( z != 1 ) cout << "\"" ;

    line ;

    z = b.size() ;
    if ( z != 1 ) cout << "\"" ;

    for ( int i=0 ; i < z - 1 ; i ++ )
    {
        cout << b[i] << "," ;
    }

    cout << b.back() ;
    if ( z != 1 ) cout << "\"" ;

    line ;
}

int main()
{fast
    int t = 1;
    // cin >> t;

    for ( int i=1 ; i <= t ; i ++ ) solve ( i ) ;
    return 0;
}


#include <iostream>
#include <bits/stdc++.h>
#include <cmath>
#define pb push_back
#define f(i,s,e) for(int i=s;i<e;i++)
using namespace std;
bool isnumber(string s){
	if(s=="")
		return false;
	f(i,0,s.length()){
		if(!(s[i]>='0' && s[i]<='9'))
			return false;
	}
	if(s[0]=='0' && s.length()!=1) return false;
	return true;

}
int main() {
	string s;
	cin>>s;
	string sep = {';',','};
	int n = s.length();
	vector <string> a,b;

	int prev=-1;
	f(i,0,n){
		if(s[i]==sep[0] || s[i] == sep[1]){
			string temp = s.substr(prev+1,i-prev-1);
			prev = i;
			//cout<<temp<<endl;
			if(isnumber(temp))
			a.pb(temp);
			else b.pb(temp);
		}
	}
	string temp = s.substr(prev+1,n-prev);
	//cout<<temp<<endl;

	if(isnumber(temp))
	a.pb(temp);
	else b.pb(temp);

	if(a.size()) cout<<"\"";
	if(a.size()) cout<<a[0];
	else cout<<"-";

	f(i,1,a.size()) cout<<","<<a[i];
	if(a.size()) cout<<"\"";
	cout<<endl;

	if(b.size()) cout<<"\"";
	if(b.size()) cout<<b[0];
	else cout<<"-";

	f(i,1,b.size()) cout<<","<<b[i];
	if(b.size()) cout<<"\"";
	cout<<endl;
	return 0;
}


#include <iostream>
#include <bits/stdc++.h>
#include <cmath>
#define pb push_back
#define f(i,s,e) for(int i=s;i<e;i++)
using namespace std;
bool isnumber(string s){
	if(s=="")
		return false;
	f(i,0,s.length()){
		if(!(s[i]>='0' && s[i]<='9'))
			return false;
	}
	if(s[0]=='0' && s.length()!=1) return false;
	return true;

}
int main() {
	string s;
	cin>>s;
	string sep = {';','.',','};
	int n = s.length();
	vector <string> a,b;

	int prev=-1;
	f(i,0,n){
		if(s[i]==sep[0] || s[i] == sep[1] || s[i] ==sep[2]){
			string temp = s.substr(prev+1,i-prev-1);
			prev = i;
			//cout<<temp<<endl;
			if(isnumber(temp))
			a.pb(temp);
			else b.pb(temp);
		}
	}
	string temp = s.substr(prev+1,n-prev);
	//cout<<temp<<endl;
	if(isnumber(temp))
	a.pb(temp);
	else b.pb(temp);
	if(a.size()) cout<<"\"";
	if(a.size()) cout<<a[0];
	else cout<<"-";
	f(i,1,a.size()) cout<<","<<a[i];
	if(a.size()) cout<<"\"";
	cout<<endl;
	if(b.size()) cout<<"\"";
	if(b.size()) cout<<b[0];
	else cout<<"-";
	f(i,1,b.size()) cout<<","<<b[i];
	if(b.size()) cout<<"\"";
	cout<<endl;
	return 0;
}


#include <iostream>
#include <bits/stdc++.h>
#include <cmath>
#define pb push_back
#define f(i,s,e) for(int i=s;i<e;i++)
using namespace std;
bool isnumber(string s){
	if(s=="")
		return false;
	f(i,0,s.length()){
		if(!(s[i]>='0' && s[i]<='9'))
			return false;
	}
	if(s[0]=='0' && s.length()!=1) return false;
	return true;

}
int main() {
	string s;
	cin>>s;
	string sep = {';','.',','};
	int n = s.length();
	vector <string> a,b;

	int prev=-1;
	f(i,0,n){
		if(s[i]==sep[0] || s[i] == sep[1] || s[i] ==sep[2]){
			string temp = s.substr(prev+1,i-prev-1);
			prev = i;
			//cout<<temp<<endl;
			if(isnumber(temp))
			a.pb(temp);
			else b.pb(temp);
		}
	}
	string temp = s.substr(prev+1,n-prev);
	//cout<<temp<<endl;
	if(isnumber(temp))
	a.pb(temp);
	else b.pb(temp);

	if(a.size()) cout<<a[0];
	else cout<<"-";
	f(i,1,a.size()) cout<<","<<a[i];
	cout<<endl;
	if(b.size()) cout<<b[0];
	else cout<<"-";
	f(i,1,b.size()) cout<<","<<b[i];
	cout<<endl;
	return 0;
}


#include<bits/stdc++.h>
   #include <ext/pb_ds/tree_policy.hpp>
    #include <ext/pb_ds/assoc_container.hpp>
    using namespace std;
    using namespace __gnu_pbds;

    #define mod 1000000007

    void __print(int x) {cerr << x;}
    void __print(long x) {cerr << x;}
    void __print(long long x) {cerr << x;}
    void __print(unsigned x) {cerr << x;}
    void __print(unsigned long x) {cerr << x;}
    void __print(unsigned long long x) {cerr << x;}
    void __print(float x) {cerr << x;}
    void __print(double x) {cerr << x;}
    void __print(long double x) {cerr << x;}
    void __print(char x) {cerr << '\'' << x << '\'';}
    void __print(const char *x) {cerr << '\"' << x << '\"';}
    void __print(const string &x) {cerr << '\"' << x << '\"';}
    void __print(bool x) {cerr << (x ? "true" : "false");}

    template<typename T, typename V>
    void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
    template<typename T>
    void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
    void _print() {cerr << "]\n";}
    template <typename T, typename... V>
    void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
    #ifndef ONLINE_JUDGE
    #define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
    #else
    #define debug(x...)
    #endif
    /// Debugging shits ends here...
    // templates
    /*#include<ext/pb_ds/assoc_container.hpp>
    #include<ext/pb_ds/tree_policy.hpp>
    using namespace __gnu_pbds;
    /*template <typename T>
    using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;*/

    /// Some frequent usable functions
    #define int                        long long
    void add(int &a,int b){a+=b;if(a>mod)a-=mod;}
    void sub(int &a,int b){a-=b;if(a<0)a+=mod;}
    void mul(int &a, int b) {a=1ll * a * b % mod;}
    template<typename T> T pow(T a,T b, long long m){T ans=1; while(b>0){ if(b%2==1) ans=(ans*a)%m; b/=2; a=(a*a)%m; } return ans%m; }
    // int powmod(int a,int b)
    // {int res = 1;while(b){if(b&1){res = (res * a)%mod;}b= b/2;a = (a*a)%mod;}return res;}
int _ceil(int, int);
int _floor(int a, int b) { return b < 0 ? _floor(-a, -b) : a < 0 ? -_ceil(-a, b) : a / b; }
int _ceil(int a, int b) { return b < 0 ? _ceil(-a, -b) : a < 0 ? -_floor(-a, b) : (a + b - 1) / b; }

    int gcd(int a, int b, int &x, int &y) {if (a == 0) {x = 0; y = 1;return b;
    }int x1, y1;int d = gcd(b%a, a, x1, y1); x = y1 - (b / a) * x1;y = x1;return d;}
    //int find(int v){return v==parent[v]?v:parent[v] = find(parent[v]);}
    // void merge(int i,int j)
    // {i = find(i);j = find(j);if(i == j)return;parent[parent[i]] = parent[j];cmp--;}

    // Directions.......
    /* int dx[] = {1,-1,0,0} , dy[] = {0,0,1,-1}; */ // 4 Direction
    /* int dx[] = {1,-1,0,0,1,1,-1,-1} , dy[] = {0,0,1,-1,1,-1,1,-1}; */ // 8 Direction
    /* int dx[] = {1,-1,1,-1,2,2,-2,-2} , dy[] = {2,2,-2,-2,1,-1,1,-1}; */ // Knight moves
    /* int dx[] = {2,-2,1,1,-1,-1} , dy[] = {0,0,1,-1,1,-1}; */ // Hexagonal Direction
    #define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
    #define sp(a , x) cout << fixed << setprecision(a) << x << endl;
    #define endl "\n"
    #define pb push_back
    #define pf push_front
    #define ub upper_bound
    #define lb lower_bound
    #define F first
    #define S second
    #define mset(a, b) memset(a, b, sizeof a)
    #define sz(x) ((ll)(x.size()))
    #define sqr(x) ((x) * (x))
    #define graph vector<int>
    #define vi vector<int>
    #define vvi vector<vector<int>>
    #define pi pair<int,int>
    #define all(c)                      c.begin() , c.end()
    #define rep(i,a) for(int i=0;i<a;i++)
    #define rrep(i,a,b) for(int i=a;i>=b;i--)
    #define iter(it,a) for(auto it=a.begin();it!=a.end();it++)
    #define PQP priority_queue<pi, vector<pi>, greater<pi>>
    #define PQI priority_queue<int, vector<int>, greater<int>>
    #define dbg debug
    #define inf (int)1e16
    const long double EPS = 0.0000000001;
    const long double PI = (acos(-1));

  /// define some data.......
const int N = 1e6+9;

int check(string s)
{
    int n = s.size();

  for(int i=0;i<n;i++)
  {
    if(!i && s[i]=='0')return 2;
    if(isdigit(s[i]))continue;
    return 2;
  }
  return 1;
}

  void solve()
 {
    string s;
    cin >> s;
    int n = s.size();
    string a="";
    string b="";
    for(int i=0,j=0;i<n;i=j)
    {
       if(s[i]==';' || s[i]==','){
         j++;
         continue;
       }
       while((j < n) && ((s[j]!=';') && (s[j]!=','))){
         j++;
       }
       string sub = s.substr(i, j-i);
        if(check(sub)==1){
          a=a+","+sub;
        }
        else{
          b=b+","+sub;
        }
    }

    a=a.size()>1?a.substr(1):"";
    b=b.size()>1?b.substr(1):"";
    cout<<"\""<<a<<"\""<<"\n"<<"\""<<b<<"\""<<"\n";
 }

   int32_t main()
   {

     fast;
     int test =1;
     //cin >> test;
     while(test--)
     {
        solve();
     }

    }


#include<bits/stdc++.h>
   #include <ext/pb_ds/tree_policy.hpp>
    #include <ext/pb_ds/assoc_container.hpp>
    using namespace std;
    using namespace __gnu_pbds;

    #define mod 1000000007

    void __print(int x) {cerr << x;}
    void __print(long x) {cerr << x;}
    void __print(long long x) {cerr << x;}
    void __print(unsigned x) {cerr << x;}
    void __print(unsigned long x) {cerr << x;}
    void __print(unsigned long long x) {cerr << x;}
    void __print(float x) {cerr << x;}
    void __print(double x) {cerr << x;}
    void __print(long double x) {cerr << x;}
    void __print(char x) {cerr << '\'' << x << '\'';}
    void __print(const char *x) {cerr << '\"' << x << '\"';}
    void __print(const string &x) {cerr << '\"' << x << '\"';}
    void __print(bool x) {cerr << (x ? "true" : "false");}

    template<typename T, typename V>
    void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
    template<typename T>
    void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
    void _print() {cerr << "]\n";}
    template <typename T, typename... V>
    void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
    #ifndef ONLINE_JUDGE
    #define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
    #else
    #define debug(x...)
    #endif
    /// Debugging shits ends here...
    // templates
    /*#include<ext/pb_ds/assoc_container.hpp>
    #include<ext/pb_ds/tree_policy.hpp>
    using namespace __gnu_pbds;
    /*template <typename T>
    using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;*/

    /// Some frequent usable functions
    #define int                        long long
    void add(int &a,int b){a+=b;if(a>mod)a-=mod;}
    void sub(int &a,int b){a-=b;if(a<0)a+=mod;}
    void mul(int &a, int b) {a=1ll * a * b % mod;}
    template<typename T> T pow(T a,T b, long long m){T ans=1; while(b>0){ if(b%2==1) ans=(ans*a)%m; b/=2; a=(a*a)%m; } return ans%m; }
    // int powmod(int a,int b)
    // {int res = 1;while(b){if(b&1){res = (res * a)%mod;}b= b/2;a = (a*a)%mod;}return res;}
int _ceil(int, int);
int _floor(int a, int b) { return b < 0 ? _floor(-a, -b) : a < 0 ? -_ceil(-a, b) : a / b; }
int _ceil(int a, int b) { return b < 0 ? _ceil(-a, -b) : a < 0 ? -_floor(-a, b) : (a + b - 1) / b; }

    int gcd(int a, int b, int &x, int &y) {if (a == 0) {x = 0; y = 1;return b;
    }int x1, y1;int d = gcd(b%a, a, x1, y1); x = y1 - (b / a) * x1;y = x1;return d;}
    //int find(int v){return v==parent[v]?v:parent[v] = find(parent[v]);}
    // void merge(int i,int j)
    // {i = find(i);j = find(j);if(i == j)return;parent[parent[i]] = parent[j];cmp--;}

    // Directions.......
    /* int dx[] = {1,-1,0,0} , dy[] = {0,0,1,-1}; */ // 4 Direction
    /* int dx[] = {1,-1,0,0,1,1,-1,-1} , dy[] = {0,0,1,-1,1,-1,1,-1}; */ // 8 Direction
    /* int dx[] = {1,-1,1,-1,2,2,-2,-2} , dy[] = {2,2,-2,-2,1,-1,1,-1}; */ // Knight moves
    /* int dx[] = {2,-2,1,1,-1,-1} , dy[] = {0,0,1,-1,1,-1}; */ // Hexagonal Direction
    #define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
    #define sp(a , x) cout << fixed << setprecision(a) << x << endl;
    #define endl "\n"
    #define pb push_back
    #define pf push_front
    #define ub upper_bound
    #define lb lower_bound
    #define F first
    #define S second
    #define mset(a, b) memset(a, b, sizeof a)
    #define sz(x) ((ll)(x.size()))
    #define sqr(x) ((x) * (x))
    #define graph vector<int>
    #define vi vector<int>
    #define vvi vector<vector<int>>
    #define pi pair<int,int>
    #define all(c)                      c.begin() , c.end()
    #define rep(i,a) for(int i=0;i<a;i++)
    #define rrep(i,a,b) for(int i=a;i>=b;i--)
    #define iter(it,a) for(auto it=a.begin();it!=a.end();it++)
    #define PQP priority_queue<pi, vector<pi>, greater<pi>>
    #define PQI priority_queue<int, vector<int>, greater<int>>
    #define dbg debug
    #define inf (int)1e16
    const long double EPS = 0.0000000001;
    const long double PI = (acos(-1));

  /// define some data.......
const int N = 1e6+9;

int check(string s)
{
    int n = s.size();
    if(!n)return 2;
    if(n==1 && s[0]=='0'){
           return 1;
    }

  for(int i=0;i<n;i++)
  {
    if(!i && s[i]=='0')return 2;
    if(isdigit(s[i]))continue;
    return 2;
  }
  return 1;
}

  void solve()
 {
    string s;
    cin >> s;
    int n = s.size();
    string a="";
    string b="";
    for(int i=0,j=0;i<n;i=j)
    {
       while((j < n) && ((s[j]!=';') && (s[j]!=','))){
         j++;
       }
       string sub = s.substr(i, j-i);
        if(check(sub)==1){
          a=a+","+sub;
        }
        else{
          b=b+","+sub;
        }
        j++;
    }

    a=a.size()>1?a.substr(1):"";
    b=b.size()>1?b.substr(1):"";
    cout<<"\""<<a<<"\""<<"\n"<<"\""<<b<<"\""<<"\n";
 }

   int32_t main()
   {

     fast;
     int test =1;
     //cin >> test;
     while(test--)
     {
        solve();
     }

    }