You are given string s. Let's call word any largest sequence of consecutive symbols without symbols ',' (comma) and ';' (semicolon). For example, there are four words in string "aba,123;1a;0": "aba", "123", "1a", "0". A word can be empty: for example, the string s=";;" contains three empty words separated by ';'.

You should find all words in the given string that are nonnegative INTEGER numbers without leading zeroes and build by them new string a. String a should contain all words that are numbers separating them by ',' (the order of numbers should remain the same as in the string s). By all other words you should build string b in the same way (the order of numbers should remain the same as in the string s).

Here strings "101", "0" are INTEGER numbers, but "01" and "1.0" are not.

For example, for the string aba,123;1a;0 the string a would be equal to "123,0" and string b would be equal to "aba,1a".


-----Input-----

The only line of input contains the string s (1 ≤ |s| ≤ 10^5). The string contains only symbols '.' (ASCII 46), ',' (ASCII 44), ';' (ASCII 59), digits, lowercase and uppercase latin letters.


-----Output-----

Print the string a to the first line and string b to the second line. Each string should be surrounded by quotes (ASCII 34).

If there are no words that are numbers print dash (ASCII 45) on the first line. If all words are numbers print dash on the second line.


-----Examples-----
Input
aba,123;1a;0

Output
"123,0"
"aba,1a"

Input
1;;01,a0,

Output
"1"
",01,a0,"

Input
1

Output
"1"
-

Input
a

Output
-
"a"



-----Note-----

In the second example the string s contains five words: "1", "", "01", "a0", "".

Source: codeforces | Difficulty: MEDIUM_HARD
Tags: String algorithms

Implementation


Solutions:
def is_int(x):
	if len(x) <= 0:
		return False
	return x == '0' or (all((c in '0123456789' for c in x)) and x[0] != '0')

def main():
	s = input()
	cur = []
	words = []
	for c in s:
		if c == ',' or c == ';':
			words.append(''.join(cur))
			cur = []
		else:
			cur.append(c)
	words.append(''.join(cur))
	a = []
	b = []
	for w in words:
		if is_int(w):
			a.append(w)
		else:
			b.append(w)
	if a:
		print('"{}"'.format(','.join(a)))
	else:
		print('-')
	if b:
		print('"{}"'.format(','.join(b)))
	else:
		print('-')
main()


import re
s = input()
s = re.split(',|;', s)
a = []
b = []
for i in s:
	try:
		if str(int(i)) == i:
			a.append(i)
		else:
			b.append(i)
	except ValueError:
		b.append(i)
if len(a) == 0:
	print('-')
else:
	print('"{}'.format(a[0]), end='')
	for i in a[1:]:
		print(',{}'.format(i), end='')
	print('"')
if len(b) == 0:
	print('-')
else:
	print('"{}'.format(b[0]), end='')
	for i in b[1:]:
		print(',{}'.format(i), end='')
	print('"')


inp = input()
inp = inp.replace(',', ';')
tokens = inp.split(';')
a = []
b = []
for token in tokens:
	if token.isdigit() and token[0] != '0' or token == '0':
		a.append(token)
	else:
		b.append(token)
if len(a) is 0:
	print('-')
else:
	print('"' + ','.join(a) + '"')
if len(b) is 0:
	print('-')
else:
	print('"' + ','.join(b) + '"')


import re
s = input()
t = re.split('[,;]', s)
a = [ti for ti in t if re.fullmatch('0|[1-9]\\d*', ti)]
b = [ti for ti in t if not re.fullmatch('0|[1-9]\\d*', ti)]
print('"' + ','.join(a) + '"' if a else '-')
print('"' + ','.join(b) + '"' if b else '-')


import re
S = input()
S = S.replace(';', ',').split(',')
a = []
b = []
for s in S:
	if re.fullmatch('0|([1-9][0-9]*)', s):
		a.append(s)
	else:
		b.append(s)
print('"{}"'.format(','.join(a)) if len(a) > 0 else '-')
print('"{}"'.format(','.join(b)) if len(b) > 0 else '-')


a = input()
words = a.replace(',', ';').split(';')
numbers = []
strings = []
for word in words:
	if not word:
		strings.append(word)
	elif (word[0] == '0') & (len(word) >= 2):
		strings.append(word)
	elif word.isnumeric():
		numbers.append(word)
	else:
		strings.append(word)
if not numbers:
	print('-')
	print('"', ','.join(strings), '"', sep='')
elif not strings:
	print('"', ','.join(numbers), '"', sep='')
	print('-')
else:
	print('"', ','.join(numbers), '"', sep='')
	print('"', ','.join(strings), '"', sep='')


import re
a = input().replace(',', ';').split(';')
dd = []
ss = []
for s in a:
	if re.match('^\\d+$', s) and (not (len(s) > 1 and s[0] == '0')):
		dd.append(s)
	else:
		ss.append(s)
print('"%s"' % ','.join(dd) if len(dd) > 0 else '-')
print('"%s"' % ','.join(ss) if len(ss) > 0 else '-')


s = input()
s += ';'
(a, b) = ([], [])
w = ''
for c in s:
	if c not in ',;':
		w += c
	else:
		if w.isdigit() and (not (w[0] == '0' and len(w) > 1)):
			a.append(w)
		else:
			b.append(w)
		w = ''
for words in (a, b):
	if not words:
		print('-')
	else:
		print('"' + ','.join(words) + '"')


inp = input().split(',')
arr = []
for c in inp:
	arr += c.split(';')
a = ''
b = ''
for s in arr:
	try:
		int(s)
		if s[0] == '0' and s != '0':
			1 / 0
		a += s + ','
	except:
		b += s + ','
if len(a):
	a = a[:len(a) - 1]
	print('"' + a + '"')
else:
	print('-')
if len(b):
	b = b[:len(b) - 1]
	print('"' + b + '"')
else:
	print('-')


__author__ = 'sandeepmellacheruvu'
import re

def isNum(word):
	if re.match('^[1-9][0-9]*$', word):
		return True
	elif len(word) == 1 and word[0] == '0':
		return True
	else:
		return False
wordsStr = input()
words = re.split('[;,]', wordsStr)
nums = []
others = []
for i in range(len(words)):
	if isNum(words[i]):
		nums.append(words[i])
	else:
		others.append(words[i])
n = ','.join(nums)
o = ','.join(others)
n = '"' + n + '"'
o = '"' + o + '"'
if len(nums) == 0:
	print('-')
else:
	print(n)
if len(others) == 0:
	print('-')
else:
	print(o)


n = input().split(';')
s = [y for x in n for y in x.split(',')]
numbers = []
strings = []
for i in range(len(s)):
	isNumber = True
	isString = True
	if s[i] == '' or (s[i][0] == '0' and len(s[i]) > 1):
		isNumber = False
	for j in range(len(s[i])):
		if not '0' <= s[i][j] <= '9':
			isNumber = False
	if isNumber:
		numbers.append(s[i])
	else:
		strings.append(s[i])
if numbers == []:
	print('-')
else:
	print('"', ','.join(numbers), '"', sep='')
if strings == []:
	print('-')
else:
	print('"', ','.join(strings), '"', sep='')


import sys
s = input()
z = []
pp = ''
for i in s:
	if i == ';' or i == ',':
		z.append(pp)
		pp = ''
	else:
		pp += i
if s[-1] == ';' or s[-1] == ',':
	z.append('')
else:
	z.append(pp)
numb = []
words = []
for i in z:
	flag = 1
	for j in i:
		if '0' <= j <= '9':
			pass
		else:
			flag = 0
			break
	if flag == 0 or i == '' or (i != '0' and i[0] == '0'):
		words.append(i)
	else:
		numb.append(i)
if numb:
	print('"', end='')
	print(*numb, sep=',', end='')
	print('"')
else:
	print('-')
if words:
	print('"', end='')
	print(*words, sep=',', end='')
	print('"')
else:
	print('-')


def main():
	s = input()
	s1 = ''
	s2 = ''
	strings = s.replace(';', ',').split(sep=',')
	for strng in strings:
		if strng.isnumeric() and (len(strng) > 1 and strng[0] != '0' or len(strng) == 1):
			s1 = s1 + strng + ','
		else:
			s2 = s2 + strng + ','
	if not s1:
		s1 = '-'
	if not s2:
		s2 = '-'
	if s1 != '-':
		s1 = '"' + s1[:len(s1) - 1] + '"'
	if s2 != '-':
		s2 = '"' + s2[:len(s2) - 1] + '"'
	print(s1)
	print(s2)
main()


from collections import *
from math import *
import re
s = input()
s = s.replace(';', ',')
l = list(s.split(','))
a = []
b = []
for i in l:
	if i.isdigit() == True:
		if len(i) > 1 and i[0] == '0':
			b.append(i)
		else:
			a.append(i)
	else:
		b.append(i)
if a == []:
	print('-')
else:
	print('"' + ','.join(a) + '"')
if b == []:
	print('-')
else:
	print('"' + ','.join(b) + '"')


import re
p = input()
z = re.split('[,;]', p)
intlist = []
charlist = []
for i in z:
	if not i:
		charlist.append('$')
	elif '.' in i:
		charlist.append(i)
	else:
		t = re.findall('[a-zA-Z]', i)
		if t:
			charlist.append(i)
		elif i[0] == '0' and len(i) > 1:
			charlist.append(i)
		else:
			intlist.append(i)
if intlist:
	print('"' + ','.join(intlist).replace('$', '') + '"')
else:
	print(chr(45))
if charlist:
	print('"' + ','.join(charlist).replace('$', '') + '"')
else:
	print(chr(45))


import re
S = re.split('[,;]', input())
A = []
B = []
for s in S:
	if s.isdecimal() and (not (s[0] == '0' and len(s) > 1)):
		A.append(s)
	else:
		B.append(s)
print('"' + ','.join(A) + '"' if A else '-')
print('"' + ','.join(B) + '"' if B else '-')


l = input()
e = l.split(',')
for i in range(len(e)):
	e[i] = e[i].split(';')
M = []
M2 = []
for i in e:
	for j in i:
		if j.isnumeric() and (not (len(j) > 1 and j[0] == '0')):
			M.append(j)
		else:
			M2.append(j)
ans = '"'
for i in M:
	ans += i + ','
ans = ans[:-1] + '"'
if len(M) == 0:
	print('-')
else:
	print(ans)
ans = ''
ans += '"'
for i in M2:
	ans += i + ','
ans = ans[:-1] + '"'
if len(M2) == 0:
	print('-')
else:
	print(ans)


s = input()
s = s.replace(';', ',').split(',')
ints = []
other = []
for f in s:
	if f.isdigit() and str(int(f)) == f:
		ints.append(f)
	else:
		other.append(f)
if not ints:
	print('-')
else:
	print('"{}"'.format(str.join(',', ints)))
if not other:
	print('-')
else:
	print('"{}"'.format(str.join(',', other)))


s = input()
f = ''
num = 0
(a, b) = ([], [])
for i in range(len(s)):
	if s[i] in ',;' and (num == 2 or num == 0):
		b.append(f)
		f = ''
		num = 0
	elif s[i] in ',;' and num == 1:
		a.append(f)
		f = ''
		num = 0
	elif s[i] in '123456789' and (num == 0 or num == 1):
		num = 1
		f += s[i]
	elif s[i] in '0123456789' and (f or (s[i] != s[-1] and s[i + 1] in ',;') or i == len(s) - 1) and (num == 0 or num == 1):
		f += s[i]
		num = 1
	else:
		f += s[i]
		num = 2
if num == 2 or num == 0:
	b.append(f)
else:
	a.append(f)
if a:
	print('"' + ','.join(a) + '"')
else:
	print('-')
if b:
	print('"' + ','.join(b) + '"')
else:
	print('-')


s = input()
s = s.replace(',', ';')
s = s.split(';')
(ans1, ans2) = ([], [])
for elem in s:
	if len(elem) > 0:
		if elem == '0' or elem[0] != '0':
			try:
				x = int(elem)
				ans1.append(x)
			except:
				ans2.append(elem)
		else:
			ans2 += [elem]
	else:
		ans2 += ['']
if ans1:
	print('"', end='')
	print(*ans1, sep=',', end='"\n')
else:
	print('-')
if ans2:
	print('"', end='')
	print(*ans2, sep=',', end='"\n')
else:
	print('-')


import re

def solve(s):

	def is_int(w):
		return w and all((c.isdigit() for c in w)) and (str(int(w)) == w)
	words = re.split('[,;]', s)
	ints = [w for w in words if is_int(w)]
	rest = [w for w in words if not is_int(w)]
	if not ints:
		ints = None
	if not rest:
		rest = None
	return (ints, rest)

def main():
	s = input().strip()
	results = solve(s)
	for res in results:
		if res is None:
			print('-')
		else:
			print('"%s"' % ','.join(res))
main()


import sys
for line in sys.stdin:
	line = line[:-1]
	a = []
	b = []
	firstChar = True
	isNum = False
	e = ''
	line += ';'
	for c in line:
		if c == ';' or c == ',':
			if len(e) > 0 and e[0] != '0' and all([i in '0123456789' for i in e]) or e == '0':
				a.append(e)
			else:
				b.append(e)
			e = ''
			continue
		e += c
	if a == []:
		a = '-'
	else:
		a = '"' + ','.join(a) + '"'
	if b == []:
		b = '-'
	else:
		b = '"' + ','.join(b) + '"'
	print(a)
	print(b)


t = input().replace(';', ',').split(',')
d = [[], []]
for q in t:
	d[not q.isdigit() or str(int(q)) != q].append(q)
for s in d:
	print('"' + ','.join(s) + '"' if s else '-')


def isnum(a):
	nums = list(map(str, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]))
	res = True
	for sym in a:
		if sym not in nums:
			res = False
	if len(a) > 1 and a[0] == '0':
		res = False
	if not a:
		res = False
	return res
a = input()
a = a.replace(';', ',')
a = a.split(',')
a1 = []
a2 = []
for elem in a:
	if isnum(elem):
		a1.append(elem)
	else:
		a2.append(elem)
if not a1:
	print('-')
else:
	print('"' + ','.join(a1) + '"')
if not a2:
	print('-')
else:
	print('"' + ','.join(a2) + '"')


def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return list(mi())
s = input()
s = s.replace(';', ',')
li = s.split(',')
A = []
B = []

def RepresentsInt(s):
	try:
		int(s)
		return True
	except ValueError:
		return False
for str in li:
	if RepresentsInt(str) and (not (str.startswith('0') and len(str) > 1)):
		A.append(str)
	else:
		B.append(str)
if len(A) > 0:
	print('"', end='')
	print(*A, sep=',', end='')
	print('"', end='')
else:
	print('-', end='')
print()
if len(B) > 0:
	print('"', end='')
	print(*B, sep=',', end='')
	print('"', end='')
else:
	print('-', end='')


import re

def is_int(s):
	if len(s) == 0:
		return False
	if s == '0':
		return True
	num = False
	for c in s:
		if c is '0' and (not num):
			return False
		elif ord(c) < ord('0') or ord(c) > ord('9'):
			return False
		else:
			num = True
	return True
string = input()
ans = re.split(';|,', string)
ansi = []
anss = []
for a in ans:
	if is_int(a):
		ansi.append(a)
	else:
		anss.append(a)
if len(ansi):
	print('"', end='')
	print(','.join(ansi), end='')
	print('"')
else:
	print('-')
if len(anss):
	print('"', end='')
	print(','.join(anss), end='')
	print('"')
else:
	print('-')


data = input().strip().replace(',', ';').split(';')
l1 = [word for word in data if word.isdigit() and word == str(int(word))]
sl1 = set(l1)
l2 = [word for word in data if word not in sl1]
print('"' + ','.join(l1) + '"' if len(l1) > 0 else '-')
print('"' + ','.join(l2) + '"' if len(l2) > 0 else '-')


st = list(input())
null = False
number = True
s = ''
a = ''
b = ''
new = True
for z in st:
	if z == '0' and (not null) and new:
		null = True
		new = False
		s += '0'
	elif z in ',;' and null:
		null = False
		a += '0,'
		s = ''
		new = True
	elif null:
		number = False
		null = False
		s += z
	elif z in ',;' and new:
		b += ','
	elif z in ',;':
		if number and s != '':
			a += s + ','
			s = ''
		else:
			b += s + ','
			s = ''
		number = True
		new = True
	elif z in '123456789' and new:
		s += z
		new = False
	elif z in '1234567890':
		s += z
		if null:
			null = False
			number = False
	elif z in 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz.':
		s += z
		new = False
		number = False
if null:
	a += '0,'
elif number and s != '':
	a += s + ','
else:
	b += s + ','
if a == '':
	print('-')
else:
	print('"' + a[:-1] + '"')
if b == '':
	print('-')
else:
	print('"' + b[:-1] + '"')


s = input()
cur = ''
num_s = ''
anum_s = ''
num = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'}

def isnumber(cur):
	if cur == '':
		return False
	if cur[0] == '0':
		if len(cur) == 1:
			return True
		else:
			return False
	for i in range(len(cur)):
		if not cur[i] in num:
			return False
	return True
for i in range(len(s)):
	if s[i] == ',' or s[i] == ';':
		if isnumber(cur):
			num_s += ',' + cur
		else:
			anum_s += ',' + cur
		cur = ''
	else:
		cur += s[i]
