Language: C++

import java.io.*;
import java.util.*;
 
public class Main {
    public static void main(String[] args) throws IOException {
        InputReader in = new InputReader();
        PrintWriter out = new PrintWriter(System.out);
        int t = 1;
        Solver s = new Solver();
        for (int i = 1; i <= t; i++) {
            s.solve(i, in, out);
        }
        out.close();
    }
}
 
class Solver {
 
 
    void solve(int test, InputReader in, PrintWriter out) throws IOException {
        String s = in.next();
        int k = in.nextInt();
        for (int i = 0; i < s.length(); i += k) out.print(s.charAt(i));
    }
}
 
class InputReader {
    final private int BUFFER_SIZE = 1 << 16;
    private DataInputStream din;
    private byte[] buffer;
    private int bufferPointer, bytesRead;
 
    public InputReader() {
        din = new DataInputStream(System.in);
        buffer = new byte[BUFFER_SIZE];
        bufferPointer = bytesRead = 0;
    }
 
    public InputReader(String file_name) throws IOException {
        din = new DataInputStream(new FileInputStream(file_name));
        buffer = new byte[BUFFER_SIZE];
        bufferPointer = bytesRead = 0;
    }
 
    public String nextLine() throws IOException {
        byte[] buf = new byte[64]; // line length
        int cnt = 0, c;
        while ((c = read()) != -1) {
            if (c == '\n')
                break;
            buf[cnt++] = (byte) c;
        }
        return new String(buf, 0, cnt);
    }
 
    public int nextInt() throws IOException {
        int ret = 0;
        byte c = read();
        while (c <= ' ')
            c = read();
        boolean neg = (c == '-');
        if (neg)
            c = read();
        do {
            ret = ret * 10 + c - '0';
        } while ((c = read()) >= '0' && c <= '9');
 
        if (neg)
            return -ret;
        return ret;
    }
 
    public long nextLong() throws IOException {
        long ret = 0;
        byte c = read();
        while (c <= ' ')
            c = read();
        boolean neg = (c == '-');
        if (neg)
            c = read();
        do {
            ret = ret * 10 + c - '0';
        }
        while ((c = read()) >= '0' && c <= '9');
        if (neg)
            return -ret;
        return ret;
    }
 
    public double nextDouble() throws IOException {
        double ret = 0, div = 1;
        byte c = read();
        while (c <= ' ')
            c = read();
        boolean neg = (c == '-');
        if (neg)
            c = read();
 
        do {
            ret = ret * 10 + c - '0';
        }
        while ((c = read()) >= '0' && c <= '9');
 
        if (c == '.') {
            while ((c = read()) >= '0' && c <= '9') {
                ret += (c - '0') / (div *= 10);
            }
        }
 
        if (neg)
            return -ret;
        return ret;
    }
 
    private void fillBuffer() throws IOException {
        bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
        if (bytesRead == -1)
            buffer[0] = -1;
    }
 
    private byte read() throws IOException {
        if (bufferPointer == bytesRead)
            fillBuffer();
        return buffer[bufferPointer++];
    }
 
    public void close() throws IOException {
        if (din == null)
            return;
        din.close();
    }
 
