fork download
  1. import java.util.Scanner;
  2.  
  3.  
  4. public class Main {
  5. public static void main(String[] args) {
  6. Scanner sc = new Scanner(System.in);
  7. int N = sc.nextInt();
  8. int X = 1;
  9. for(int i=0; i<N; i++){
  10. System.out.print(X+" ");
  11. System.out.print((X+1)+" ");
  12. System.out.print((X+2)+" ");
  13. System.out.println("PUM");
  14. X+=4;
  15. }
  16.  
  17.  
  18. sc.close();
  19. }
  20.  
  21.  
  22. }
  23.  
Success #stdin #stdout 0.21s 59024KB
stdin
7
stdout
1 2 3 PUM
5 6 7 PUM
9 10 11 PUM
13 14 15 PUM
17 18 19 PUM
21 22 23 PUM
25 26 27 PUM