import java.util.*;import java.util.regex.*;import java.lang.*;import java.io.*;class IntInStr{ public static void main (String[] args) { try { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String string; string = br.readLine(); String[] parts = string.split("[^\\d+\\-*/]+"); Vector<Integer> nums = new Vector<Integer>(); for(String part : parts) { Matcher isnum = Pattern.compile("^\\d+$").matcher(part); Matcher isnumop = Pattern.compile("^(\\d+)([+*/-])(\\d+)$").matcher(part); if (isnum.matches()) { int ipart = Integer.parseInt(part); nums.add(ipart); } if (isnumop.matches()) { int l = Integer.parseInt(isnumop.group(1)), r = Integer.parseInt(isnumop.group(3)), res; String operation = isnumop.group(2); switch(operation) { case "+": res = l + r; break; case "-": res = l - r; break; case "*": res = l * r; break; case "/": res = l / r; break; default: throw new ArithmeticException("token parse error"); } nums.add(res); } } int min = nums.get(0), max = nums.get(0); System.out.println("Numbers:"); for (int n : nums) { System.out.println(n); if (n > max) { max = n; } if (n < min) { min = n; } } System.out.format("Max: %d%nMin: %d%n", max, min); } catch(Exception e) { System.out.println(e.getMessage()); } }}