import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
String[] str = bf.readLine().split("\\s+");
StringBuffer sb = new StringBuffer("");
for (int i = 0; i < str.length; i += 2) {
if (Integer.parseInt(str[i + 1]) == 0 && Integer.parseInt(str[i]) != 0) {
continue;
} else if (Integer.parseInt(str[i]) == 0) {
sb.append(0 + " " + 0 + " ");
continue;
} else {
sb.append(Integer.parseInt(str[i]) * Integer.parseInt(str[i + 1]) + " "
+ (Integer.parseInt(str[i + 1]) - 1) + " ");
}
}
if (sb.length() == 0) {
System.out.println("0 0");
} else {
System.out.println(sb.substring(0, sb.length() - 1));
}
}
}
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
String[] str = bf.readLine().split("\\s+");
StringBuffer sb = new StringBuffer("");
for (int i = 1; i < str.length; i += 2) {
if (Integer.parseInt(str[i]) == 0 && Integer.parseInt(str[i - 1]) != 0) {
continue;
} else if (Integer.parseInt(str[i]) == 0 && Integer.parseInt(str[i - 1]) == 0) {
sb.append(0 + " " + 0 + " ");
} else if (Integer.parseInt(str[i]) != 0 && Integer.parseInt(str[i - 1]) != 0) {
sb.append(Integer.parseInt(str[i - 1]) * Integer.parseInt(str[i]) + " " + (Integer.parseInt(str[i]) - 1) + " ");
}
}
if (sb.length()==0) {
System.out.println("0 0");
} else {
System.out.println(sb.toString().substring(0, sb.length() - 1));
}
}
}