if isnumber(cur):
	num_s += ',' + cur
else:
	anum_s += ',' + cur
if num_s == '':
	print('-')
else:
	print('"', num_s[1:len(num_s)], '"', sep='')
if anum_s == '':
	print('-')
else:
	print('"', anum_s[1:len(anum_s)], '"', sep='')


l = input()
l = l.replace(';', ',')
l = l.split(',')
a = []
b = []
for i in l:
	if len(i) > 1 and i[0] == '0':
		b.append(i)
	elif '.' in i:
		b.append(i)
	else:
		try:
			i = int(i)
			a.append(i)
		except ValueError:
			b.append(i)
z = 0
for i in a:
	a[z] = str(i)
	z += 1
if len(a) == 0:
	print('-')
else:
	print('"' + str(','.join(a)) + '"')
if len(b) == 0:
	print('-')
else:
	print('"' + str(','.join(b)) + '"')


s = input().replace(';', ',').split(',')
a = []
b = []
for w in s:
	if w.isdigit() and (w == '0' or w[0] != '0'):
		a.append(w)
	else:
		b.append(w)
for v in (a, b):
	print('"{}"'.format(','.join(v)) if v else '-')


s = input().replace(';', ',').split(',')
a = []
b = []
for ch in s:
	try:
		if len(ch) > 1 and ch[0] == '0':
			b.append(ch)
		elif int(ch) >= 0:
			a.append(int(ch))
		else:
			b.append(ch)
	except ValueError:
		b.append(ch)
		pass
if len(a) > 0:
	print('"', end='')
	i = -1
	for i in range(len(a) - 1):
		print(str(a[i]) + ',', end='')
	print(str(a[i + 1]) + '"')
else:
	print('-')
if len(b) > 0:
	i = -1
	print('"', end='')
	for i in range(len(b) - 1):
		print(str(b[i]) + ',', end='')
	print(str(b[i + 1]) + '"')
else:
	print('-')


n = input()
n = n.replace(';', ',')
n = n.split(',')
a = []
b = []
for i in n:
	try:
		x = int(i)
		x = str(x)
		if x == i:
			a.append(i)
		else:
			b.append(i)
	except ValueError:
		b.append(i)
if len(a) == 0:
	print('-')
else:
	print('"', end='')
	for i in range(len(a) - 1):
		print('{},'.format(a[i]), end='')
	print(a[len(a) - 1], end='')
	print('"')
if len(b) == 0:
	print('-')
else:
	print('"', end='')
	for i in range(len(b) - 1):
		print('{},'.format(b[i]), end='')
	print(b[len(b) - 1], end='')
	print('"')


words = input().replace(';', ',').split(',')
ints = [word for word in words if word.isdigit() and (word[0] != '0' or len(word) == 1)]
non_ints = [i for i in words if i not in ints]
print('"' + ','.join(ints) + '"' if len(ints) != 0 else '-')
print('"' + ','.join(non_ints) + '"' if len(non_ints) else '-')


s = input()
L = [r for d in s.split(',') for r in d.split(';') if len(r) > 0 and r.isdigit() and (r[0] != '0') or r == '0']
SL = set(L)
s1 = ','.join(L)
print('"' + s1 + '"' if s1 != '' else '-')
LL = [r for d in s.split(',') for r in d.split(';') if not r in SL]
s2 = ','.join(LL)
print('"' + s2 + '"' if len(LL) > 0 else '-')


import sys
import re
input = sys.stdin.readline
s = re.split('[,;]', input().rstrip())
l = list('0123456789')
a = []
b = []
for t in s:
	if len(t) == 0:
		b.append(t)
	elif len(t) >= 2 and t[0] == '0':
		b.append(t)
	else:
		for j in range(len(t)):
			if not t[j] in l:
				b.append(t)
				break
		else:
			a.append(t)
if len(a) == 0:
	print('-')
else:
	print('"' + ','.join(a) + '"')
if len(b) == 0:
	print('-')
else:
	print('"' + ','.join(b) + '"')


import re
txt = input()
L = re.split('[,|;]', txt)
one = list()
two = list()
for each in L:
	try:
		num = int(each)
		if len(each) >= 2 and each[0] == '0' or each[0] == '-':
			two.append(each)
		else:
			one.append(each)
	except Exception as error:
		two.append(each)
if len(one) == 0:
	print('-')
else:
	print('"' + ','.join(one) + '"')
if len(two) == 0:
	print('-')
else:
	print('"' + ','.join(two) + '"')


s = input()
a1 = s.split(';')
b1 = []
for i in range(len(a1)):
	b1 += a1[i].split(',')
a = ''
b = ''
for x in b1:
	if x.isdigit():
		if x[0] == '0' and len(x) > 1:
			b += ',' + x
		else:
			a += ',' + x
	else:
		b += ',' + x
if len(a) == 0:
	a = '-'
else:
	a = '"' + a[1:]
	a += '"'
if len(b) == 0:
	b = '-'
else:
	b = '"' + b[1:]
	b += '"'
print(a, b, sep='\n')


import sys
s = input()
a = ''
b = ''
cur = ''
first_a = True
first_b = True

def integer(str):
	if str == '':
		return False
	if str == '0':
		return True
	if str.isdigit() and (not str.startswith('0')):
		return True
	return False

def process(cur, a, b, first_a, first_b):
	if integer(cur):
		if not first_a:
			a += ','
		a += str(cur)
		first_a = False
	else:
		if not first_b:
			b += ','
		b += str(cur)
		first_b = False
	return (a, b, first_a, first_b)
for c in s:
	if c == ',' or c == ';':
		(a, b, first_a, first_b) = process(cur, a, b, first_a, first_b)
		cur = ''
	else:
		cur += str(c)
(a, b, first_a, first_b) = process(cur, a, b, first_a, first_b)
print('"' + a + '"' if a != '' or not first_a else '-')
print('"' + b + '"' if b != '' or not first_b else '-')


s1 = input()
s1 = s1.replace(';', ' ')
s1 = s1.replace(',', ' ')
s = s1.split(' ')
a = []
b = []
for i in s:
	if i.isdigit() and i[0] != '0' or i == '0':
		a.append(i)
	else:
		b.append(i)
if len(a) == 0:
	print('-')
else:
	print('"' + ','.join(a) + '"')
if len(b) == 0:
	print('-')
else:
	print('"' + ','.join(b) + '"')


import re
s = re.split(',|;', input())
pattern = '([1-9][0-9]*)|(0)'
regex = re.compile(pattern)
a = []
b = []
for i in s:
	m = regex.match(i)
	if len(i) == 0 or m == None or i[m.start():m.end()] != i:
		b.append(i)
	else:
		a.append(i)
if len(a) == 0:
	a = '-'
else:
	a = '"' + ','.join(a) + '"'
if len(b) == 0:
	b = '-'
else:
	b = '"' + ','.join(b) + '"'
print(a)
print(b)


import sys
input = sys.stdin.readline
number = []
word = []
temp = []
period = 0
bad = 0
for i in input().strip() + ',':
	if i in ',;':
		if period or bad:
			word.append(''.join(temp))
		elif len(temp) == 0:
			word.append('')
		elif temp[0] == '0':
			if len(temp) == 1 or temp[1] == '.':
				number.append(''.join(temp))
			else:
				word.append(''.join(temp))
		else:
			number.append(''.join(temp))
		temp = []
		period = 0
		bad = 0
	else:
		if i == '.':
			period += 1
		elif i not in '.0123456789':
			bad += 1
		temp.append(i)
if len(number):
	print('"%s"' % ','.join(number))
else:
	print('-')
if len(word):
	print('"%s"' % ','.join(word))
else:
	print('-')


def main():
	nw = ([], [])
	for s in input().replace(';', ',').split(','):
		nw[s.isdigit() and (s[0] != '0' or s == '0')].append(s)
	for l in nw[::-1]:
		print('"%s"' % ','.join(l) if l else '-')
main()


(a, b) = ([], [])
for w in input().replace(';', ',').split(','):
	if str.isdigit(w) and (len(w) == 1 or w[0] != '0'):
		a.append(w)
	else:
		b.append(w)
for l in (a, b):
	print('"' + ','.join(l) + '"' if l else '-')


def isgood(s):
	if s == '0':
		return True
	if s.isdigit() and s[0] != '0':
		return True
	return False

def fun():
	s = input()
	a_list = []
	b_list = []
	items = [item.split(',') for item in s.split(';')]
	for item in items:
		if not isinstance(item, list):
			if isgood(item):
				a_list.append(item)
			else:
				b_list.append(item)
		else:
			for word in item:
				if isgood(word):
					a_list.append(word)
				else:
					b_list.append(word)
	if len(a_list) == 0:
		a = '-'
	else:
		a = ','.join(a_list)
	if len(b_list) == 0:
		b = '-'
	else:
		b = ','.join(b_list)
	if a != '-':
		a = '"' + a + '"'
	if b != '-':
		b = '"' + b + '"'
	print(a)
	print(b)
fun()


a = input()
a = a.replace(';', ',').split(',')
b = []
c = []
for str in a:
	if str.isdigit() and (str[0] != '0' or str == '0'):
		b.append(str)
	else:
		c.append(str)
s = '"'
if len(b) > 0:
	for i in b:
		s = s + i + ','
	s = s[:-1] + '"'
	print(s)
else:
	print('-')
s = '"'
if len(c) > 0:
	for i in c:
		s = s + i + ','
	s = s[:-1] + '"'
	print(s)
else:
	print('-')


import re
x = input()
array = []
array2 = []
for i in re.split(',|;', x):
	if i == '0':
		array.append(i)
	elif i.isdigit() and i[0] != '0':
		array.append(i)
	else:
		array2.append(i)
	x = ''
	y = ''
if not array:
	print('-')
else:
	for i in range(len(array)):
		if i == len(array) - 1:
			y += array[i]
		else:
			y += array[i] + ','
	print('"{}"'.format(y))
if not array2:
	print('-')
else:
	for i in range(len(array2)):
		if i == len(array2) - 1:
			x += array2[i]
		else:
			x += array2[i] + ','
	print('"{}"'.format(x))


import re
s = input()
res = re.split(',|;', s)
first = ''
sec = ''
for i in res:
	if re.search('[a-zA-Z]', i):
		sec += i + ','
	elif re.search('\\.', i):
		sec += i + ','
	elif len(i) == 0:
		sec += ','
	if i.isdecimal():
		if len(i) > 1 and i[0] == '0':
			sec += i + ','
		else:
			first += i + ','
first = first[:-1]
sec = sec[:-1]
first = '"' + first + '"'
sec = '"' + sec + '"'
print(first if first != '""' else '-')
print(sec if sec != '""' or res[-1] == '' or res[0] == '' else '-')


import re

def isInteger(s, p):
	if p.match(s):
		return True
	return False
s = input().strip()
a = []
b = []
integerRE = re.compile('((\\d)|([1-9](\\d+)))$')
words = s.split(sep=',')
for awords in words:
	awords = awords.split(sep=';')
	for word in awords:
		if isInteger(word, integerRE):
			a.append(word)
		else:
			b.append(word)
if len(a) == 0:
	print('-')
else:
	print('"' + ','.join(a) + '"')
if len(b) == 0:
	print('-')
else:
	print('"' + ','.join(b) + '"')


s = input() + ';'
a = ''
b = ''
tmp = ''
for i in range(len(s)):
	if ord(s[i]) != 44 and ord(s[i]) != 59:
		tmp = tmp + s[i]
	elif len(tmp) != 0:
		k = 1
		if tmp[0] == '0' and len(tmp) != 1:
			b += tmp + ','
		else:
			for j in range(0, len(tmp)):
				if ord(tmp[j]) < 48 or ord(tmp[j]) > 57:
					k = 0
					break
			if k == 1:
				a += tmp + ','
			else:
				b += tmp + ','
		tmp = ''
	else:
		b += ','
if len(a) != 0:
	print('"' + a[:len(a) - 1] + '"')
else:
	print('-')
if len(b) != 0:
	print('"' + b[:len(b) - 1] + '"')
else:
	print('-')


import re
a = []
b = []
for x in re.split(',|;', input()):
	if x == '0':
		a.append(x)
	elif x and x[0] != '0' and x.isdigit():
		a.append(x)
	else:
		b.append(x)
if not a:
	print('-')
else:
	print('"' + ','.join(a) + '"')
if not b:
	print('-')
else:
	print('"' + ','.join(b) + '"')


a = input()
a = a.split(';')
for i in range(len(a)):
	a[i] = a[i].split(',')
ints = []
nonints = []
for i in a:
	for j in i:
		try:
			if j.isdigit() and j[0] != '0':
				ints.append(j)
			elif j == '0':
				ints.append(j)
			else:
				nonints.append(j)
		except ValueError:
			nonints.append(j)
b = ''
for i in ints:
	b += i + ','
b = b[:-1]
c = ''
for i in nonints:
	c += i + ','
c = c[:-1]
if b != '' and len(nonints) != 0:
	print('"' + b + '"' + '\n' + '"' + c + '"')
elif b == '' and len(nonints) != 0:
	print('-' + '\n' + '"' + c + '"')
elif b != '' and len(nonints) == 0:
	print('"' + b + '"' + '\n' + '-')
else:
	print('-\n-')


import sys
SEPARATORS = set([',', ';'])

def is_zero(word):
	return len(word) == 1 and word[0] == '0'

def add_word(word, numbers, others, is_number):
	if not is_zero(word) and (len(word) == 0 or not is_number):
		others.append(word)
	else:
		numbers.append(word)

def solve(line):
	(numbers, others) = ([], [])
	(word, is_number) = ([], True)
	for char in line:
		if char in SEPARATORS:
			add_word(word, numbers, others, is_number)
			(word, is_number) = ([], True)
		else:
			if not char.isdigit() or (char == '0' and len(word) == 0):
				is_number = False
			word.append(char)
	add_word(word, numbers, others, is_number)
	return (numbers, others)
assert solve('aba,123;1a;0') == ([list('123'), list('0')], [list('aba'), list('1a')])
assert solve('1;;01,a0,') == ([['1']], [[], list('01'), list('a0'), []])
assert solve('1') == ([['1']], [])
assert solve('a') == ([], [['a']])

def format_result(result):
	if len(result) == 0:
		return '-'
	return '"{}"'.format(','.join(map(lambda word: ''.join(word), result)))
(numbers, others) = map(format_result, solve(input().strip()))
print('{}\n{}'.format(numbers, others))


x = input()
p = x.split(',')
l = []
for i in p:
	r = i.split(';')
	for j in r:
		l.append(j)
alpha = ''
num = ''
for i in l:
	f = False
	if len(i) == 0:
		f = True
	k = i[:-len(i) + 1]
	if k == '0':
		f = True
	for j in i:
		if j < '0' or j > '9':
			f = True
			break
	if f:
		alpha += i
		alpha += str(',')
	else:
		num += i
		num += str(',')
if len(alpha) == 0:
	alpha = '-'
else:
	alpha = alpha[:-1]
	alpha = str('"') + alpha + str('"')
if len(num) == 0:
	num = '-'
else:
	num = num[:-1]
	num = str('"') + num + str('"')
print(num)
print(alpha)


import atexit
import io
import sys
_INPUT_LINES = sys.stdin.read().splitlines()
input = iter(_INPUT_LINES).__next__
_OUTPUT_BUFFER = io.StringIO()
sys.stdout = _OUTPUT_BUFFER

@atexit.register
def write():
	sys.__stdout__.write(_OUTPUT_BUFFER.getvalue())
import re

def main():
	pattern = re.compile(';|,')
	words = pattern.split(input())
	first = list()
	second = list()
	for v in words:
		if v.isdigit() and len(str(int(v))) == len(v):
			first.append(v)
		else:
			second.append(v)
	if len(first) != 0:
		print('"' + ','.join(first) + '"')
	else:
		print('-')
	if len(second) != 0:
		print('"' + ','.join(second) + '"')
	else:
		print('-')
main()


strings = input().replace(';', ',').split(',')
inteiros = []
nao_inteiros = []
for word in strings:
	if word.isdigit() and (word == '0' or word[0] != '0'):
		inteiros.append(word)
	else:
		nao_inteiros.append(word)
for i in (inteiros, nao_inteiros):
	print('"{}"'.format(','.join(i)) if i else '-')


s = input()
i = 0
tokens = []
while i < len(s):
	j = i
	while j < len(s) and s[j] not in ',;':
		j += 1
	tokens.append(s[i:j])
	i = j + 1
if s[-1] in ',;':
	tokens.append('')
numbers = []
nonnumbers = []
for t in tokens:
	if len(t) > 0 and all((c in '0123456789' for c in t)) and (not (len(t) > 1 and t[0] == '0')):
		numbers.append(t)
	else:
		nonnumbers.append(t)
print('"' + ','.join(numbers) + '"' if numbers else '-')
print('"' + ','.join(nonnumbers) + '"' if nonnumbers else '-')


S = input().replace(',', ';').split(';')
(notint, isint) = ([], [])
for w in S:
	if w.isdigit() and w[0] != '0' or w == '0':
		isint.append(w)
	else:
		notint.append(w)
if len(isint) == 0:
	print('-')
else:
	print('"' + ','.join(isint) + '"')
if len(notint) == 0:
	print('-')
else:
	print('"' + ','.join(notint) + '"')


