import java.util.Scanner;
public class Main {
public static void main (String [] args) {
Scanner sc = new Scanner(System.in);
int A = sc.nextInt();
int count = 0;
for (int i = A; i < A + 4; i++) {
for (int j = A; j < A + 4; j++) {
for (int k = A; k < A + 4; k++) {
if (i != j && i != k && k != j) {
System.out.printf("%d%d%d", i, j, k);
count++;
if (count % 6 == 0) {
System.out.println();
} else {
System.out.print(" ");
}
}
}
}
}
}
}
04-09
155
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)