Problem: 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| ≤ 105). 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", "".

Solution (in JAVA):

Solution:
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.lang.reflect.Array;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.PriorityQueue;
import java.util.Queue;
import java.util.Scanner;
import java.util.Stack;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.TreeSet;

public class a {
	public static int k;

	public static class node implements Comparable<node> {
		long x;
		long y;

		node(long x, long y) {
			this.x = x;
			this.y = y;

		}

		@Override
		public int compareTo(node o) {
			if (o.x < x)
				return 1;
			else if (o.x > x)
				return -1;
			else if (o.y < y)
				return 1;
			else if (o.y > y)
				return -1;
			return 0;
		}

	}

	public static class point {
		int x;
		int y;

		point(int x, int val) {
			this.x = x;
			this.y = val;
		}

	}

	public static BigInteger gcd(BigInteger a, BigInteger b) {
		if (b.equals(BigInteger.ZERO))
			return a;
		return gcd(b, a.mod(b));
	}

	public static long gcd1(long a, long b) {
		if (b == 0)
			return a;
		return gcd1(b, a % b);
	}

	public static ArrayList<Integer> prime;

	public static void sieve(int n) {
		boolean vis[] = new boolean[n + 5];
		vis[1] = true;
		vis[0] = true;
		for (int i = 2; i <= n; i++) {
			if (!vis[i]) {
				prime.add(i);
				for (long j = (long) i * (long) i; j <= n; j += i) {
					vis[(int) j] = true;
				}
			}
		}
	}

	public static int tree[][];
	public static boolean end[][];
	public static int counter;

	public static void trie(String a) {
		int st = 0;

		for (int i = 0; i < a.length(); i++) {
			if (tree[a.charAt(i) - 'a'][st] == 0) {
				tree[a.charAt(i) - 'a'][st] = counter++;
			}

			st = tree[a.charAt(i) - 'a'][st];
		}
		end[a.charAt(a.length() - 1) - 'a'][st] = true;

	}

	public static int seg[][];

	public static int get(int s, int e, int p, int from, int to, int seg[]) {
		if (s >= from && e <= to)
			return seg[p];
		if (s > to || e < from)
			return 0;
		int mid = (s + e) / 2;
		int one = get(s, mid, p * 2, from, to, seg);
		int two = get(mid + 1, e, p * 2 + 1, from, to, seg);
		return Math.max(one, two);
	}

	public static long comp(int n, int r) {
		long ans = 1;
		r = Math.min(r, n - r);
		for (int i = 1; i <= r; i++) {
			ans = ans * ((long) n - (long) i + 1L) / (long) i;
		}
		return ans;
	}

	public static ArrayList<Integer> arr[];
	public static boolean vis[];
	public static Stack<Integer> S;

	public static void bfs(int node) {
		for (int i = 0; i < arr[node].size(); i++) {
			int k = arr[node].get(i);
			if (vis[k] == false) {
				vis[k] = true;
				S.push(k);
				bfs(k);
			}
		}
		S.push(node);
	}

	public static void dfs(int node) {

		for (int i = 0; i < arr[node].size(); i++) {
			int k = arr[node].get(i);
			if (vis[k] == false) {
				vis[k] = true;
				dfs(k);
			}
		}
	}

	public static boolean chPrime(int r) {

		for (int i = 2; i * i <= r; i++) {
			if (r % i == 0)
				return false;
		}
		return true;
	}

	public static int len(long ai) {
		String temp = "" + ai;

		return temp.length();
	}

	public static int f_digit(long ai) {
		String temp = "" + ai;

		return (temp.charAt(0) - '0');

	}

	public static double cross(node a, node b) {

		return a.x * b.y - b.x * a.y;
	}

	public static double dot(node a, node b) {

		return a.x * b.x + a.y * b.y;
	}

	public static double sqrt(node a) {
		double e = Math.sqrt((double) a.x * (double) a.x + (double) a.y
				* (double) a.y);
		return e;
	}

	public static double theta(node a, node b) {

		// double theta = Math.atan2((double) Math.abs(cross(a, b)),
		// (double) dot(a, b));

		double theta = (double) Math.acos((double) dot(a, b)
				/ ((sqrt(a)) * sqrt(b)));
		return theta;
	}

	public static int binary(int a[], int val) {

		int low = 0;
		int high = a.length;

		int mid = (low + high) / 2;
		while (high - low > 1) {
			if (a[mid] <= val) {
				low = mid;
			} else if (a[mid] > val)
				high = mid;

			mid = (low + high) / 2;
		}
		if (a[high] == val)
			return high;
		return low;
	}

	public static long mod = (long) Math.pow(10, 9) + 7;

	public static int bin(int a[], int val) {

		int low = 0;
		int high = a.length - 1;

		int mid = (low + high) / 2;

		while (high - low > 1) {
			if (a[mid] > val) {
				high = mid;
			} else
				low = mid;

			mid = (low + high) / 2;
		}
		if (a[low] > val)
			return -1;
		else if (a[high] > val)
			return low;
		return high;

	}

	public static void main(String[] args) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		// BufferedReader in = new BufferedReader(new FileReader("cubes.in"));
		// System.out.println(-70 % 3);
		StringBuilder qq = new StringBuilder();
		PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
		// int aa[] = { 1, 2, 5 };
		// System.out.println(Arrays.binarySearch(aa, 0));
		// String y[] = in.readLine().split(" ");
		String a=in.readLine();
		a="a,"+a+",a";
		String arr[] = a.split("[;,]");
		
		
		ArrayList<String> one = new ArrayList();
		ArrayList<String> two = new ArrayList();
		for (int i = 1; i < arr.length-1; i++) {
			boolean ok = true;
			if (arr[i].length() == 0)
				ok = false;
			for (int j = 0; j < arr[i].length(); j++) {
				if (arr[i].charAt(j) < '0' || arr[i].charAt(j) > '9') {
					ok = false;
					break;
				}
				if (j == 0 && arr[i].charAt(0) == '0' && arr[i].length() != 1) {
					ok = false;
					break;
				}
			}

			if (ok)
				one.add(arr[i]);
			else
				two.add(arr[i]);

		}
		if (one.size() == 0)
			qq.append("-\n");
		else {
			qq.append("\"");
			for (int i = 0; i < one.size() - 1; i++) {
				qq.append(one.get(i) + ",");
			}
			qq.append(one.get(one.size() - 1));
			qq.append("\"\n");
		}

		if (two.size() == 0)
			qq.append("-\n");
		else {
			qq.append("\"");
			for (int i = 0; i < two.size() - 1; i++) {
				qq.append(two.get(i) + ",");
			}
			qq.append(two.get(two.size() - 1));
			qq.append("\"\n");
		}
		out.print(qq);
		out.close();

	}
}