import re
s = input()
words = re.split('[;,]', s)
(a, b) = ([], [])
for w in words:
	if w.isdigit() and (not (w[0] == '0' and len(w) > 1)):
		a.append(w)
	else:
		b.append(w)
print('"' + ','.join(a) + '"' if a else '-')
print('"' + ','.join(b) + '"' if b else '-')


from functools import cmp_to_key
from collections import deque, Counter
from heapq import heappush, heappop
from math import log, ceil
import sys
import os
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()

def inp():
	return sys.stdin.readline().rstrip('\r\n')

def ii():
	return int(inp())

def si():
	return str(inp())

def li(lag=0):
	l = list(map(int, inp().split()))
	if lag != 0:
		for i in range(len(l)):
			l[i] += lag
	return l

def mi(lag=0):
	matrix = list()
	for i in range(n):
		matrix.append(li(lag))
	return matrix

def lsi():
	return list(map(str, inp().split()))

def print_list(lista, space=' '):
	print(space.join(map(str, lista)))

def bisect_left(a, x):
	left = 0
	right = len(a)
	while left < right:
		mid = (left + right) // 2
		if a[mid] < x:
			left = mid + 1
		else:
			right = mid
	return left

def bisect_right(a, x):
	left = 0
	right = len(a)
	while left < right:
		mid = (left + right) // 2
		if a[mid] > x:
			right = mid
		else:
			left = mid + 1
	return left

def bisect_elements(a, x):
	return bisect_right(a, x) - bisect_left(a, x)
MOD = 10 ** 9 + 7
maxN = 5
FACT = [0] * maxN
INV_FACT = [0] * maxN

def add(x, y):
	return (x + y) % MOD

def multiply(x, y):
	return x * y % MOD

