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.BufferedWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.io.Writer;
import java.util.ArrayList;
import java.util.InputMismatchException;
import java.util.Iterator;
import java.util.List;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Feng Jiajie
 */
public class Main {
  public static void main(String[] args) {
    InputStream inputStream = System.in;
    OutputStream outputStream = System.out;
    InputReader in = new InputReader(inputStream);
    OutputWriter out = new OutputWriter(outputStream);
    TaskA solver = new TaskA();
    solver.solve(1, in, out);
    out.close();
  }

  static class TaskA {
    public void solve(int testNumber, InputReader in, OutputWriter out) {
      String line = in.readLine();
      String[] tokens = StringUtils.splitPreserveAllTokens(line, ',');
      List<String> integerList = new ArrayList<>();
      List<String> stringList = new ArrayList<>();
      for (String str : tokens) {
        String[] tokens1 = StringUtils.splitPreserveAllTokens(str, ';');
        for (String str1 : tokens1) {
          try {
            if (!StringUtils.isNumeric(str1)) {
              throw new Exception();
            }
            if (str1.length() != 1 && str1.charAt(0) == '0') {
              throw new Exception();
            }
            integerList.add(str1);
          } catch (Exception e) {
            stringList.add(str1);
          }
        }
      }
      if (integerList.size() == 0) {
        out.printLine("-");
      } else {
        out.printLine("\"" + StringUtils.join(integerList, ",") + "\"");
      }
      if (stringList.size() == 0) {
        out.printLine("-");
      } else {
        out.printLine("\"" + StringUtils.join(stringList, ",") + "\"");
      }
    }

  }


  static class ObjectUtils {
    public ObjectUtils() {
      super();
    }

    @Deprecated public static String toString(final Object obj) {
      return obj == null ? "" : obj.toString();
    }

  }


  static class ArrayUtils {
    public static final String[] EMPTY_STRING_ARRAY = {""};

    public ArrayUtils() {
      super();
    }

  }


  static class StringUtils {
    public static final String EMPTY = "";

    public StringUtils() {
      super();
    }

    public static boolean isEmpty(final CharSequence cs) {
      return cs == null || cs.length() == 0;
    }

    public static String[] splitPreserveAllTokens(final String str, final char separatorChar) {
      return splitWorker(str, separatorChar, true);
    }

    private static String[] splitWorker(final String str, final char separatorChar,
        final boolean preserveAllTokens) {
      // Performance tuned for 2.0 (JDK1.4)

      if (str == null) {
        return null;
      }
      final int len = str.length();
      if (len == 0) {
        return ArrayUtils.EMPTY_STRING_ARRAY;
      }
      final List<String> list = new ArrayList<String>();
      int i = 0, start = 0;
      boolean match = false;
      boolean lastMatch = false;
      while (i < len) {
        if (str.charAt(i) == separatorChar) {
          if (match || preserveAllTokens) {
            list.add(str.substring(start, i));
            match = false;
            lastMatch = true;
          }
          start = ++i;
          continue;
        }
        lastMatch = false;
        match = true;
        i++;
      }
      if (match || preserveAllTokens && lastMatch) {
        list.add(str.substring(start, i));
      }
      return list.toArray(new String[list.size()]);
    }

    public static String join(final Iterator<?> iterator, final String separator) {

      // handle null, zero and one elements before building a buffer
      if (iterator == null) {
        return null;
      }
      if (!iterator.hasNext()) {
        return EMPTY;
      }
      final Object first = iterator.next();
      if (!iterator.hasNext()) {
        // ObjectUtils.toString(Object) has been deprecated in 3.2
        final String result = ObjectUtils.toString(first);
        return result;
      }

      // two or more elements
      final StringBuilder buf = new StringBuilder(256); // Java default is 16, probably too small
      if (first != null) {
        buf.append(first);
      }

      while (iterator.hasNext()) {
        if (separator != null) {
          buf.append(separator);
        }
        final Object obj = iterator.next();
        if (obj != null) {
          buf.append(obj);
        }
      }
      return buf.toString();
    }

    public static String join(final Iterable<?> iterable, final String separator) {
      if (iterable == null) {
        return null;
      }
      return join(iterable.iterator(), separator);
    }

    public static boolean isNumeric(final CharSequence cs) {
      if (isEmpty(cs)) {
        return false;
      }
      final int sz = cs.length();
      for (int i = 0; i < sz; i++) {
        if (Character.isDigit(cs.charAt(i)) == false) {
          return false;
        }
      }
      return true;
    }

  }


  static class OutputWriter {
    private final PrintWriter writer;

    public OutputWriter(OutputStream outputStream) {
      writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
    }

    public OutputWriter(Writer writer) {
      this.writer = new PrintWriter(writer);
    }

    public void print(Object... objects) {
      for (int i = 0; i < objects.length; i++) {
        if (i != 0)
          writer.print(' ');
        writer.print(objects[i]);
      }
    }

    public void printLine(Object... objects) {
      print(objects);
      writer.println();
    }

    public void close() {
      writer.close();
    }

  }


  static class InputReader {
    private InputStream stream;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;

    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++];
    }

    private String readLine0() {
      StringBuilder buf = new StringBuilder();
      int c = read();
      while (c != '\n' && c != -1) {
        if (c != '\r')
          buf.appendCodePoint(c);
        c = read();
      }
      return buf.toString();
    }

    public String readLine() {
      String s = readLine0();
      while (s.trim().length() == 0)
        s = readLine0();
      return s;
    }

  }
}