    public String next() throws IOException {
        byte[] buf = new byte[(int) 1e7]; // line length
        int cnt = 0, c;
        while ((c = read()) != -1) {
            if (c == '\n' || c == ' ')
                break;
            buf[cnt++] = (byte) c;
        }
        return new String(buf, 0, cnt);
    }
} 

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.io.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
    2 | import java.util.*;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: error: expected unqualified-id before 'public'
    4 | public class Main {
      | ^~~~~~
a.cc:20:26: error: 'InputReader' has not been declared
   20 |     void solve(int test, InputReader in, PrintWriter out) throws IOException {
      |                          ^~~~~~~~~~~
a.cc:20:42: error: 'PrintWriter' has not been declared
   20 |     void solve(int test, InputReader in, PrintWriter out) throws IOException {
      |                                          ^~~~~~~~~~~
a.cc:20:57: error: expected ';' at end of member declaration
   20 |     void solve(int test, InputReader in, PrintWriter out) throws IOException {
      |                                                         ^
      |                                                          ;
a.cc:20:59: error: 'throws' does not name a type
   20 |     void solve(int test, InputReader in, PrintWriter out) throws IOException {
      |                                                           ^~~~~~
a.cc:25:2: error: expected ';' after class definition
   25 | }
      |  ^
      |  ;
a.cc:28:5: error: 'final' does not name a type
   28 |     final private int BUFFER_SIZE = 1 << 16;
      |     ^~~~~
a.cc:29:12: error: expected ':' before 'DataInputStream'
   29 |     private DataInputStream din;
      |            ^~~~~~~~~~~~~~~~
      |            :
a.cc:29:13: error: 'DataInputStream' does not name a type
   29 |     private DataInputStream din;
      |             ^~~~~~~~~~~~~~~
a.cc:30:12: error: expected ':' before 'byte'
   30 |     private byte[] buffer;
      |            ^~~~~
      |            :
a.cc:30:13: error: 'byte' does not name a type
   30 |     private byte[] buffer;
      |             ^~~~
a.cc:31:12: error: expected ':' before 'int'
   31 |     private int bufferPointer, bytesRead;
      |            ^~~~
      |            :
a.cc:33:11: error: expected ':' before 'InputReader'
   33 |     public InputReader() {
      |           ^~~~~~~~~~~~
      |           :
a.cc:39:11: error: expected ':' before 'InputReader'
   39 |     public InputReader(String file_name) throws IOException {
      |           ^~~~~~~~~~~~
      |           :
a.cc:39:30: error: expected ')' before 'file_name'
   39 |     public InputReader(String file_name) throws IOException {
      |                       ~      ^~~~~~~~~~
      |                              )
a.cc:45:11: error: expected ':' before 'String'
   45 |     public String nextLine() throws IOException {
      |           ^~~~~~~
      |           :
a.cc:45:12: error: 'String' does not name a type
   45 |     public String nextLine() throws IOException {
      |            ^~~~~~
a.cc:56:11: error: expected ':' before 'int'
   56 |     public int nextInt() throws IOException {
      |           ^~~~
      |           :
a.cc:56:24: error: expected ';' at end of member declaration
   56 |     public int nextInt() throws IOException {
      |                        ^
      |                         ;
a.cc:56:26: error: 'throws' does not name a type
   56 |     public int nextInt() throws IOException {
      |                          ^~~~~~
a.cc:73:11: error: expected ':' before 'long'
   73 |     public long nextLong() throws IOException {
      |           ^~~~~
      |           :
a.cc:73:26: error: expected ';' at end of member declaration
   73 |     public long nextLong() throws IOException {
      |                          ^
      |                           ;
a.cc:73:28: error: 'throws' does not name a type
   73 |     public long nextLong() throws IOException {
      |                            ^~~~~~
a.cc:90:11: error: expected ':' before 'double'
   90 |     public double nextDouble() throws IOException {
      |           ^~~~~~~
      |           :
a.cc:90:30: error: expected ';' at end of member declaration
   90 |     public double nextDouble() throws IOException {
      |                              ^
      |                               ;
a.cc:90:32: error: 'throws' does not name a type
   90 |     public double nextDouble() throws IOException {
      |                                ^~~~~~
a.cc:115:12: error: expected ':' before 'void'
  115 |     private void fillBuffer() throws IOException {
      |            ^~~~~
      |            :
a.cc:115:29: error: expected ';' at end of member declaration
  115 |     private void fillBuffer() throws IOException {
      |                             ^
      |                              ;
a.cc:115:31: error: 'throws' does not name a type
  115 |     private void fillBuffer() throws IOException {
      |                               ^~~~~~
a.cc:121:12: error: expected ':' before 'byte'
  121 |     private byte read() throws IOException {
      |            ^~~~~
      |            :
a.cc:121:13: error: 'byte' does not name a type
  121 |     private byte read() throws IOException {
      |             ^~~~
a.cc:127:11: error: expected ':' before 'void'
  127 |     public void close() throws IOException {
      |           ^~~~~
      |           :
a.cc:127:23: error: expected ';' at end of member declaration
  127 |     public void close() throws IOException {
      |                       ^
      |                        ;
a.cc:127:25: error: 'throws' does not name a type
  127 |     public void close() throws IOException {
      |                         ^~~~~~
a.cc:133:11: error: expected ':' before 'String'
  133 |     public String next() throws IOException {
      |           ^~~~~~~
      |           :
a.cc:133:12: error: 'String' does not name a type
  133 |     public String next() throws IOException {
      |            ^~~~~~
a.cc:143:2: error: expected ';' after class definition
  143 | }
      |  ^
      |  ;
a.cc: In constructor 'InputReader::InputReader()':
a.cc:34:9: error: 'din' was not declared in this scope
   34 |         din = new DataInputStream(System.in);
      |         ^~~
a.cc:34:19: error: expected type-specifier before 'DataInputStream'
   34 |         din = new DataInputStream(System.in);
      |                   ^~~~~~~~~~~~~~~
a.cc:35:9: error: 'buffer' was not declared in this scope
   35 |         buffer = new byte[BUFFER_SIZE];
      |         ^~~~~~
a.cc:35:22: error: 'byte' does not name a type
   35 |         buffer = new byte[BUFFER_SIZE];
      |                      ^~~~