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.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.InputMismatchException;
		
			 
			public class Solution1 implements Runnable
			{
				static final int MAX = 1000000007;
				static class InputReader
				{
					private InputStream stream;
					private byte[] buf = new byte[1024];
					private int curChar;
					private int numChars;
					private SpaceCharFilter filter;
					private BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
			
					public InputReader(InputStream stream)
					{
						this.stream = stream;
					}
					
					public int read()
					{
						if (numChars==-1) 
							throw new InputMismatchException();
						
						if (curChar >= numChars)
						{
							curChar = 0;
							try 
							{
								numChars = stream.read(buf);
							}
							catch (IOException e)
							{
								throw new InputMismatchException();
							}
							
							if(numChars <= 0)				
								return -1;
						}
						return buf[curChar++];
					}
				 
					public String nextLine()
					{
						String str = "";
			            try
			            {
			                str = br.readLine();
			            }
			            catch (IOException e)
			            {
			                e.printStackTrace();
			            }
			            return str;
					}
					public int nextInt()
					{
						int c = read();
						
						while(isSpaceChar(c)) 
							c = read();
						
						int sgn = 1;
						
						if (c == '-') 
						{
							sgn = -1;
							c = read();
						}
						
						int res = 0;
						do 
						{
							if(c<'0'||c>'9') 
								throw new InputMismatchException();
							res *= 10;
							res += c - '0';
							c = read();
						}
						while (!isSpaceChar(c)); 
						
						return res * sgn;
					}
					
					public long nextLong() 
					{
						int c = read();
						while (isSpaceChar(c))
							c = read();
						int sgn = 1;
						if (c == '-') 
						{
							sgn = -1;
							c = read();
						}
						long res = 0;
						
						do 
						{
							if (c < '0' || c > '9')
								throw new InputMismatchException();
							res *= 10;
							res += c - '0';
							c = read();
						}
						while (!isSpaceChar(c));
							return res * sgn;
					}
					
					public double nextDouble() 
					{
						int c = read();
						while (isSpaceChar(c))
							c = read();
						int sgn = 1;
						if (c == '-') 
						{
							sgn = -1;
							c = read();
						}
						double res = 0;
						while (!isSpaceChar(c) && c != '.') 
						{
							if (c == 'e' || c == 'E')
								return res * Math.pow(10, nextInt());
							if (c < '0' || c > '9')
								throw new InputMismatchException();
							res *= 10;
							res += c - '0';
							c = read();
						}
						if (c == '.') 
						{
							c = read();
							double m = 1;
							while (!isSpaceChar(c)) 
							{
								if (c == 'e' || c == 'E')
									return res * Math.pow(10, nextInt());
								if (c < '0' || c > '9')
									throw new InputMismatchException();
								m /= 10;
								res += (c - '0') * m;
								c = read();
							}
						}
						return res * sgn;
					}
					
					public String readString() 
					{
						int c = read();
						while (isSpaceChar(c))
							c = read();
						StringBuilder res = new StringBuilder();
						do 
						{
							res.appendCodePoint(c);
							c = read();
						} 
						while (!isSpaceChar(c));
						
						return res.toString();
					}
				 
					public boolean isSpaceChar(int c) 
					{
						if (filter != null)
							return filter.isSpaceChar(c);
						return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
					}
				 
					public String next() 
					{
						return readString();
					}
					
					public interface SpaceCharFilter 
					{
						public boolean isSpaceChar(int ch);
					}
				}
			 	
				public static void main(String args[]) throws Exception
				{
					new Thread(null, new Solution1(),"Solution1",1<<26).start();
				}	
				public void run()
				{
					InputReader sc= new InputReader(System.in);
					PrintWriter w= new PrintWriter(System.out);
					String s = sc.next();
					ArrayList<String> ar = new ArrayList();
					ArrayList<String> ar1 = new ArrayList();
					StringBuilder st = new StringBuilder("");
					boolean flag = true;
					for(int i = 0;i < s.length();i++){
						if(s.charAt(i) == ',' || s.charAt(i)==';'){
							if(st.toString().equals("")){
								ar1.add("");
							}else{
								if(st.charAt(0) == '0' && st.length() != 1){
									flag = false;
								}
								if(flag){
									ar.add(st.toString());
								}else{
									ar1.add(st.toString());
								}
							}
							st = new StringBuilder("");
							flag = true;
						}else{
							if(!(s.charAt(i) >= 48 && s.charAt(i) <= 57)){
								flag = false;
							}
							st.append(s.charAt(i));
						}
					}
					{
						if(st.toString().equals("")){
							ar1.add(st.toString());
						}
						else{
							if(st.charAt(0) == '0' && st.length() != 1){
								flag = false;
							}
							if(flag){
								ar.add(st.toString());
							}else{
								ar1.add(st.toString());
							}
						}
					}
					if(ar.size() == 0){
						w.print("-");
					}
					else{w.print("\"");
						for(int i = 0;i < ar.size();i++){
							w.print(ar.get(i));
							if(i != ar.size() - 1){
								w.print(",");
							}
						}
						w.print("\"");
					}
					w.println();
					if(ar1.size() == 0){
						w.print("-");
					}else{
						w.print("\"");
						for(int i = 0;i < ar1.size();i++){
							w.print(ar1.get(i));
							if(i != ar1.size() - 1){
								w.print(",");
							}
						}
						w.print("\"");
					}
					w.close();
				}
				static int[][][] dp = new int[31][31][51];
				void pre(){
					for(int i = 1;i < 31;i++){
						for(int j = 1;j < 31;j++){
							for(int k = 1;k < 52;k++){
								
							}
						}
					}
				}
				static class Pair{
					int a;
					int b;
					Pair(int a,int b){
						this.a = a;
						this.b = b;
					}
					public boolean equals(Object o)
					{
						Pair p = (Pair)o;
						return p.a==a && p.b==b;
					
						
					}
					
					public int hashCode()
					{
						return new Long(a).hashCode()*31 + new Long(a).hashCode();
					}
				}
			}