def power(x, y):
	if y == 0:
		return 1
	elif y % 2:
		return multiply(x, power(x, y - 1))
	else:
		a = power(x, y // 2)
		return multiply(a, a)

def inverse(x):
	return power(x, MOD - 2)

def divide(x, y):
	return multiply(x, inverse(y))

def allFactorials():
	FACT[0] = 1
	for i in range(1, maxN):
		FACT[i] = multiply(i, FACT[i - 1])

def inverseFactorials():
	n = len(INV_FACT)
	INV_FACT[n - 1] = inverse(FACT[n - 1])
	for i in range(n - 2, -1, -1):
		INV_FACT[i] = multiply(INV_FACT[i + 1], i + 1)

def coeffBinom(n, k):
	if n < k:
		return 0
	return multiply(FACT[n], multiply(INV_FACT[k], INV_FACT[n - k]))

def create_graph(n, m, undirected=1, unweighted=1):
	graph = [[] for i in range(n)]
	if unweighted:
		for i in range(m):
			[x, y] = li(lag=-1)
			graph[x].append(y)
			if undirected:
				graph[y].append(x)
	else:
		for i in range(m):
			[x, y, w] = li(lag=-1)
			w += 1
			graph[x].append([y, w])
			if undirected:
				graph[y].append([x, w])
	return graph

def create_tree(n, unweighted=1):
	children = [[] for i in range(n)]
	if unweighted:
		for i in range(n - 1):
			[x, y] = li(lag=-1)
			children[x].append(y)
			children[y].append(x)
	else:
		for i in range(n - 1):
			[x, y, w] = li(lag=-1)
			w += 1
			children[x].append([y, w])
			children[y].append([x, w])
	return children

def dist(tree, n, A, B=-1):
	s = [[A, 0]]
	(massimo, massimo_nodo) = (0, 0)
	distanza = -1
	v = [-1] * n
	while s:
		(el, dis) = s.pop()
		if dis > massimo:
			massimo = dis
			massimo_nodo = el
		if el == B:
			distanza = dis
		for child in tree[el]:
			if v[child] == -1:
				v[child] = 1
				s.append([child, dis + 1])
	return (massimo, massimo_nodo, distanza)

def diameter(tree):
	(_, foglia, _) = dist(tree, n, 0)
	(diam, _, _) = dist(tree, n, foglia)
	return diam

def dfs(graph, n, A):
	v = [-1] * n
	s = [[A, 0]]
	v[A] = 0
	while s:
		(el, dis) = s.pop()
		for child in graph[el]:
			if v[child] == -1:
				v[child] = dis + 1
				s.append([child, dis + 1])
	return v

def bfs(graph, n, A):
	v = [-1] * n
	s = deque()
	s.append([A, 0])
	v[A] = 0
	while s:
		(el, dis) = s.popleft()
		for child in graph[el]:
			if v[child] == -1:
				v[child] = dis + 1
				s.append([child, dis + 1])
	return v

def parents_children_root_unrooted_tree(tree, n, root=0):
	q = deque()
	visited = [0] * n
	parent = [-1] * n
	children = [[] for i in range(n)]
	q.append(root)
	while q:
		all_done = 1
		visited[q[0]] = 1
		for child in tree[q[0]]:
			if not visited[child]:
				all_done = 0
				q.appendleft(child)
		if all_done:
			for child in tree[q[0]]:
				if parent[child] == -1:
					parent[q[0]] = child
					children[child].append(q[0])
			q.popleft()
	return (parent, children)

def all_longest_path_passing_from_node(parent, children, n):
	q = deque()
	visited = [len(children[i]) for i in range(n)]
	downwards = [[0, 0] for i in range(n)]
	upward = [1] * n
	longest_path = [1] * n
	for i in range(n):
		if not visited[i]:
			q.append(i)
			downwards[i] = [1, 0]
	while q:
		node = q.popleft()
		if parent[node] != -1:
			visited[parent[node]] -= 1
			if not visited[parent[node]]:
				q.append(parent[node])
		else:
			root = node
		for child in children[node]:
			downwards[node] = sorted([downwards[node][0], downwards[node][1], downwards[child][0] + 1], reverse=True)[0:2]
	s = [node]
	while s:
		node = s.pop()
		if parent[node] != -1:
			if downwards[parent[node]][0] == downwards[node][0] + 1:
				upward[node] = 1 + max(upward[parent[node]], downwards[parent[node]][1])
			else:
				upward[node] = 1 + max(upward[parent[node]], downwards[parent[node]][0])
		longest_path[node] = downwards[node][0] + downwards[node][1] + upward[node] - min([downwards[node][0], downwards[node][1], upward[node]]) - 1
		for child in children[node]:
			s.append(child)
	return longest_path
digits = [str(i) for i in range(10)]
sep = [',', ';']
s = si()
i = 0
st = 0
flag = True
num = []
non = []
s = s.replace(';', ',').split(',')
for el in s:
	flag = True
	if el == '0':
		flag = True
	elif el == '':
		flag = False
	else:
		if el[0] == '0':
			flag = False
		for ch in el:
			if ch not in digits:
				flag = False
	if flag == True:
		num.append(el)
	else:
		non.append(el)
res1 = ','.join(num)
res2 = ','.join(non)
if num:
	print('"' + res1 + '"')
else:
	print('-')
if non:
	print('"' + res2 + '"')
else:
	print('-')


data = input()
integer = []
noninteger = []
flag = False
item = ''
for i in data:
	if i in ',;':
		if flag:
			noninteger.append('')
		elif item == '0':
			integer.append(item)
		elif item.isdigit() and item[0] != '0':
			integer.append(item)
		else:
			noninteger.append(item)
		item = ''
		flag = True
	else:
		item += i
		flag = False
if item:
	if item == '0':
		integer.append(item)
	elif item.isdigit() and item[0] != '0':
		integer.append(item)
	else:
		noninteger.append(item)
elif data[-1] in ',;':
	noninteger.append('')
if integer:
	print('"' + ','.join(integer) + '"')
else:
	print('-')
if noninteger:
	print('"' + ','.join(noninteger) + '"')
else:
	print('-')


import re
try:
	while True:
		a = []
		b = []
		for word in re.split('[,;]', input()):
			(a if re.match('^(0|[1-9][0-9]*)$', word) else b).append(word)
		print('"%s"' % ','.join(a) if a else '-')
		print('"%s"' % ','.join(b) if b else '-')
except EOFError:
	pass


import sys
s = sys.stdin.readline()
tokens = s.strip().replace(',', ';').split(';')
(s1, s2) = ([], [])
if len(tokens) == 1 and tokens[0] == '':
	print('-\n-')
	sys.exit(0)
for tok in tokens:
	if len(tok) > 1 and tok[0] == '0':
		s2 += [tok]
		continue
	try:
		i = int(tok)
		s1 += [tok]
	except:
		s2 += [tok]
print('"' + ','.join(s1) + '"' if len(s1) > 0 else '-')
print('"' + ','.join(s2) + '"' if len(s2) > 0 else '-')


import re
w = re.split('[,;]', input())
a = [i for i in w if len(i) > 0 and (not (i[0] == '0' and len(i) > 1)) and i.isdigit()]
b = [i for i in w if i not in a]
for t in (a, b):
	print('"' + ','.join(t) + '"' if len(t) > 0 else '-')


import sys

def get_array():
	return list(map(int, sys.stdin.readline().split()))

def get_ints():
	return map(int, sys.stdin.readline().split())

def input():
	return sys.stdin.readline().strip('\n')
s = input()
l = s.split(';')
string = []
integer = []
flag = False
for i in range(len(l)):
	if l[i] == '':
		string.append(l[i])
		continue
	if ',' in l[i]:
		k = l[i].split(',')
		flag = True
	if flag:
		for j in k:
			if j == '':
				string.append('')
			elif j[0] == '0':
				if len(j) == 1:
					integer.append(j)
				else:
					string.append(j)
			else:
				try:
					integer.append(int(j))
				except:
					string.append(j)
		flag = False
	elif l[i][0] == '0':
		if len(l[i]) == 1:
			integer.append(l[i])
		else:
			string.append(l[i])
	else:
		try:
			integer.append(int(l[i]))
		except:
			string.append(l[i])
if len(integer) != 0:
	print('"', end='')
	print(*integer, sep=',', end='')
	print('"')
else:
	print('-')
if len(string) != 0:
	print('"', end='')
	print(*string, sep=',', end='')
	print('"')
else:
	print('-')


s = input()
t = ''
b = ''
a = ''
for i in range(len(s)):
	if not s[i] in [';', ',']:
		t += s[i]
	else:
		if t.isdigit() and (not (len(t) > 1 and t[0] == '0')):
			a += t + ','
		else:
			b += t + ','
		t = ''
if t.isdigit() and (not (len(t) > 1 and t[0] == '0')):
	a += t + ','
else:
	b += t + ','
if not len(a) == 0:
	print('"' + a[:-1] + '"')
else:
	print('-')
if not len(b) == 0:
	print('"' + b[:-1] + '"')
else:
	print('-')


def single(l):
	return [i for sub in l for i in sub]
s = input()
words = single([x.split(',') for x in s.split(';')])
no = []
rest = []
for i in words:
	if len(i) > 1 and i[0] == '0':
		rest.append(i)
		continue
	try:
		j = int(i)
		no.append(i)
	except:
		rest.append(i)
if len(no) >= 1:
	print('"' + ','.join(no) + '"')
else:
	print('-')
if len(rest) >= 1:
	print('"' + ','.join(rest) + '"')
else:
	print('-')


def pri(a):
	if len(a) > 0:
		print('"' + ','.join(a) + '"')
	else:
		print('-')

def main():
	mode = 'filee'
	if mode == 'file':
		f = open('test.txt', 'r')
	get = lambda : [int(x) for x in (f.readline() if mode == 'file' else input()).split()]
	g = input()
	g = list(g)
	for i in range(len(g)):
		if g[i] == ',':
			g[i] = ';'
	g = ''.join(g)
	g = g.split(';')
	a = []
	b = []
	for i in g:
		try:
			h = int(i)
			if i[0] != '0' or i == '0':
				a.append(i)
			else:
				b.append(i)
		except:
			b.append(i)
	pri(a)
	pri(b)
	if mode == 'file':
		f.close()
main()


import re

def isgood(item):
	try:
		if len(item) > 1 and item[0] == '0':
			return False
		val = int(item)
		if val < 0:
			return False
	except ValueError:
		return False
	return True
s = input()
(a, b) = ([], [])
for x in re.split(',|;', s):
	(a if isgood(x) else b).append(x)
if len(a) == 0:
	print('-')
else:
	print('"' + ','.join(a) + '"')
if len(b) == 0:
	print('-')
else:
	print('"' + ','.join(b) + '"')


import re
l = re.split('[,,;]', input())
ans_int = '-'
ans_str = '-'
for i in l:
	if re.match('^[1-9][0-9]*$|^0$', i) != None:
		if ans_int == '-':
			ans_int = i
		else:
			ans_int += ',' + i
	elif i != '':
		if ans_str == '-':
			ans_str = i
		else:
			ans_str += ',' + i
	elif ans_str == '-':
		ans_str = ''
	else:
		ans_str += ','
if ans_int == '-':
	print(ans_int)
else:
	print('"' + ans_int + '"')
if ans_str == '-':
	print(ans_str)
else:
	print('"' + ans_str + '"')


def is_good(str):
	if len(str) == 0:
		return False
	if len(str) == 1 and (not (str[0] < '0' or str[0] > '9')):
		return True
	if not (str[0] > '0' and str[0] <= '9'):
		return False
	for i in range(len(str)):
		if str[i] < '0' or str[i] > '9':
			return False
	return True
a = []
b = []
s = input()
str = ''
for i in range(len(s)):
	if s[i] == ',' or s[i] == ';':
		if is_good(str):
			a.append(str)
		else:
			b.append(str)
		str = ''
		continue
	str += s[i]
if is_good(str):
	a.append(str)
else:
	b.append(str)
if len(a) == 0:
	print('-')
else:
	print('"', end='')
	for i in range(len(a)):
		print(a[i], end='')
		if i != len(a) - 1:
			print(',', end='')
	print('"')
if len(b) == 0:
	print('-')
else:
	print('"', end='')
	for i in range(len(b)):
		print(b[i], end='')
		if i != len(b) - 1:
			print(',', end='')
	print('"', end='')


s = input()
s = s.replace(';', ',')
ls = s.split(',')
a = ''
b = ''
bw = 'no'
for element in ls:
	if element.isdigit() and (element[0] != '0' or element == '0'):
		a += element + ','
	elif element == '':
		b += element + ','
		bw = 'yes'
	else:
		b += element + ','
a = a[:-1]
b = b[:-1]
if a == '':
	print('-')
else:
	print('"' + a + '"')
if b == '' and bw == 'no':
	print('-')
else:
	print('"' + b + '"')


s = input().strip()
words = []
aux = []
for c in s:
	if c in ',;':
		words.append(''.join(aux))
		aux.clear()
	else:
		aux.append(c)
words.append(''.join(aux))

def isClass1(s):
	if len(s) == 0:
		return False
	if not all([c.isdigit() for c in s]):
		return False
	if s == '0':
		return True
	return s[0] != '0'
A = list(filter(isClass1, words))
B = list(filter(lambda s: not isClass1(s), words))
if len(A):
	A = ','.join(A)
	A = f'"{A}"'
else:
	A = '-'
if len(B):
	B = ','.join(B)
	B = f'"{B}"'
else:
	B = '-'
print(A)
print(B)


s = input().split(',')
a = '"'
b = '"'
for t in s:
	for word in t.split(';'):
		if word.isdigit() and (word[0] != '0' or word == '0'):
			a = a + word + ','
		else:
			b = b + word + ','
if len(a) == 1:
	print('-')
else:
	print(a[0:len(a) - 1] + '"')
if len(b) == 1:
	print('-')
else:
	print(b[0:len(b) - 1] + '"')


s = input()
s = s.replace(',', ';')
word = s.split(';')
a = []
b = []
for i in word:
	if i.isdigit() == False:
		b.append(i)
	elif i[0] == '0' and len(i) > 1:
		b.append(i)
	else:
		a.append(i)
if len(a) == 0:
	print('-')
else:
	print('"' + ','.join(a) + '"')
if len(b) == 0:
	print('-')
else:
	print('"' + ','.join(b) + '"')


import sys
import re
from math import ceil, log, sqrt, floor
__local_run__ = False
if __local_run__:
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

def isNum(s):
	if len(s) == 0:
		return False
	if s[0] == '0':
		return True if len(s) == 1 else False
	for char in s:
		if char not in '0123456789':
			return False
	return True

def main():
	parts = input().replace(',', ' ').replace(';', ' ').split(' ')
	a = []
	b = []
	for p in parts:
		if isNum(p):
			a.append(p)
		else:
			b.append(p)
	if len(a) == 0:
		print('-')
	else:
		print('"' + ','.join(a) + '"')
	if len(b) == 0:
		print('-')
	else:
		print('"' + ','.join(b) + '"')
main()


import queue
s = input()
s = s.replace(';', ',')
tmp = s.split(',')
a = []
b = []
for ss in tmp:
	if ss.isnumeric() and (ss == '0' or (ss[0] != '-' and ss[0] != '0')):
		a.append(ss)
	else:
		b.append(ss)
for ans in [a, b]:
	if len(ans) == 0:
		print('-')
	else:
		print('"', ','.join(ans), '"', sep='')


s = input().replace(';', ',').split(',')
fs = []
ss = []
for i in s:
	if i.isdecimal():
		if len(i) == 1 and i[0] == '0':
			fs.append(i)
		elif len(i) != 1 and i[0] == '0':
			ss.append(i)
		else:
			fs.append(i)
	else:
		ss.append(i)
if fs:
	print('"' + ','.join(fs) + '"')
else:
	print('-')
if ss:
	print('"' + ','.join(ss) + '"')
else:
	print('-')


line = input().replace(';', ',').split(',')
nums = []
words = []
for w in line:
	if w.isdigit():
		if int(w) > 0:
			if w[0] == '0':
				words.append(w)
			else:
				nums.append(w)
		elif int(w) == 0:
			if len(w) > 1:
				words.append(w)
			else:
				nums.append(w)
		else:
			words.append(w)
	else:
		words.append(w)
a = '-'
if len(nums) > 0:
	a = '"{0}"'.format(','.join(nums))
b = '-'
if len(words) > 0:
	b = '"{0}"'.format(','.join(words))
print(a)
print(b)


s = input()
s = s.replace(',', ';')
s = s.split(';')
a = []
b = []
for i in s:
	if i.isnumeric() and (i[0] != '0' or len(i) == 1):
		a.append(i)
	else:
		b.append(i)
if a != []:
	print('"%s"' % ','.join(a))
else:
	print('-')
if b != []:
	print('"%s"' % ','.join(b))
else:
	print('-')


def isNumber(x):
	try:
		p = int(x)
		return x == str(p)
	except:
		return False

def conc(p):
	if len(p) == 0:
		return '-'
	s = '"'
	for i in range(len(p) - 1):
		s += p[i] + ','
	s += p[len(p) - 1] + '"'
	return s
s = input().split(';')
p = []
q = []
for l in s:
	for i in l.split(','):
		if isNumber(i):
			p.append(i)
		else:
			q.append(i)
p = conc(p)
q = conc(q)
print(p)
print(q)


import sys
s = input()
a = []
b = []
num = ''
for i in range(len(s)):
	if s[i] == ',' or s[i] == ';':
		if num.isnumeric() and (len(num) == 1 or num[0] != '0'):
			a.append(num)
		else:
			b.append(num)
		num = ''
	else:
		num += s[i]
if num.isnumeric() and (len(num) == 1 or num[0] != '0'):
	a.append(num)
else:
	b.append(num)
num = ''
if len(a) > 0:
	print('"', end='')
	for i in range(len(a)):
		print(a[i], end='' if i == len(a) - 1 else ',')
	print('"')
else:
	print('-')
if len(b) > 0:
	print('"', end='')
	for i in range(len(b)):
		print(b[i], end='' if i == len(b) - 1 else ',')
	print('"')
else:
	print('-')


def split_simbols(s, spl):
	ans = []
	seq = ''
	for c in s:
		if c not in spl:
			seq += c
		else:
			ans.append(seq)
			seq = ''
	ans.append(seq)
	return ans

def main():
	s = input()
	s = split_simbols(s, [';', ','])
	a = []
	b = []
	for w in s:
		if w.isdigit():
			if str(int(w)) == w:
				a.append(w)
			else:
				b.append(w)
		else:
			b.append(w)
	if not a:
		print('-')
	else:
		print('"%s"' % ','.join(a))
	if not b:
		print('-')
	else:
		print('"%s"' % ','.join(b))
main()


def isInt(s):
	try:
		int(s)
		return True
	except ValueError:
		return False
s = input()
s1 = s.split(';')
a = '"'
b = '"'
f = False
for i in s1:
	s2 = i.split(',')
	for j in s2:
		if isInt(j):
			if j[0] == '0' and j != '0' or j.find('.') != -1 or int(j) < 0:
				if b != '"' or f == True:
					b = b + ',' + j
				else:
					b = b + j
			elif a != '"':
				a = a + ',' + j
			else:
				a = a + j
		else:
			if b != '"' or f == True:
				b = b + ',' + j
			else:
				b = b + j
			if j == '':
				f = True
if a == '"':
	print('-')
else:
	print(a + '"')
if b == '"' and f == False:
	print('-')
else:
	print(b + '"')


import re
word_input = input()
s_Words = re.split('[,;:]', word_input)
numbers = []
letter = []
for i in s_Words:
	if i != '0' and all((j == '0' for j in i)):
		letter.append(i)
		continue
	elif i.isdigit() and (not i.startswith('0') or len(i.lstrip('0')) == 0):
		numbers.append(i)
		continue
	else:
		letter.append(i)
if len(numbers) > 0:
	print('"%s"' % ','.join(numbers))
elif len(numbers) == 0:
	print('-')
if len(letter) > 0:
	print('"%s"' % ','.join(letter))
elif len(letter) == 0:
	print('-')


from __future__ import print_function
import sys
line = input().replace(',', ';')
ws = line.split(';')
a = []
b = []
for word in ws:
	if word.isdigit():
		if word == '0' or not word.startswith('0'):
			a.append(word)
		else:
			b.append(word)
	else:
		b.append(word)
if len(a) == 0:
	print('-')
else:
	print('"{0}"'.format(','.join(a)))
if len(b) == 0:
	print('-')
else:
	print('"{0}"'.format(','.join(b)))


s = input().split(';')
l = []
for i in s:
	l += i.split(',')
a = ''
b = ''
int
for word in l:
	flag = True
	for sym in word:
		if not sym in ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']:
			flag = False
			break
	if len(word) > 1 and word[0] == '0':
		flag = False
	if flag and word != '':
		a += word + ','
	else:
		b += word + ','
if len(a) == 0:
	print('-')
else:
	print('"' + a[0:-1] + '"')
if len(b) == 0:
	print('-')
else:
	print('"' + b[0:-1] + '"')


import re
words = input()
splited_words = re.split('[,;:]', words)
digits = []
words = []
for e in splited_words:
	if e != '0' and all((c == '0' for c in e)):
		words.append(e)
		continue
	elif e.isdigit() and (not e.startswith('0') or len(e.lstrip('0')) == 0):
		digits.append(e)
		continue
	else:
		words.append(e)
if len(digits) > 0:
	print('"%s"' % ','.join(digits))
elif len(digits) == 0:
	print('-')
if len(words) > 0:
	print('"%s"' % ','.join(words))
elif len(words) == 0:
	print('-')


s = list(input())
l = len(s)
for i in range(l):
	if s[i] == ',':
		s[i] = ';'
s = ''.join(s)
s = s.split(';')
no = []
w = []
for i in s:
	try:
		if not (len(i) > 1 and i[0] == '0'):
			n = int(i)
			no.append(n)
		else:
			w.append(i)
	except ValueError:
		w.append(i)
if len(no):
	print('"', end='')
	for i in range(len(no) - 1):
		print(no[i], end=',')
	print(no[-1], end='')
	print('"')
else:
	print('-')
no = w
if len(no):
	print('"', end='')
	for i in range(len(no) - 1):
		print(no[i], end=',')
	print(no[-1], end='')
	print('"')
else:
	print('-')


input_str = input()
input_set = set(input_str)
if input_set == {','} or input_set == {';'}:
	print('-')
	print('"' + ',' * len(input_str) + '"')
	exit()
split_input = input_str.replace(';', ',').split(',')
list_a = []
list_b = []
for element in split_input:
	if element == '0':
		list_a.append(element)
	elif len(element) == 0:
		list_b.append(element)
	elif '0' != element[0] and '.' not in element and element.isnumeric():
		list_a.append(element)
	else:
		list_b.append(element)
if len(list_a) == 0:
	print('-')
else:
	print('"%s"' % ','.join(list_a))
if len(list_b) == 0:
	print('-')
else:
	print('"%s"' % ','.join(list_b))


s = input()
n = len(s)
a_list = []
b_list = []
words = []
aux = ''
for i in range(n):
	c = s[i]
	if c == ';' or c == ',':
		words.append(aux)
		aux = ''
	else:
		aux += c
words.append(aux)
for w in words:
	if w.isdigit() and (w[0] != '0' or w == '0') and ('.' not in w):
		a_list.append(w.strip())
	else:
		b_list.append(w.strip())
a = ''
b = ''
if len(a_list) == 0:
	a = '-'
else:
	a = '"' + ','.join(a_list) + '"'
if len(b_list) == 0:
	b = '-'
else:
	b = '"' + ','.join(b_list) + '"'
print(a)
print(b)


s = str(input())
numb = '"'
lines = '"'
mass = list
s = s.replace(';', ',')
for item in s.split(','):
	if item.isdigit() and (item[0] != '0' or len(item) == 1):
		numb += item + ','
	else:
		lines += item + ','
if numb == '"':
	print('-')
else:
	numb = numb[0:-1] + '"'
	print(numb)
if lines == '"':
	print('-')
else:
	lines = lines[0:-1] + '"'
	print(lines)


import re
s = input()
s = re.split('[,;]', s)
(ans1, ans2) = ([], [])
for w in s:
	if w.isdecimal():
		if w == str(int(w)):
			ans1.append(w)
		else:
			ans2.append(w)
	else:
		ans2.append(w)
print('"' + ','.join(ans1) + '"' if ans1 else '-')
print('"' + ','.join(ans2) + '"' if ans2 else '-')


import re
s = input()
s = re.split('[;,]', s)
a = ''
b = ''
for item in s:
	if item.isnumeric():
		if item.find('.') == -1:
			if not item.startswith('0') or item == '0':
				a += item + ','
			else:
				b += item + ','
		else:
			b += item + ','
	else:
		b += item + ','
if len(a) == 0:
	a = '-'
else:
	if a.endswith(','):
		a = a[0:len(a) - 1]
	a = '"' + a + '"'
if len(b) == 0:
	b = '-'
else:
	if b.endswith(','):
		b = b[0:len(b) - 1]
	b = '"' + b + '"'
print(a)
print(b)


s = input()
a = []
x = 0
x1 = 0
x2 = 0
if s.count(';') + s.count(',') != -2:
	for i in range(0, s.count(';') + s.count(',') + 1):
		x1 = s.find(';')
		x = s.find(',')
		if x1 == -1:
			x2 = x
			a.append(s[:x2])
			s = s[x2 + 1:len(s)]
		elif x == -1:
			x2 = x1
			a.append(s[:x2])
			s = s[x2 + 1:len(s)]
		else:
			x2 = min(x, x1)
			a.append(s[:x2])
			s = s[x2 + 1:len(s)]
del a[len(a) - 1]
a.append(s)
strings = ''
numbers = ''
for j in range(len(a)):
	if a[j].isalpha() == True or a[j] == '' or (a[j].count('.') != -1 and a[j].isdigit() == False) or (a[j][0] == '0' and len(a[j]) > 1):
		strings += ',' + a[j]
	else:
		numbers += ',' + a[j]
if len(numbers) == 0:
	print('-')
	print('"' + strings[1:len(strings) + 1] + '"')
elif len(strings) == 0:
	print('"' + numbers[1:len(numbers) + 1] + '"')
	print('-')
else:
	print('"' + numbers[1:len(numbers) + 1] + '"')
	print('"' + strings[1:len(strings) + 1] + '"')


import logging
import copy
import sys
logging.basicConfig(stream=sys.stderr, level=logging.DEBUG)

def solve(inputLine):
	aStr = []
	bStr = []
	for dummy in inputLine.split(','):
		for word in dummy.split(';'):
			try:
				if word == str(int(word)):
					aStr.append(word)
				else:
					bStr.append(word)
			except:
				bStr.append(word)
	for lst in [aStr, bStr]:
		if len(lst) == 0:
			print('-')
		else:
			print('"%s"' % ','.join(lst))
	log(aStr)
	log(bStr)
	return

def main():
	firstLine = input()
	solve(firstLine)

def log(*message):
	logging.debug(message)
main()


s = input()
s = s + ';'
a = ''
b = ''
a_is = False
b_is = False
nw = ''
num = True
for chr in s:
	if chr == ';' or chr == ',':
		if len(nw) == 0:
			num = False
		if len(nw) > 1 and nw[0] == '0':
			num = False
		if num:
			a = a + ',' + nw
			a_is = True
		else:
			b = b + ',' + nw
			b_is = True
		nw = ''
		num = True
		continue
	nw = nw + chr
	if ord(chr) < 48 or ord(chr) > 57:
		num = False
a = a[1:]
b = b[1:]
a = '"' + a + '"'
b = '"' + b + '"'
if a_is:
	print(a)
else:
	print('-')
if b_is:
	print(b)
else:
	print('-')


def Int(s):
	try:
		int(s)
		if len(s) > 1 and s[0] == '0':
			return False
		return True
	except ValueError:
		return False

def notInt(s):
	try:
		int(s)
		if len(s) > 1 and s[0] == '0':
			return True
		return False
	except ValueError:
		return True
s = input().replace(';', ',').split(',')
a = list(filter(Int, s))
b = list(filter(notInt, s))
if len(a) != 0:
	print('"' + ','.join(a) + '"')
else:
	print('-')
if len(b) != 0:
	print('"' + ','.join(b) + '"')
else:
	print('-')


import itertools
s = [x.split(',') for x in input().split(';')]
s = list(itertools.chain(*s))

def parr(x):
	if len(x) == 0:
		print('-')
	else:
		print('"' + ','.join(x) + '"')
a = []
b = []
for x in s:
	if len(x) == 0:
		b.append(x)
		continue
	cnt = 0
	for i in '0123456789':
		cnt += x.count(i)
	if cnt == len(x) and (x[0] != '0' or len(x) == 1):
		a.append(x)
	else:
		b.append(x)
parr(a)
parr(b)


s = input().replace(';', ',').split(',')
arr1 = []
arr2 = []
for i in s:
	if i.isdigit() and (i == '0' or i[0] != '0'):
		arr1.append(i)
	else:
		arr2.append(i)
print('"' + ','.join(arr1) + '"' if len(arr1) else '-')
print('"' + ','.join(arr2) + '"' if len(arr2) else '-')


first = str(input()).split(',')
second = [str(x).split(';') for x in first]
final = []
for x in second:
	final.extend(x)
(a, b) = ([], [])
for x in final:
	try:
		isnumber = int(x)
		a.append(x) if str(isnumber) == x else b.append(x)
	except:
		b.append(x)
print('-') if not a else print('"' + ','.join(a) + '"')
print('-') if not b else print('"' + ','.join(b) + '"')


a = list(map(str, input().replace(';', ',').split(',')))
c = []
d = []
for i in a:
	try:
		if str(int(i)) == i:
			c += [i]
		else:
			d += [i]
	except:
		d += [i]
if len(c) == 0:
	print('-')
else:
	ans = ''
	for i in c:
		ans += i + ','
	print('"' + ans[:-1] + '"')
if len(d) == 0:
	print('-')
else:
	ans = ''
	for i in d:
		ans += i + ','
	print('"' + ans[:-1] + '"')


s = input()
words = s.replace(',', ';').split(';')
a = []
b = []
for i in words:
	try:
		int(i)
		if len(str(int(i))) != len(i):
			raise ValueError
		a.append(i)
	except:
		b.append(i)
if len(a) > 0:
	print('"' + ','.join(a) + '"')
else:
	print('-')
if len(b) > 0:
	print('"' + ','.join(b) + '"')
else:
	print('-')


q = 'aba,123;1a;0'
q = '1;;01,a0,'
q = '1'
q = 'a'
import re
s = re.split(',|;', input())
pattern = '([1-9][0-9]*)|(0)'
regex = re.compile(pattern)
a = []
b = []
for i in s:
	m = regex.match(i)
	if len(i) == 0 or m == None or i[m.start():m.end()] != i:
		b.append(i)
	else:
		a.append(i)
if len(a) == 0:
	a = '-'
else:
	a = '"' + ','.join(a) + '"'
if len(b) == 0:
	b = '-'
else:
	b = '"' + ','.join(b) + '"'
print(a)
print(b)


import re
s = input()
f = s.split(',')
s = []
for i in f:
	s += i.split(';')
fir = []
sec = []
reg = re.compile('[1-9]\\d*')
for i in s:
	if reg.fullmatch(i) == None and i != '0':
		sec.append(i)
	else:
		fir.append(i)
if len(fir) > 0:
	print('"' + ','.join(fir) + '"')
else:
	print('-')
if len(sec) > 0:
	print('"' + ','.join(sec) + '"')
else:
	print('-')


s = input()
nums = []
tokens = []
if len(s) == 1:
	if s[0].isdigit():
		nums.append(s[0])
	elif s[0] == ';':
		tokens.extend(['', ''])
	else:
		tokens.append(s[0])
else:
	s = s.split(';')
	string = []
	for i in s:
		if ',' in i:
			string.extend(i.split(','))
		else:
			string.append(i)
	for i in range(len(string)):
		if string[i] == '':
			tokens.append(string[i])
		elif string[i][0] == '0' and len(string[i]) == 1:
			nums.append(string[i])
		elif string[i][0] != '0' and string[i].isdigit():
			nums.append(string[i])
		else:
			tokens.append(string[i])
if not nums:
	print('-')
else:
	print('"', end='')
	print(*nums, sep=',', end='')
	print('"')
if not tokens:
	print('-')
else:
	print('"', end='')
	print(*tokens, sep=',', end='')
	print('"')


s = input()
q = []
z = ''
for i in s:
	if i in [',', ';']:
		q.append(z)
		z = ''
	else:
		z += i
q.append(z)
(a, b) = ([], [])
for i in q:
	if len(i) > 0 and (i == '0' or (i[0] != '0' and i.isdigit())):
		a.append(i)
	else:
		b.append(i)
if a != []:
	print('"' + ','.join(a) + '"')
else:
	print('-')
if b != []:
	print('"' + ','.join(b) + '"')
else:
	print('-')


s = input()
a = []
b = []
last_word = []
temp = 0
digits = '0123456789'
for letter in s:
	if letter == ';' or letter == ',':
		for leter in last_word:
			if digits.find(leter) == -1:
				temp = 1
				break
		if temp == 0 and len(last_word) != 0:
			if last_word[0] != '0' or len(last_word) == 1:
				a += ''.join(last_word).split()
			else:
				b += ''.join(last_word).split()
		elif len(last_word) == 0:
			temp = 0
			b += ['']
		else:
			temp = 0
			b += ''.join(last_word).split()
		last_word = []
	else:
		last_word += letter
for leter in last_word:
	if digits.find(leter) == -1:
		temp = 1
		break
if temp == 0 and len(last_word) != 0:
	if last_word[0] != '0' or len(last_word) == 1:
		a += ''.join(last_word).split()
	else:
		b += ''.join(last_word).split()
elif len(last_word) == 0:
	temp = 0
	b += ['']
else:
	temp = 0
	b += ''.join(last_word).split()
if len(a) == 0:
	print('-')
else:
	print('"', end='')
	print(','.join(a), end='')
	print('"')
if len(b) == 0:
	print('-')
else:
	print('"', end='')
	print(','.join(b), end='')
	print('"')


s = []
for i in input().split(','):
	s += i.split(';')
F = lambda x: x.isdigit() and str(int(x)) == x
G = lambda x: 1 - F(x)
z = '"'
a = ','.join(filter(F, s))
b = list(filter(G, s))
a = ['-', z + a + z][bool(a)]
b = ['-', z + ','.join(b) + z][bool(b)]
print(a + '\n' + b)


words = input().strip().replace(',', ';').split(';')
a = [w for w in words if w.isdigit() and w == str(int(w))]
sa = set(a)
b = [w for w in words if w not in sa]
if a:
	print('"' + ','.join(a) + '"')
else:
	print('-')
if b:
	print('"' + ','.join(b) + '"')
else:
	print('-')


t = input()
s = ''
a = []
for i in range(len(t)):
	if t[i] != ',' and t[i] != ';':
		s = s + t[i]
	else:
		a.append(s)
		s = ''
a.append(s)
b = []
c = []
for i in range(len(a)):
	try:
		d = int(a[i])
		if len(a[i]) == len(str(int(a[i]))):
			b.append(a[i])
		else:
			c.append(a[i])
	except:
		c.append(a[i])
if len(b) == 0:
	print('-')
else:
	print('"' + ','.join(b) + '"')
if len(c) == 0:
	print('-')
else:
	print('"' + ','.join(c) + '"')


s = input()
a = []
b = []
c = ''
flag = True
for i in range(len(s)):
	if ord(s[i]) != 44 and ord(s[i]) != 59:
		if len(c) == 0:
			if s[i] == '0':
				flag = False
		if ord(s[i]) < 48 or ord(s[i]) > 57:
			flag = False
		c += s[i]
		if i == len(s) - 1:
			if (flag or c == '0') and c != '':
				a.append(c)
			else:
				b.append(c)
	else:
		if (flag or c == '0') and c != '':
			a.append(c)
		else:
			b.append(c)
		c = ''
		flag = True
		if i == len(s) - 1:
			if (flag or c == '0') and c != '':
				a.append(c)
			else:
				b.append(c)
if len(a) > 0:
	print('"' + ','.join((str(x) for x in a)) + '"')
else:
	print(chr(45))
if len(b) > 0:
	print('"' + ','.join((str(x) for x in b)) + '"')
else:
	print(chr(45))


import unittest
import sys
import re

class Nums:

	def __init__(self, test_inputs=None):
		it = iter(test_inputs.split('\n')) if test_inputs else None

		def uinput():
			return next(it) if it else sys.stdin.readline().rstrip()
		self.s = uinput()
		self.t = re.split(';|,', self.s)
		self.al = []
		self.bl = []
		for n in self.t:
			try:
				if str(int(n)) == n:
					self.al.append(n)
				else:
					self.bl.append(n)
			except:
				self.bl.append(n)

	def calculate(self):
		result = ''
		result += '-' if not self.al else '"' + ','.join(self.al) + '"'
		result += '\n'
		result += '-' if not self.bl else '"' + ','.join(self.bl) + '"'
		return result

class unitTests(unittest.TestCase):

	def test_single_test(self):
		test = 'aba,123;1a;0'
		d = Nums(test)
		self.assertEqual(Nums(test).calculate(), '"123,0"\n"aba,1a"')
		test = '1;;01,a0,'
		self.assertEqual(Nums(test).calculate(), '"1"\n",01,a0,"')
		test = '1'
		self.assertEqual(Nums(test).calculate(), '"1"\n-')
		test = 'a'
		self.assertEqual(Nums(test).calculate(), '-\n"a"')

	def time_limit_test(self, nmax):
		import random
		import timeit
		test = str(nmax) + ' ' + str(nmax) + '\n'
		numnums = [str(i) + ' ' + str(i + 1) for i in range(nmax)]
		test += '\n'.join(numnums) + '\n'
		nums = [random.randint(1, 10000) for i in range(nmax)]
		test += ' '.join(map(str, nums)) + '\n'
		start = timeit.default_timer()
		d = Nums(test)
		calc = timeit.default_timer()
		d.calculate()
		stop = timeit.default_timer()
		print('\nTimelimit Test: ' + '{0:.3f}s (init {1:.3f}s calc {2:.3f}s)'.format(stop - start, calc - start, stop - calc))
sys.setrecursionlimit(100000)
if sys.argv[-1] == '-ut':
	unittest.main(argv=[' '])
sys.stdout.write(Nums().calculate())


def main():
	str = input().replace(';', ',')
	input_list = str.split(',')

	def pred(x):
		return x.isdigit() and (x[0] != '0' or len(x) == 1)
	lA = list(filter(pred, input_list))
	lB = list(filter(lambda x: not pred(x), input_list))
	print('"{}"'.format(','.join(lA))) if lA else print('-')
	print('"{}"'.format(','.join(lB))) if lB else print('-')
main()


import re
s = input()
l = re.split('[;|,]', s)
num = ''
word = ''
c = 0
for i in l:
	if i.isdigit():
		if len(i) == 1 and i[0] == '0':
			num += i + ','
		elif len(i) > 1 and i[0] == '0':
			word += i + ','
		else:
			num += i + ','
	else:
		word += i + ','
if len(num) != 0:
	c += 1
	if c == 1:
		print('"', end='')
	num = num[:-1]
	print(num, end='"')
	print('')
else:
	print('-')
c = 0
if len(word) != 0:
	c += 1
	if c == 1:
		print('"', end='')
	word = word[:-1]
	print(word, end='"')
	print('')
else:
	print('-')


s = input()
a = s.replace(';', ',').split(',')
(c, d) = ([], [])
for elem in a:
	if elem.isdigit() and (elem[0] != '0' or len(elem) == 1):
		c.append(elem)
	else:
		d.append(elem)
if len(c) == 0:
	print('-')
	print('"' + ','.join(d) + '"')
elif len(d) == 0:
	print('"' + ','.join(c) + '"')
	print('-')
else:
	print('"' + ','.join(c) + '"')
	print('"' + ','.join(d) + '"')


def isinteger(s):
	if not s:
		return False
	if s == '0':
		return True
	if s[0] == '-' or s[0] == '0':
		return False
	try:
		int(s)
		return True
	except ValueError:
		return False
s = input()
first_pass = s.split(';')
words = []
for word in first_pass:
	words.extend(word.split(','))
a = ''
b = ''
for word in words:
	if isinteger(word):
		a += ',' + word
	else:
		b += ',' + word
if a:
	a = str(a[1:])
	print('"' + a + '"')
else:
	print('-')
if b:
	b = str(b[1:])
	print('"' + b + '"')
else:
	print('-')


s = input()

def is_number(w):
	return w.isdigit() and (not (w[0] == '0' and len(w) > 1))
n = len(s)
(a, b) = ([], [])
w = ''
i = 0
while i < n:
	if s[i] not in ',;':
		w += s[i]
	else:
		if is_number(w):
			a.append(w)
		else:
			b.append(w)
		w = ''
	i += 1
if is_number(w):
	a.append(w)
else:
	b.append(w)
print('"' + ','.join(a) + '"' if a else '-')
print('"' + ','.join(b) + '"' if b else '-')


s = input().replace(';', ',').split(',')
ans = []
ans1 = []
for i in s:
	f = 1
	for j in i:
		if j.isdigit():
			f = 1
		else:
			f = 0
			break
	if f == 0:
		ans1.append(i)
	elif i == '' or i == ',' or i == '.':
		ans1.append(i)
	elif str(int(i)) == i:
		ans.append(i)
	else:
		ans1.append(i)
if len(ans) == 0:
	print('-')
else:
	print('"', end='')
	for i in range(0, len(ans)):
		if i == len(ans) - 1:
			print(ans[i], end='')
			print('"')
		else:
			print(ans[i], end=',')
if len(ans1) == 0:
	print('-')
else:
	print('"', end='')
	for i in range(0, len(ans1)):
		if i == len(ans1) - 1:
			print(ans1[i], end='')
			print('"')
		else:
			print(ans1[i], end=',')


first = str(input()).split(',')
(second, final) = ([str(x).split(';') for x in first], [])
for x in second:
	final.extend(x)
a = [x for x in final if x.isnumeric() and str(int(x)) == x]
b = [x for x in final if not (x.isnumeric() and str(int(x)) == x)]
print('-') if not a else print('"' + ','.join(a) + '"')
print('-') if not b else print('"' + ','.join(b) + '"')


import re
s = str(input())
words = re.split(';|,', s)
a = '"'
b = '"'
for w in words:
	if w.isdigit() and w[0] != '0' or w == '0':
		a += w + ','
	else:
		b += w + ','
if a == '"':
	print('-')
else:
	a = a[:-1] + '"'
	print(a)
if b == '"':
	print('-')
else:
	b = b[:-1] + '"'
	print(b)


a = input().split(',')
for i in range(len(a)):
	a[i] = a[i].split(';')
words = []
for i in range(len(a)):
	for j in range(len(a[i])):
		words.append(a[i][j])
numbers = []
not_numbers = []
for i in range(len(words)):
	if words[i].isdigit() and (words[i][0] != '0' or words[i] == '0'):
		numbers.append(words[i])
	else:
		not_numbers.append(words[i])
if len(numbers) > 0:
	print('"', end='')
	for i in range(len(numbers)):
		print(numbers[i], end='')
		if i < len(numbers) - 1:
			print(',', end='')
	print('"', end='')
else:
	print('-', end='')
print()
if len(not_numbers) > 0:
	print('"', end='')
	for i in range(len(not_numbers)):
		print(not_numbers[i], end='')
		if i < len(not_numbers) - 1:
			print(',', end='')
	print('"', end='')
else:
	print('-')


def split(s, delimiter):
	words = ['']
	for c in s:
		if c in delimiter:
			words.append('')
		else:
			words[-1] += c
	return words

def is_number(s):
	for c in s:
		if c not in '0123456789':
			return False
	if s == '0':
		return True
	return len(s) != 0 and s[0] != '0'
words = split(input(), ',;')
a = []
b = []
for word in words:
	if is_number(word):
		a.append(word)
	else:
		b.append(word)
if len(a) == 0:
	a = '-'
else:
	a = '"' + ','.join(a) + '"'
if len(b) == 0:
	b = '-'
else:
	b = '"' + ','.join(b) + '"'
print(a)
print(b)


import sys
input = sys.stdin.readline

def solve():
	s = input().strip().replace(';', ',').split(',')
	a = []
	b = []
	for w in s:
		if w.isdigit() and (w == '0' or w[0] != '0'):
			a.append(w)
		else:
			b.append(w)
	for e in (a, b):
		print('"{}"'.format(','.join(e)) if e else '-')
solve()


import sys
input = sys.stdin.readline

def main():
	s = list(input().strip())
	a = []
	b = []
	store = []

	def isNum(l):
		if l == []:
			return False
		if len(l) == 1 and l[0] == '0':
			return True
		if l[0] == '0':
			return False
		for i in range(len(l)):
			if not '0' <= l[i] <= '9':
				return False
		return True
	for i in range(len(s)):
		if s[i] == ',' or s[i] == ';':
			if isNum(store):
				a.append(''.join(store))
			else:
				b.append(''.join(store))
			store = []
		else:
			store.append(s[i])
	if isNum(store):
		a.append(''.join(store))
	else:
		b.append(''.join(store))
	print('"' + ','.join(a) + '"' if a else '-')
	print('"' + ','.join(b) + '"' if b else '-')
main()


words = input().replace(';', ',').split(',')
(a, b) = ([], [])
for foo in words:
	if foo.isdigit() and (foo == '0' or foo[0] != '0'):
		a.append(foo)
	else:
		b.append(foo)
for v in (a, b):
	g = ','.join(v)
	print(['"' + g + '"', '-'][g == ',' * len(v)])


s = input().split(';')
a = []
b = []
for i in s:
	z = i.split(',')
	for j in z:
		if j == '':
			b.append(j)
		elif j[0] != '0' and j.isnumeric() or j == '0':
			a.append(j)
		else:
			b.append(j)
x = '"' + ','.join(a) + '"'
y = '"' + ','.join(b) + '"'
if len(a) == 0:
	print('-')
else:
	print(x)
if len(b) == 0:
	print('-')
else:
	print(y)


import re
ss = re.split(';|,', input())
a = []
b = []
p = re.compile('^(-?([1-9]\\d*)|0)$')
for s in ss:
	if p.match(s):
		a.append(s)
	else:
		b.append(s)
print('"' + ','.join(a) + '"' if len(a) else '-')
print('"' + ','.join(b) + '"' if len(b) else '-')


import sys
from re import split
input = sys.stdin.readline
S = split('[,;]', input()[:-1])
a = []
b = []
zero = ord('0')
nine = ord('9')
for s in S:
	if len(s) == 0:
		b += list(s) + [',']
		continue
	if len(s) > 1 and s[0] == '0':
		b += list(s) + [',']
		continue
	notint = 0
	for x in s:
		if ord(x) in range(zero, nine + 1):
			continue
		notint = 1
		break
	if notint:
		b += list(s) + [',']
	else:
		a += list(s) + [',']
if len(a):
	a.pop()
if len(b) > 1:
	b.pop()
elif len(b) == 1:
	b = ['']
if len(a):
	print('"' + ''.join(a) + '"')
else:
	print('-')
if len(b):
	print('"' + ''.join(b) + '"')
else:
	print('-')


def handleNumericChunk(chunk, A, B):
	if not chunk:
		B.append(chunk)
	elif chunk[0] == '0':
		if len(chunk) > 1:
			B.append(chunk)
		else:
			A.append(chunk)
	elif chunk.isdigit():
		A.append(chunk)
	else:
		B.append(chunk)
	return (A, B)

def extractNumbers(s):
	A = []
	B = []
	chunk = ''
	for (i, letter) in enumerate(s):
		if letter in ',;':
			(A, B) = handleNumericChunk(chunk, A, B)
			chunk = ''
		else:
			chunk += letter
	(A, B) = handleNumericChunk(chunk, A, B)
	return (A, B)

def formatOutput(l):
	if not l:
		return '-'
	else:
		temp = ['"']
		for x in l:
			temp.append(x)
			temp.append(',')
		temp[-1] = '"'
		return ''.join(temp)
s = input()
(A, B) = extractNumbers(s)
print(formatOutput(A))
print(formatOutput(B))


from math import ceil, modf
s = input().replace(',', ';')
s = s.split(';')
a = []
b = []
for i in s:
	try:
		d = str(int(i))
		if len(i) > 1 and i[0] == '0' or i[0] == '-':
			b.append(i)
		else:
			a.append(d)
	except ValueError:
		b.append(i)
if a:
	print('"' + ','.join(a) + '"')
else:
	print('-')
if b:
	print('"' + ','.join(b) + '"')
else:
	print('-')


b = []

def check(x):
	if '.' in x:
		return False
	if x == '0':
		return True
	if x == '':
		return False
	if x[0] == '0':
		return False
	for i in x:
		if i not in '1234567890':
			return False
	return True
s = input()
k = ''
for i in s:
	if i == ';':
		k += ','
	else:
		k += i
kk = k.split(',')
a = []
for i in kk:
	if check(i):
		a.append(i)
	else:
		b.append(i)
if a == []:
	print('-')
else:
	print('"' + ','.join(a) + '"')
if b == []:
	print('-')
else:
	print('"' + ','.join(b) + '"')


tokens = input().replace(';', ',').split(',')
a = []
b = []
for token in tokens:
	if token.isdigit() and (len(token) > 1 and token[0] != '0' or len(token) == 1):
		a.append(token)
	else:
		b.append(token)
print('"%s"' % ','.join(a) if len(a) > 0 else '-')
print('"%s"' % ','.join(b) if len(b) > 0 else '-')


s = input()
s = s.replace(';', ',').split(',')
(ans1, ans2) = ([], [])
nums = [str(i) for i in range(0, 10)]
for w in s:
	is_num = True
	for c in w:
		is_num &= c in nums
	is_num &= len(w) != 0
	if is_num and (w[0] != '0' or w == '0'):
		ans1.append(w)
	else:
		ans2.append(w)
if ans1 == []:
	ans1 = '-'
else:
	ans1 = '"' + ','.join((i for i in ans1)) + '"'
if ans2 == []:
	ans2 = '-'
else:
	ans2 = '"' + ','.join((i for i in ans2)) + '"'
print(ans1)
print(ans2)


s = input()
a = '"'
b = '"'
words = s.replace(';', ',').split(',')
no_ints = True
all_ints = True
for word in words:
	is_word = False
	if len(word) <= 1 or word[0] != '0':
		try:
			int(word)
			is_word = True
		except:
			pass
	if is_word:
		a += word + ','
		no_ints = False
	else:
		b += word + ','
		all_ints = False
if no_ints:
	print('-')
else:
	print(a[:-1] + '"')
if all_ints:
	print('-')
else:
	print(b[:-1] + '"')


string_input = input().replace(',', ' ').replace(';', ' ').split(' ')
nums = []
dump = []
for word in string_input:
	try:
		if str(int(word)) == word:
			nums.append(word)
		else:
			dump.append(word)
	except:
		dump.append(word)
if not nums:
	print('-')
else:
	print('"', ','.join(nums), '"', sep='')
if not dump:
	print('-')
else:
	print('"', ','.join(dump), '"', sep='')


import sys
import bisect
from bisect import bisect_left as lb
input_ = lambda : sys.stdin.readline().strip('\r\n')
from math import log
from math import gcd
from math import atan2, acos
from random import randint
sa = lambda : input_()
sb = lambda : int(input_())
sc = lambda : input_().split()
sd = lambda : list(map(int, input_().split()))
se = lambda : float(input_())
sf = lambda : list(input_())
flsh = lambda : sys.stdout.flush()
mod = 10 ** 9 + 7
gp = []
cost = []
dp = []
mx = []
ans1 = []
ans2 = []
special = []
specnode = []
a = 0
kthpar = []

def dfs(root, par):
	if par != -1:
		dp[root] = dp[par] + 1
	for i in range(1, 20):
		if kthpar[root][i - 1] != -1:
			kthpar[root][i] = kthpar[kthpar[root][i - 1]][i - 1]
	for child in gp[root]:
		if child == par:
			continue
		kthpar[child][0] = root
		dfs(child, root)

def hnbhai():
	a = sa()
	a = a.split(';')
	num = []
	ans = []
	for i in a:
		x = i.split(',')
		for i in x:
			try:
				abe = str(int(i))
				if abe == i:
					num.append(i)
				else:
					ans.append(i)
			except:
				ans.append(i)
	if len(num) == 0:
		print('-')
	else:
		print('"' + ','.join(num) + '"')
	if len(ans) == 0:
		print('-')
	else:
		print('"' + ','.join(ans) + '"')
for _ in range(1):
	hnbhai()


import re
words = input()
splited_words = re.split('[,;:]', words)
tmp_words = splited_words.copy()
digits = []
words = []
for e in tmp_words:
	if e != '0' and all((c == '0' for c in e)):
		continue
	elif e.isdigit() and (not e.startswith('0') or len(e.lstrip('0')) == 0):
		digits.append(e)
		del splited_words[splited_words.index(e)]
		continue
if len(digits) > 0:
	print('"%s"' % ','.join(digits))
elif len(digits) == 0:
	print('-')
if len(splited_words) > 0:
	print('"%s"' % ','.join(splited_words))
elif len(splited_words) == 0:
	print('-')


def is_num(s):
	if len(s) == 0:
		return False
	if s[0] == '0' and len(s) > 1:
		return False
	for i in s:
		c = str(i)
		if not c.isdigit():
			return False
	return True
a = list(input().split(sep=','))
b = []
for i in a:
	t = list(i.split(sep=';'))
	for j in t:
		b.append(j)
ans = []
ans2 = []
for i in range(len(b)):
	if is_num(b[i]):
		ans.append(b[i])
		b[i] = '*'
	else:
		ans2.append(b[i])
if len(ans) == 0:
	print('-')
else:
	print('"', end='')
	print(*ans, sep=',', end='')
	print('"')
if len(ans2) == 0:
	print('-')
else:
	print('"', end='')
	print(*ans2, sep=',', end='')
	print('"')


def solve():
	s = input().replace(';', ',').split(',')
	a = []
	b = []
	for w in s:
		if w.isdigit() and (w == '0' or w[0] != '0'):
			a.append(w)
		else:
			b.append(w)
	for e in (a, b):
		print('"{}"'.format(','.join(e)) if e else '-')
solve()


s = input()
s = s + ','
a = ''
b = ''
(start, end) = (0, 0)
for i in range(len(s)):
	if s[i] == ';' or s[i] == ',':
		if start != end:
			f = s[start:end]
		else:
			f = ''
		if f.isdigit() and f[0] != '0':
			a += f + ','
		elif f == '0':
			a += f + ','
		else:
			b += f + ','
		start = end + 1
		end += 1
	else:
		end += 1
if not a:
	a = '-'
else:
	a = a[:len(a) - 1]
	a = '"' + a + '"'
if not b:
	b = '-'
else:
	b = b[:len(b) - 1]
	b = '"' + b + '"'
print(a)
print(b)


s = input()
l = []
for i in s.split(','):
	l += i.split(';')
(a, b) = ([], [])
for i in l:
	if str.isnumeric(i) and str(int(i)) == i:
		a.append(i)
	else:
		b.append(i)
if len(a) == 0:
	print('-')
else:
	print('"' + ','.join(a) + '"')
if len(b) == 0:
	print('-')
else:
	print('"' + ','.join(b) + '"')


import re
ss = re.split('[,;]', input())
a = []
b = []
for w in ss:
	if w.isnumeric() and (w == '0' or w[0] != '0'):
		a.append(w)
	else:
		b.append(w)
if a:
	print('"%s"' % ','.join(a))
else:
	print('-')
if b:
	print('"%s"' % ','.join(b))
else:
	print('-')


s = input()
(C, S, n, ds, g) = ([], [], len(s), '', True)

def strX(x):
	Ln = len(x)
	j = 1
	if Ln == 0:
		return '-'
	st = x[0]
	while j < Ln:
		st = x[j] + ',' + st
		j += 1
	return '"' + st + '"'

def fds(ds):
	L = len(ds)
	if L == 0:
		S.append(ds)
		return
	if g:
		if L == 1:
			C.append(ds)
		elif ds[0] == '0':
			S.append(ds)
		else:
			C.append(ds)
	else:
		S.append(ds)
while n > 0:
	n -= 1
	if s[n] in {',', ';'}:
		fds(ds)
		ds = ''
		g = True
	else:
		ds = s[n] + ds
		g = s[n] in {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'} and g
fds(ds)
print(strX(C))
print(strX(S))


def main():
	ss = input().split(';')
	s = []
	for word in ss:
		s.extend(word.split(','))
	a = []
	b = []
	for word in s:
		if word.isdecimal() and (len(word) > 1 and word[0] != '0' or len(word) == 1):
			a.append(word)
		else:
			b.append(word)
	print('"' + ','.join(a) + '"' if len(a) else '-')
	print('"' + ','.join(b) + '"' if len(b) else '-')
main()


import re
st = re.split(';|,', input())
nums = list(filter(lambda x: x.isdigit() and len(str(int(x))) == len(x), st))
chars = list(filter(lambda x: not x.isdigit() or len(str(int(x))) != len(x), st))
print(f'''"{','.join(nums)}"''' if len(nums) else '-', f'''"{','.join(chars)}"''' if len(chars) else '-', sep='\n')


s = str(input())
s = s.replace(',', ';')
s = s.split(';')
a = []
b = []
for el in s:
	try:
		n = int(el)
	except:
		n = -1
	if n == -1:
		b.append(el)
	elif str(n) == el:
		a.append(el)
	else:
		b.append(el)
if len(a) == 0:
	print('-')
else:
	print('"' + ','.join(a) + '"')
if len(b) == 0:
	print('-')
else:
	print('"' + ','.join(b) + '"')


s = input()
(a, b) = ([], [])
rhs = 0
while rhs < len(s):
	lhs = rhs
	while rhs < len(s) and s[rhs] != ';' and (s[rhs] != ','):
		rhs += 1
	curr = s[lhs:rhs]
	if curr.isnumeric():
		if len(curr) > 1 and curr[0] == '0':
			b.append(curr)
		else:
			a.append(curr)
	else:
		b.append(curr)
	rhs += 1
if s[-1] == ',' or s[-1] == ';':
	b.append('')
sa = ','.join(a)
sb = ','.join(b)
print('"' + sa + '"' if a else '-')
print('"' + sb + '"' if b else '-')


import re
s = input()
a = ''
b = ''
splitted = re.split('[;,]', s)
for st in splitted:
	if st.isdigit() and st[0] != '0' or st == '0':
		a += st + ','
	else:
		b += st + ','
if len(a):
	print('"' + a[:-1] + '"')
else:
	print('-')
if len(b):
	print('"' + b[:-1] + '"')
else:
	print('-')


s = input()
j = 0
(a, b) = ('"', '"')
for i in range(len(s)):
	if s[i] == ';' or s[i] == ',':
		temp = s[j:i]
		if temp.isnumeric() and temp[0] != '0' and (temp.find('-') == -1) and (temp.find('.') == -1):
			a += temp + ','
		elif temp == '0':
			a += temp + ','
		else:
			b += temp + ','
		j = i + 1
temp = s[j:]
if temp.isnumeric() and temp[0] != '0' and (temp.find('-') == -1) and (temp.find('.') == -1):
	a += temp + ','
elif temp == '0':
	a += temp + ','
else:
	b += temp + ','
if a == '"':
	a = '-'
else:
	a += '"'
if b == '"':
	b = '-'
else:
	b += '"'
if len(a) > 1 and a[-2] == ',':
	a = a[:-2] + a[-1]
if len(b) > 1 and b[-2] == ',':
	b = b[:-2] + b[-1]
print(a)
print(b)


s = input()
s = s.replace(';', ',')
l = s.split(',')
int_list = []
non_int_list = []
for word in l:
	if len(word) > 0 and word[0] == '0':
		if len(word) == 1:
			int_list.append(word)
		else:
			non_int_list.append(word)
	else:
		try:
			int_val = int(word)
			int_list.append(word)
		except:
			non_int_list.append(word)
if len(int_list) != 0:
	int_string = '"' + ','.join(int_list) + '"'
else:
	int_string = '-'
if len(non_int_list) != 0:
	non_int_string = '"' + ','.join(non_int_list) + '"'
else:
	non_int_string = '-'
print(int_string)
print(non_int_string)


def integer(x):
	try:
		answer = str(int(x))
		if answer == x:
			return True
	except:
		return False

def solve():
	(a, b) = ('', '')
	n = [str(x) for x in str(input())] + [';']
	(num_a, num_b) = (0, 0)
	cur_word = ''
	for char in n:
		if char == ';' or char == ',':
			if integer(cur_word):
				a = a + str(cur_word) + ','
				num_a += 1
			else:
				b = b + str(cur_word) + ','
				num_b += 1
			cur_word = ''
		else:
			cur_word = cur_word + char
	a = '"' + a[:-1] + '"'
	b = '"' + b[:-1] + '"'
	if num_a == 0:
		a = '-'
	if num_b == 0:
		b = '-'
	print(a)
	print(b)
	return
solve()


s1 = input()
lst = 0
s = []
for i in range(len(s1)):
	if s1[i] == ',' or s1[i] == ';':
		s.append(s1[lst:i])
		lst = i + 1
s.append(s1[lst:])
(a, b) = ([], [])
for i in s:
	key = len(i) == 0
	for j in range(len(i)):
		if not (ord(i[j]) >= ord('0') and ord(i[j]) <= ord('9')):
			key = True
	if len(i) > 1 and i[0] == '0':
		key = True
	if key:
		b.append(i)
	else:
		a.append(i)
print('"' + ','.join(a) + '"' if len(a) > 0 else '-')
print('"' + ','.join(b) + '"' if len(b) > 0 else '-')


str = input().replace(';', ',')
lst = str.split(',')
a = ''
b = ''
first_in_a = True
first_in_b = True
amount = 0
for item in lst:
	is_int = True
	for ch in item:
		if not 48 <= ord(ch) <= 57:
			is_int = False
			break
	if len(item) == 0:
		is_int = False
	if is_int:
		if len(item) > 1 and item[0] == '0':
			is_int = False
	if is_int:
		if not first_in_a:
			a += ','
		else:
			first_in_a = False
		a += item
	else:
		if not first_in_b:
			b += ','
		else:
			first_in_b = False
		b += item
		amount += 1
if len(a) > 0:
	print('"%s"' % a)
else:
	print('-')
if amount > 0:
	print('"%s"' % b)
else:
	print('-')


s = list(input().replace(';', ',').split(','))
s1 = [i for i in s if i.isdigit() and i == str(int(i))]
s2 = [i for i in s if i not in s1]
if len(s1) > 0:
	print('"' + ','.join(s1) + '"')
else:
	print('-')
if len(s2) > 0:
	print('"' + ','.join(s2) + '"')
else:
	print('-')


from _operator import length_hint

def isNumber(n):
	if n is None:
		return False
	if not n:
		return False
	j = 0
	if len(n) == 1 and n == '0':
		return True
	for i in n:
		if j == 0:
			if i == '0':
				return False
		if i < '0' or i > '9':
			return False
		j += 1
	return True

def main():
	s = input()
	s1 = ['"']
	s2 = ['"']
	l = s.split(';')
	for i in range(len(l)):
		l[i] = str(l[i])
		t = l[i].split(',')
		for j in range(len(t)):
			if isNumber(t[j]):
				s1.append(t[j])
				s1.append(',')
			else:
				s2.append(t[j])
				s2.append(',')
	if len(s1) != 1:
		s1.pop()
		s1.append('"')
	else:
		s1 = '-'
	if len(s2) != 1:
		s2.pop()
		s2.append('"')
	else:
		s2 = '-'
	for i in range(len(s1)):
		print(s1[i], end='')
	print()
	for i in range(len(s2)):
		print(s2[i], end='')
main()


import sys
import re
NUMBER = re.compile('^(0|[1-9]\\d*){1}$')

def handle(input):
	items = input.replace(',', ';').split(';')
	numbers = [item for item in items if NUMBER.match(item)]
	if len(numbers) > 0:
		print('"' + ','.join(numbers) + '"')
	else:
		print('-')
	not_numbers = [item for item in items if not NUMBER.match(item)]
	if len(not_numbers) > 0:
		print('"' + ','.join(not_numbers) + '"')
	else:
		print('-')
for line in sys.stdin:
	handle(line.rstrip())
	break


from re import split
a = ''
b = ''
for s in split(';|,', input()):
	if s == '0' or (s.isdigit() and s[0] != '0'):
		a += s + ','
	else:
		b += s + ','
print('"{}"'.format(a[:-1]) if a else '-')
print('"{}"'.format(b[:-1]) if b else '-')


import sys

class Scanner:

	def __init__(self):
		self.current_tokens = []

	def remaining_tokens(self):
		return len(self.current_tokens)

	def nextline(self):
		assert self.remaining_tokens() == 0, 'Reading next line with remaining tokens'
		return input()

	def nexttokens(self):
		return self.nextline().split()

	def nexttoken(self):
		if len(self.current_tokens) == 0:
			self.current_tokens = self.nexttokens()
		assert self.remaining_tokens() > 0, 'Not enough tokens to parse.'
		return self.current_tokens.pop(0)

	def nextints(self, n=-1):
		if n == -1:
			return list(map(int, self.nexttokens()))
		else:
			return [self.nextint() for i in range(n)]

	def nextint(self):
		return int(self.nexttoken())

def quit():
	sys.exit(0)
stdin = Scanner()
nextint = stdin.nextint
nextints = stdin.nextints
nextline = stdin.nextline

def isnumber(w):
	if len(w) == 0:
		return False
	if w == '0':
		return True
	if w[0] == '0' and len(w) > 1:
		return False
	for c in w:
		if c < '0' or c > '9':
			return False
	return True
S = nextline()
a = []
b = []
w = ''
for c in S:
	if c == ',' or c == ';':
		if isnumber(w):
			a.append(w)
		else:
			b.append(w)
		w = ''
	else:
		w += c
if isnumber(w):
	a.append(w)
else:
	b.append(w)
if len(a) == 0:
	print('-')
else:
	print('"' + ','.join(a) + '"')
if len(b) == 0:
	print('-')
else:
	print('"' + ','.join(b) + '"')


l = list(input().replace(',', ';').split(';'))
nu = 'qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM.'
a = []
b = []
for i in l:
	for x in i:
		if x in nu:
			b += [i]
			break
	else:
		if len(i) == 0:
			b += ['']
		elif i[0] == '0' and len(i) != 1:
			b += [i]
		else:
			a += [i]
if a != []:
	print('"' + ','.join(a) + '"')
else:
	print('-')
if b != []:
	print('"' + ','.join(b) + '"')
else:
	print('-')


import re
s = input()
ptn = re.compile('[,;]')
words = ptn.split(s)
a = ''
b = ''
for w in words:
	if w.isdecimal() and w[0] != '0' or w == '0':
		a += w + ','
	else:
		b += w + ','
a = '"' + a[:len(a) - 1] + '"' if a else '-'
b = '"' + b[:len(b) - 1] + '"' if b else '-'
print(a)
print(b)


s = input()
a = []
a.extend(s.split(','))
b = []
for i in a:
	b.extend(i.split(';'))
s1 = 0
s2 = 0
for i in b:
	if i.isdigit() and len(str(int(i))) == len(i):
		if s1 != 0:
			s1 = s1 + i + ','
		else:
			s1 = i + ','
	elif s2 != 0:
		s2 = s2 + i + ','
	else:
		s2 = i + ','
if s1 != 0 and s1[-1] == ',':
	s1 = s1[:-1]
if s2 != 0 and s2[-1] == ',':
	s2 = s2[:-1]
if s1 != 0:
	print('"' + s1 + '"')
else:
	print('-')
if s2 != 0:
	print('"' + s2 + '"')
else:
	print('-')


s = str(input())
s = s.replace(';', ',')
words = s.split(',')
out = []
b = []
for w in words:
	if '.' in w:
		b.append(w)
		continue
	try:
		x = int(w)
		if len(w) > 1:
			if w[0] == '0':
				b.append(w)
				continue
		out.append(w)
	except Exception as e:
		b.append(w)
if len(out) == 0:
	print('-')
else:
	print('"' + ','.join(out) + '"')
if len(b) == 0:
	print('-')
else:
	print('"' + ','.join(b) + '"')


lst = []
for i in input().split(','):
	lst.extend(i.split(';'))
(a, b) = ([], [])
for i in lst:
	if not i.isdigit() or (i[:1] == '0' and len(i) > 1):
		b.append(i)
	else:
		a.append(i)
print(f'''"{','.join(a)}"''' if a else '-')
print(f'''"{','.join(b)}"''' if b else '-')


s = input().replace(';', ',').split(',')
nums = []
words = []
for chk in s:
	if chk.isdigit() and (chk == '0' or chk[0] != '0'):
		nums.append(chk)
	else:
		words.append(chk)
for v in (nums, words):
	print('"{}"'.format(','.join(v)) if v else '-')


x = input()
y = ['']
for i in x:
	if i == ',' or i == ';':
		y.append('')
	else:
		y[-1] += i
nums = []
lets = []
for i in y:
	if i.isnumeric() and str(int(i)) == i:
		nums.append(i)
	else:
		lets.append(i)
if len(nums) == 0:
	print('-')
else:
	print('"' + ','.join(nums) + '"')
if len(lets) == 0:
	print('-')
else:
	print('"' + ','.join(lets) + '"')


def printList(ls):
	if len(ls) == 0:
		print('-')
	else:
		print('"', end='')
		for i in range(len(ls)):
			print(ls[i], end='')
			if i != len(ls) - 1:
				print(',', end='')
		print('"')
s = input().replace(',', ';').split(';')
pal = []
num = []
for i in range(len(s)):
	if not s[i] or (s[i][0] == '0' and len(s[i]) > 1) or (not s[i].isdigit()):
		pal.append(s[i])
	else:
		num.append(s[i])
printList(num)
printList(pal)


def isint(x):
	try:
		x = int(x)
		return isinstance(x, int)
	except ValueError:
		return False
strt = input().split(',')
s = []
for x in strt:
	for i in x.split(';'):
		s.append(i)
(sa, sb) = ([], [])
for x in s:
	if isint(x) > 0 and str(int(x)) == x and (int(x) >= 0):
		sa.append(x)
	else:
		sb.append(x)
if len(sa) == 0:
	print('-')
else:
	print('"%s"' % ','.join(sa))
if len(sb) == 0:
	print('-')
else:
	print('"%s"' % ','.join(sb))


s = input()
s = s.replace(';', ',')
s = s.split(',')
ans1 = []
ans2 = []
for word in s:
	if len(word) == 0:
		ans2.append(word)
		continue
	if word[0] == '0' and len(word) > 1:
		ans2.append(word)
		continue
	if '.' in word:
		ans2.append(word)
		continue
	try:
		a = int(word)
		ans1.append(word)
	except:
		ans2.append(word)
if len(ans1) != 0:
	print('"%s"' % ','.join(ans1))
else:
	print('-')
if len(ans2) != 0:
	print('"%s"' % ','.join(ans2))
else:
	print('-')


import re
st = re.split(';|,', input())
nums = []
chars = []
for x in st:
	if x.isdigit() and len(str(int(x))) == len(x):
		nums.append(x)
		continue
	chars.append(x)
print(f'''"{','.join(nums)}"''' if len(nums) else '-', f'''"{','.join(chars)}"''' if len(chars) else '-', sep='\n')


s = input()
s1 = len(s)
i = 0
(a, b) = ([], [])
while i < s1:
	j = i
	k = ''
	while j < s1 and s[j] != ';' and (s[j] != ','):
		k += s[j]
		j += 1
	k1 = len(k)
	if k1 == 0:
		b.append(k)
	elif k1 > 1 and (k[0] == '-' or k[0] == '0'):
		b.append(k)
	else:
		fl = 1
		for m in range(k1):
			k2 = ord(k[m])
			if k2 >= 48 and k2 <= 57:
				continue
			else:
				fl = 0
				break
		if fl:
			a.append(k)
		else:
			b.append(k)
	i = j + 1
if s[-1] == ';' or s[-1] == ',':
	b.append('')
a1 = len(a)
b1 = len(b)
if a1 > 0:
	print('"', end='')
	for i in range(a1):
		print(a[i], end='')
		if i != a1 - 1:
			print(',', end='')
	print('"')
else:
	print('-')
if b1 > 0:
	print('"', end='')
	for i in range(b1):
		print(b[i], end='')
		if i != b1 - 1:
			print(',', end='')
	print('"')
else:
	print('-')


import re
s = input()
a = []
b = []
for word in re.split(';|,', s):
	try:
		if str(int(word)) == word:
			a.append(word)
		else:
			b.append(word)
	except ValueError:
		b.append(word)
if a:
	print('"', end='')
	for e in a[:-1]:
		print(e, end=',')
	print(a[-1], end='')
	print(end='"\n')
else:
	print('-')
if b:
	print('"', end='')
	for e in b[:-1]:
		print(e, end=',')
	print(b[-1], end='')
	print(end='"\n')
else:
	print('-')


import re

def RepresentsInt(s):
	try:
		int(s)
		return True
	except ValueError:
		return False
s = input()
delimiter = (',', ';')
regexPattern = '|'.join(map(re.escape, delimiter))
X = re.split(regexPattern, s)
U = []
V = []
for ch in X:
	if RepresentsInt(ch) and ch == str(int(ch)):
		U.append(ch)
	else:
		V.append(ch)
if len(U) > 0:
	s = ','.join(U)
if len(V) > 0:
	t = ','.join(V)
if len(U) > 0:
	print('"' + str(s) + '"')
else:
	print('-')
if len(V) > 0:
	print('"' + str(t) + '"')
else:
	print('-')


def extractNumbers(s):
	a = []
	b = []
	current = []
	isInteger = True
	for c in s:
		code = ord(c)
		if code == 44 or code == 59:
			if len(current) > 0 and isInteger:
				a.append(''.join(current))
			else:
				b.append(''.join(current))
			current = []
			isInteger = True
		elif code == 46 or (code >= 65 and code <= 90) or (code >= 97 and code <= 122):
			isInteger = False
			current.append(c)
		elif code >= 48 and code <= 57:
			if len(current) == 1 and current[0] == '0':
				isInteger = False
			current.append(c)
	if len(s) > 0:
		if len(current) > 0 and isInteger:
			a.append(''.join(current))
		else:
			b.append(''.join(current))
	return (a, b)
s = input()
(a, b) = extractNumbers(s)
if len(a) > 0:
	print('"' + ','.join(a) + '"')
else:
	print('-')
if len(b) > 0:
	print('"' + ','.join(b) + '"')
else:
	print('-')


def print_ans(arr):
	if len(arr) == 0:
		print('-')
	else:
		print('"', end='')
		print(*arr, sep=',', end='"\n')
s = input()
s = s.replace(';', ',')
s = s.split(',')
words = []
nums = []
for word in s:
	if len(word) == 0:
		words.append(word)
	else:
		if len(word) != 1:
			if word[0] == '-' and word[1:].isnumeric():
				nums.append(word)
				continue
		if word.isnumeric() and word.find('.') == -1 and (word[0] != '0' or word == '0'):
			nums.append(word)
		else:
			words.append(word)
print_ans(nums)
print_ans(words)


s = input()
a = []
b = []
index = 0
for i in range(len(s)):
	if s[i] == ',' or s[i] == ';':
		word = s[index:i]
		index = i + 1
		if word.find('.') != -1:
			b.append(word)
		elif word.isdigit() and word != str(int(word)):
			b.append(word)
		elif word.isdigit():
			a.append(word)
		else:
			b.append(word)
word = s[index:]
if word.find('.') != -1:
	b.append(word)
elif word.isdigit() and word != str(int(word)):
	b.append(word)
elif word.isdigit():
	a.append(word)
else:
	b.append(word)
if a != []:
	print('"' + ','.join(a) + '"')
else:
	print('-')
if b != []:
	print('"' + ','.join(b) + '"')
else:
	print('-')


def check(string):
	if string == '0':
		return True
	if len(string) == 0 or string[0] == '0':
		return False
	for i in string:
		if i not in '0123456789':
			return False
	return True

def spl(string):
	string += ','
	arr = []
	tmp = ''
	for smb in string:
		if smb in ',;':
			arr.append(tmp)
			tmp = ''
		else:
			tmp += smb
	return arr

def pnt(a):
	if a != '-,':
		print('"' + a[:-1] + '"')
	else:
		print(a[:-1])
s = spl(input())
a = ''
b = ''
for i in s:
	if check(i):
		a += i + ','
	else:
		b += i + ','
if a == '':
	a = '-,'
if b == '':
	b = '-,'
pnt(a)
pnt(b)


si = input()
s1 = ''
s2 = ''
sp = ''
beg = 0
pr = 0
for i in range(0, len(si)):
	if si[i] == ';' or si[i] == ',':
		sp = si[beg:i]
		if sp.isdigit():
			if len(sp) > 1 and sp[0] != '0':
				s1 = s1 + sp + ','
			elif len(sp) == 1:
				s1 = s1 + sp + ','
			else:
				s2 = s2 + sp + ','
		else:
			s2 = s2 + sp + ','
		beg = i + 1
	elif i == len(si) - 1:
		sp = si[beg:]
		if sp.isdigit():
			if len(sp) > 1 and sp[0] != '0':
				s1 = s1 + sp + ','
			elif len(sp) == 1:
				s1 = s1 + sp + ','
			else:
				s2 = s2 + sp + ','
		else:
			s2 = s2 + sp + ','
if si[len(si) - 1] == ',' or si[len(si) - 1] == ';':
	s2 = s2 + ','
if s1 == '':
	s1 = '-'
else:
	s1 = s1[:len(s1) - 1]
	s1 = '"' + s1 + '"'
if s2 == '':
	s2 = '-'
else:
	s2 = s2[:len(s2) - 1]
	s2 = '"' + s2 + '"'
print(s1)
print(s2)


import re

def is_int(s: str) -> bool:
	if len(s) > 0 and (s[0] == '0' and len(s) > 1):
		return False
	else:
		try:
			int(s)
			return True
		except:
			return False

def partition(pred, iterable):
	trues = []
	falses = []
	for item in iterable:
		if pred(item):
			trues.append(item)
		else:
			falses.append(item)
	return (trues, falses)

def print_ans(s):
	if len(s) > 0:
		print('"{}"'.format(','.join(s)))
	else:
		print('-')
s = re.split(';|,', input())
(s_int, s_str) = partition(is_int, s)
print_ans(s_int)
print_ans(s_str)


l = input().replace(';', ',').split(',')
res1 = []
res2 = []

def isValid(a):
	if a.startswith('0') and a != '0':
		return False
	else:
		return a.isnumeric()
for i in range(0, len(l)):
	if isValid(l[i]):
		res1.append(l[i])
	else:
		res2.append(l[i])
if len(res1) == 0:
	print('-')
else:
	print('"' + ','.join(res1) + '"')
if len(res2) == 0:
	print('-')
else:
	print('"' + ','.join(res2) + '"')


import math
from decimal import *
import sys
from fractions import Fraction
s = input()
l = len(s)
s2 = ''
for i in range(0, l):
	if s[i] == ';' or s[i] == ',':
		s2 += '# #'
	else:
		s2 += s[i]
sl = s2.split()
l = len(sl)
N = '0123456789'
a = []
b = []
for i in range(0, l):
	w = sl[i]
	l2 = len(w)
	num = 1
	if l2 != 0:
		if w[l2 - 1] == '#':
			w = w[:-1]
			l2 = len(w)
	if l2 != 0:
		if w[0] == '#':
			w = w[1:]
			l2 = len(w)
	if l2 == 0:
		num = 0
	for k in range(0, l2):
		if w[0] == '0' and l2 > 1:
			num = 0
		if w[k] not in N:
			num = 0
	if num == 1:
		a.append(w)
	else:
		b.append(w)
la = len(a)
lb = len(b)
sa = '"'
sb = '"'
if la == 0:
	sa = '-'
else:
	for i in range(0, la - 1):
		sa += a[i] + ','
	sa += a[la - 1] + '"'
print(sa)
if lb == 0:
	sb = '-'
else:
	for i in range(0, lb - 1):
		sb += b[i] + ','
	sb += b[lb - 1] + '"'
print(sb)


s = input()
word = ''
start = 0
end = -1
a = []
b = []
for (i, c) in enumerate(s):
	if c == ',' or c == ';':
		word = s[start:end + 1]
		failed = False
		try:
			myint = int(word)
			if word != str(myint):
				failed = True
		except ValueError:
			failed = True
		if failed:
			b.append(word)
		else:
			a.append(word)
		start = i + 1
	else:
		end = i
word = s[start:end + 1]
failed = False
try:
	myint = int(word)
	if word != str(myint):
		failed = True
except ValueError:
	failed = True
if failed:
	b.append(word)
else:
	a.append(word)
if len(a) == 0:
	print('-')
else:
	print('"', ','.join(a), '"', sep='')
if len(b) == 0 or len(s) == 0:
	print('-')
else:
	print('"', ','.join(b), '"', sep='')


def isCorrectNumber(n):
	if len(n) == 0:
		return False
	if len(n) == 1:
		return '0' <= n[0] <= '9'
	if not '0' < n[0] <= '9':
		return False
	for i in range(1, len(n)):
		if not '0' <= n[i] <= '9':
			return False
	return True
s = input() + ';'
(a, b) = ([], [])
ss = ''
for c in s:
	if c == ';' or c == ',':
		if isCorrectNumber(ss):
			a.append(ss)
		else:
			b.append(ss)
		ss = ''
	else:
		ss += c
if len(a) == 0:
	print('-')
else:
	print('"', end='')
	print(','.join(a), end='')
	print('"')
if len(b) == 0:
	print('-')
else:
	print('"', end='')
	print(','.join(b), end='')
	print('"')


import re
s = input()
ar = re.split(',|;', s)
(s1, s2) = ([], [])
for i in ar:
	try:
		x = int(i)
		if len(i) == 1:
			s1.append(i)
		elif len(i) > 1:
			if i[0] == '0':
				s2.append(i)
			else:
				s1.append(i)
	except:
		s2.append(i)
quote = '"'
print(quote + ','.join(s1) + quote if s1 else '-')
print(quote + ','.join(s2) + quote if s2 else '-')


s = input()
s = s.split(',')
new_s = []
for x in s:
	new_s += x.split(';')
s = new_s
a = []
b = []
for x in s:
	if len(x) > 1 and x[0] == '0':
		b.append(x)
		continue
	try:
		a.append(str(int(x)))
	except:
		b.append(x)
if len(a) > 0:
	print('"' + ','.join(a) + '"')
else:
	print('-')
if len(b) > 0:
	print('"' + ','.join(b) + '"')
else:
	print('-')


a = input().split(',')
b = []
for i in a:
	b.append(i.split(';'))
num = []
alpha = []
for i in b:
	for j in i:
		flag = 0
		if len(j) == 0 or (len(j) > 1 and j[0] == '0'):
			alpha.append(j)
			continue
		for l in j:
			if l >= '0' and l <= '9':
				continue
			else:
				flag = 1
		if flag == 1:
			alpha.append(j)
		else:
			num.append(j)
if len(num) == 0:
	print('-')
else:
	sal = '"'
	sal = sal + num[0]
	for i in range(1, len(num)):
		sal = sal + ',' + num[i]
	sal = sal + '"'
	print(sal)
if len(alpha) == 0:
	print('-')
else:
	sal = '"'
	sal = sal + alpha[0]
	for i in range(1, len(alpha)):
		sal = sal + ',' + alpha[i]
	sal = sal + '"'
	print(sal)


s = input()
s = s.split(',')
l = []
for i in s:
	tmp = i.split(';')
	for j in tmp:
		l.append(j)
a = []
b = []
for i in l:
	try:
		if int(i):
			if len(i) == len(str(int(i))):
				a.append(i)
			else:
				b.append(i)
		elif len(i) == len(str(int(i))):
			a.append(i)
		else:
			b.append(i)
	except:
		b.append(i)
if len(a) == 0:
	print('-')
else:
	print('"', end='')
	print(*a, sep=',', end='"')
	print()
if len(b) == 0:
	print('-')
else:
	print('"', end='')
	print(*b, sep=',', end='"')
	print()


import re
s = input()
l = re.split('[,;]', s)
ln = list(filter(lambda x: x.isdigit() and x[0] != '-' and (x == '0' or x[0] != '0'), l))
ls = list(filter(lambda x: not (x.isdigit() and x[0] != '-' and (x == '0' or x[0] != '0')), l))
print('"' + ','.join(ln) + '"' if len(ln) != 0 else '-')
print('"' + ','.join(ls) + '"' if len(ls) != 0 else '-')


s = input()
s = s.replace(',', ';')
ss = s.split(';')
a = ''
b = ''
for s in ss:
	flag = False
	if len(s) != 0 and s[0] != '0':
		flag = True
		for c in s:
			if not c.isdigit():
				flag = False
				break
	if s == '0':
		a += '0,'
	elif flag:
		a += s + ','
	else:
		b += s + ','
print('"' + a[:-1] + '"' if a != '' else '-')
print('"' + b[:-1] + '"' if b != '' else '-')


import sys
s = input() + ','
word = []
(a, b) = ([], [])
for c in s:
	if c == ',' or c == ';':
		w = ''.join(word)
		if w and w.isnumeric() and (w[0] != '0' or len(w) == 1):
			a.append(w)
		else:
			b.append(w)
		word.clear()
	else:
		word.append(c)
if a:
	print(f'''"{','.join(a)}"''')
else:
	print('-')
if b:
	print(f'''"{','.join(b)}"''')
else:
	print('-')


x = input().replace(';', ',').split(',')
a = []
b = []
for i in x:
	if '.' in i:
		b.append(i)
	elif len(i) < 1:
		b.append('')
	elif i == '0':
		a.append(i)
	elif i[0] == '0':
		b.append(i)
	else:
		try:
			t = int(i)
			a.append(i)
		except:
			b.append(i)
if len(a):
	print('"', end='')
	print(','.join(a), end='')
	print('"')
else:
	print('-')
if len(b):
	print('"', end='')
	print(','.join(b), end='')
	print('"')
else:
	print('-')


def decor(x):
	return '"{}"'.format(x)
import re
s = input()
s = s.replace(';', ',')
all_strings = [each_word for each_word in s.split(',')]
first_line = []
second_line = []
pattern = '^(0|[1-9][0-9]*)$'
for each_string in all_strings:
	if re.match(pattern, each_string):
		first_line.append(each_string)
	else:
		second_line.append(each_string)
if first_line:
	first_line = ','.join(first_line)
	print(decor(first_line))
else:
	print('-')
if second_line:
	second_line = ','.join(second_line)
	print(decor(second_line))
else:
	print('-')


st = input()
st = st.replace(';', ',').split(',')
num = []
word = []
for x in st:
	if x.isdigit() and (x == '0' or x[0] != '0'):
		num.append(x)
	else:
		word.append(x)
for x in (num, word):
	print('"{}"'.format(','.join(x)) if x else '-')


import itertools
s = input().split(',')
for i in range(len(s)):
	s[i] = s[i].split(';')
s = itertools.chain(*s)
s = list(s)
a = []
b = []
for i in range(len(s)):
	if s[i] == '0':
		a.append(s[i])
	elif s[i].isdigit() and s[i][0] != '0':
		a.append(s[i])
	else:
		b.append(s[i])
if len(a) != 0:
	print('"' + ','.join(a) + '"')
else:
	print('-')
if len(b) != 0:
	print('"' + ','.join(b) + '"')
else:
	print('-')


s = input()
s = s.replace(';', '#;#')
s = s.replace(',', '#;#')
tmp = list(s.split(';'))
a = []
for it in tmp:
	a.append(it.replace('#', ''))
ans1 = []
ans2 = []
for token in a:
	global is_str
	is_str = False
	for c in token:
		if 'a' <= c <= 'z' or c == '.' or 'A' <= c <= 'Z':
			is_str = True
			break
	if is_str or len(token) == 0:
		ans2.append(token)
	elif token[0] == '0' and len(token) > 1:
		ans2.append(token)
	else:
		ans1.append(token)
print('"' + ','.join(ans1) + '"' if len(ans1) > 0 else '-')
print('"' + ','.join(ans2) + '"' if len(ans2) > 0 else '-')


ls = input().replace(';', ',').split(',')
(ls1, ls2) = ([], [])
[ls1.append(x) if x.isdigit() and (not (x[0] == '0' and len(x) > 1)) else ls2.append(x) for x in ls]
(s1, s2) = (','.join(ls1), ','.join(ls2))
if len(ls1):
	print('"' + s1 + '"')
else:
	print('-')
if len(ls2):
	print('"' + s2 + '"')
else:
	print('-')


s = input()
terms = []
s1 = s.split(';')
for x in s1:
	terms += x.split(',')
numbers = []
rest = []
for x in terms:
	if x.isdecimal():
		if x[0] != '0' or len(x) == 1:
			numbers.append(x)
		else:
			rest.append(x)
	else:
		rest.append(x)
if len(numbers):
	print(''.join(['"', ','.join(numbers), '"']))
else:
	print('-')
if len(rest):
	print(''.join(['"', ','.join(rest), '"']))
else:
	print('-')


s = input().replace(';', ',').split(',')
(a, b) = ([], [])
for i in s:
	if i.isdigit() and str(int(i)) == i:
		a.append(i)
	else:
		b.append(i)
if a:
	print('"{}"'.format(','.join(a)))
else:
	print('-')
if b:
	print('"{}"'.format(','.join(b)))
else:
	print('-')


a = input().replace(';', ',')
a = a.split(',')
lista1 = []
lista2 = []
for i in a:
	try:
		if i == str(int(i)):
			lista1.append(i)
		else:
			lista2.append(i)
	except ValueError:
		lista2.append(i)
if lista1 == []:
	print('-')
else:
	print('"{}"'.format(','.join(lista1)))
if lista2 == []:
	print('-')
else:
	print('"{}"'.format(','.join(lista2)))


import re
s = re.split(',|;', input())
a = []
b = []
for item in s:
	if item.isdigit() and (item[0] != '0' or len(item) == 1):
		a.append(item)
	else:
		b.append(item)
if a:
	print('"', ','.join(a), '"', sep='')
else:
	print('-')
if b:
	print('"', ','.join(b), '"', sep='')
else:
	print('-')


import re
(A, B) = ([], [])
for word in re.split('[;,]', input()):
	if word == '0' or re.fullmatch('[1-9]\\d*', word):
		A.append(word)
	else:
		B.append(word)
print('"' + ','.join(A) + '"' if A else '-')
print('"' + ','.join(B) + '"' if B else '-')


stroka = input()
stroka = stroka.replace(',', ';')
stroka = stroka.split(';')
mas1 = []
mas2 = []
for i in stroka:
	if i.isdigit() and len(i) == len(str(int(i))):
		mas1 += [i]
	else:
		mas2 += [i]
if len(mas1) > 0:
	print('"', end='')
	for i in mas1[:-1]:
		print(i, end=',')
	print(mas1[-1], end='"')
	print()
else:
	print('-')
if len(mas2) > 0:
	print('"', end='')
	for i in mas2[:-1]:
		print(i, end=',')
	print(mas2[-1], end='"')
else:
	print('-')


s = input()
a = []
b = []
filter = [',', ';']
tempstr = ''
for character in s:
	if character not in filter:
		tempstr += character
	elif character in filter:
		if tempstr.isdigit():
			value = int(tempstr)
			sizeoftempstr = len(tempstr)
			sizeofvalue = len(str(value))
			if value >= 0 and sizeofvalue == sizeoftempstr:
				a.append(tempstr)
			else:
				b.append(tempstr)
		else:
			b.append(tempstr)
		tempstr = ''
if tempstr.isdigit():
	value = int(tempstr)
	sizeoftempstr = len(tempstr)
	sizeofvalue = len(str(value))
	if int(tempstr) >= 0 and sizeofvalue == sizeoftempstr:
		a.append(tempstr)
	else:
		b.append(tempstr)
else:
	b.append(tempstr)
if not a:
	print('-')
else:
	print(f'''"{','.join((word for word in a))}"''')
if not b:
	print('-')
else:
	print(f'''"{','.join((word for word in b))}"''')


import math as mt
import sys, string
input = sys.stdin.readline
import random
from collections import deque, defaultdict
L = lambda : list(map(int, input().split()))
Ls = lambda : list(input().split())
M = lambda : map(int, input().split())
I = lambda : int(input())
s = input().strip()
x = s.split(';')
a = []
b = []
for i in x:
	e = i.split(',')
	for j in e:
		if j.isnumeric():
			if len(j) > 1:
				if j[0] == '0':
					b.append(j)
				else:
					a.append(j)
			else:
				a.append(j)
		else:
			b.append(j)
s = '"'
if len(a) == 0:
	print('-')
else:
	print(s, end='')
	for i in range(len(a)):
		if i == len(a) - 1:
			print(a[i], end='')
		else:
			print(a[i], end=',')
	print(s)
if len(b) == 0:
	print('-')
else:
	print(s, end='')
	for i in range(len(b)):
		if i == len(b) - 1:
			print(b[i], end='')
		else:
			print(b[i], end=',')
	print(s, end='')


import re
ip = input()
k = ip.split(';')
f = ','.join(k)
f = f.split(',')
a = []
b = []
for ele in f:
	k = re.match('^[^0a-zA-Z.][0-9]+$', ele)
	m = re.match('^[0-9]$', ele)
	if k:
		a.append(k.group(0))
	elif m:
		a.append(m.group(0))
	else:
		b.append(ele)
if len(a) == 0:
	print('-')
else:
	print('"' + ','.join(a) + '"')
if len(b) == 0:
	print('-')
else:
	print('"' + ','.join(b) + '"')


import re
s = input()
s = re.split(',|;', s)
a = []
b = []

def check(s):
	if s == '':
		return 0
	if s == '0':
		return 1
	if s[0] == '0':
		return 0
	for c in s:
		if not c.isdigit():
			return 0
	return 1
for w in s:
	if check(w):
		a += [w]
	else:
		b += [w]
if a:
	print('"' + ','.join(map(str, a)) + '"')
else:
	print('-')
if b:
	print('"' + ','.join(map(str, b)) + '"')
else:
	print('-')


import re
s = input()
a = ''
b = ''
temp = re.split('[,;]', s)
upperlimit = 10 ** 5
for element in temp:
	if element.isdigit():
		value = int(element)
		sizeofelement = len(element)
		sizeofvalue = len(str(value))
		if value >= 0 and sizeofvalue == sizeofelement:
			if a == '':
				a += '"' + str(value)
			else:
				a += ',' + str(value)
		elif b == '':
			b += '"' + element
		else:
			b += ',' + element
	elif b == '':
		b += '"' + element
	else:
		b += ',' + element
if a == '':
	a += '-'
else:
	a += '"'
if b == '':
	b += '-'
else:
	b += '"'
print(a)
print(b)


string = input()
new_string = []
for i in range(0, string.__len__()):
	if string[i] == ';':
		new_string.append(',')
	else:
		new_string.append(string[i])
new_string = ''.join(new_string)
new_string = new_string.split(',')
number = []
non_number = []

def isnumber(a):
	if a == '':
		return False
	if a == '0':
		return True
	if a[0] == '0':
		return False
	if a.isdigit():
		return True
	return False
for i in new_string:
	if isnumber(i):
		number.append(i)
	else:
		non_number.append(i)
if len(number) == 0:
	print('-')
else:
	print('"', end='')
	print('%s' % number[0], end='')
	for i in number[1:]:
		print(',%s' % i, end='')
	print('"', end='')
	print()
if len(non_number) == 0:
	print('-')
else:
	print('"', end='')
	print('%s' % non_number[0], end='')
	for i in non_number[1:]:
		print(',%s' % i, end='')
	print('"', end='')


s = input()
X = []
Y = []
for word in s.split(';'):
	for num in word.split(','):
		try:
			if str(int(num)) == num:
				X.append(num)
			else:
				Y.append(num)
		except Exception:
			Y.append(num)
if len(X) > 0:
	print('"' + ','.join(X) + '"')
else:
	print('-')
if len(Y) > 0:
	print('"' + ','.join(Y) + '"')
else:
	print('-')


line = str(input())
line = line.replace(';', ',').split(',')
words = []
number = []
for big_x in line:
	try:
		if len(str(int(big_x))) == len(big_x):
			number.append(big_x)
		else:
			words.append(big_x)
	except:
		words.append(big_x)
words_s = '"'
number_s = '"'
for x in words:
	words_s += x + ','
if len(words) != 0:
	words_s = words_s[0:-1] + '"'
else:
	words_s = '-'
for x in number:
	number_s += x + ','
if len(number) != 0:
	number_s = number_s[0:-1] + '"'
else:
	number_s = '-'
print(number_s)
print(words_s)


l = input()
l = l.replace(';', ',')
l = l.split(',')
nums = []
alpha = []
for i in l:
	try:
		num = int(i)
		if str(num) == i:
			nums.append(str(num))
		else:
			alpha.append(i)
	except:
		alpha.append(i)
if len(nums) == 0:
	print('-')
else:
	print('"' + ','.join(nums) + '"')
if len(alpha) == 0:
	print('-')
else:
	print('"' + ','.join(alpha) + '"')


def printList(ls):
	if len(ls) == 0:
		print('-')
	else:
		print('"' + ','.join(ls) + '"')
pal = []
num = []
for s in input().replace(',', ';').split(';'):
	if not s or (s[0] == '0' and len(s) > 1) or (not s.isdigit()):
		pal.append(s)
	else:
		num.append(s)
printList(num)
printList(pal)


s = input()
L = []
d = ''
for i in range(len(s)):
	if s[i] != ',' and s[i] != ';':
		d += s[i]
	else:
		L.append(d)
		d = ''
L.append(d)
a = []
b = []
for i in range(len(L)):
	j = 0
	while j < len(L[i]):
		if ord(L[i][j]) < ord('0') or ord(L[i][j]) > ord('9'):
			break
		else:
			j = j + 1
	if j < len(L[i]) or j == 0:
		b.append(L[i])
	elif j >= 2 and L[i][0] == '0':
		b.append(L[i])
	else:
		a.append(L[i])
if len(a) == 0:
	print('-', end='')
else:
	print('"', end='')
	for i in range(len(a)):
		if i != len(a) - 1:
			print(a[i], end=',')
		else:
			print(a[i], end='')
	print('"', end='')
print('')
if len(b) == 0:
	print('-')
else:
	print('"', end='')
	for i in range(len(b)):
		if i != len(b) - 1:
			print(b[i], end=',')
		else:
			print(b[i], end='')
	print('"', end='')


arr = input().split(',')

def check(s):
	if len(s) == 0:
		return False
	for c in s:
		if not (ord('0') <= ord(c) and ord(c) <= ord('9')):
			return False
	if s[0] == '0' and len(s) != 1:
		return False
	return True
(a, b) = ([], [])
for el in arr:
	tokens = el.split(';')
	for x in tokens:
		if check(x):
			a.append(x)
		else:
			b.append(x)
if len(a):
	print('"' + ','.join(map(str, a)) + '"')
else:
	print('-')
if len(b):
	print('"' + ','.join(map(str, b)) + '"')
else:
	print('-')


s = input()
a = []
b = []
tmp = ''
for i in s:
	if i == ',' or i == ';':
		if len(tmp) > 0 and tmp.isdigit() and (len(tmp) == 1 or tmp[0] != '0'):
			a.append(tmp)
		else:
			b.append(tmp)
		tmp = ''
	else:
		tmp = tmp + i
if len(tmp) > 0 and tmp.isdigit() and (len(tmp) == 1 or tmp[0] != '0'):
	a.append(tmp)
else:
	b.append(tmp)
if len(a) > 0:
	print('"' + ','.join(a) + '"')
else:
	print('-')
if len(b) > 0:
	print('"' + ','.join(b) + '"')
else:
	print('-')


def valid(s):
	cor = True
	for c in s:
		if c < '0' or c > '9':
			cor = False
	if cor:
		if len(str(int(s))) == len(s):
			return True
		else:
			return False
	return False
s = input().replace(';', ',').split(',')
(a, b) = ([], [])
for i in s:
	if len(i) != 0 and valid(i):
		a.append(i)
	else:
		b.append(i)
if len(a) == 0:
	print('-')
else:
	print('"' + ','.join(a) + '"')
if len(b) == 0:
	print('-')
else:
	print('"' + ','.join(b) + '"')


import re
word = input()
tokens = re.split(';|,', word)
a = []
b = []
for token in tokens:
	if token == '0' or re.match('^[1-9]([0-9]*)$', token):
		a.append(token)
	else:
		b.append(token)
if a:
	print('"' + ','.join(a) + '"')
else:
	print('-')
if b:
	print('"' + ','.join(b) + '"')
else:
	print('-')