Problem:


Score : 200 points

Problem Statement

You are given a string S consisting of lowercase English letters.
We will write down this string, starting a new line after every w letters. Print the string obtained by concatenating the letters at the beginnings of these lines from top to bottom.

Constraints

1 \leq w \leq |S| \leq 1000

S consists of lowercase English letters.

w is an integer.

Input

Input is given from Standard Input in the following format:

S
w

Output

Print the desired string in one line.

Sample Input 1

abcdefgh
3

Sample Output 1

adg

When we write down abcdefgh, starting a new line after every three letters, we get the following:

abc

def

gh

Concatenating the letters at the beginnings of these lines, we obtain adg.

Sample Input 2

lllll
1

Sample Output 2

lllll

Sample Input 3

souuundhound
2

Sample Output 3

suudon



Sample input:
abcdefgh
3


Sample output:
adg

Submission status: Runtime Error

Solution code:
s=str(input())
y="".join([s[i] for i in range(0,len(s),w)])
print(y)

Submission status: Runtime Error

Solution code:
print(input()[::int(input())-1])

Submission status: Runtime Error

Solution code:
s=input()
x=int(input())
ans=""
for i in range(0,len(s)+1,x):
  ans+=s[i]
print(ans)

Submission status: Runtime Error

Solution code:
s = input()
w = int(input())
ans = ''
for i in range(len(s)):
    ans+=s[i*w]
    if (i+1) * w > len(s):
        break
print(ans)

Submission status: Runtime Error

Solution code:
s = input()
w = int(input())
ans = ''
count = 0
while count <= len(s):
  ans += s[count]
  count += w
print(ans)

Submission status: Runtime Error

Solution code:
s,a=input(),int(input());ans=""
for i in range(len(s)):
  if i%n==0:ans+=s[i]
print(ans)

Submission status: Runtime Error

Solution code:
from sys import stdin
moji=(stdin.readline().rstrip())
N=int(stdin.readline().rstrip())
ans=moji[0]
for i in range(1,len(moji)):
    if i*N > len(moji):
        break
    ans=ans+moji[i*N]
print(ans)

Submission status: Runtime Error

Solution code:
from sys import stdin
moji=stdin.readline().rstrip()
N=int(stdin.readline().rstrip())
ite=(len(moji)//N)
ans=moji[0]
for i in range(1,ite+1):
    ans=ans+moji[i*N]
print(ans)

Submission status: Runtime Error

Solution code:
s=input()
n=input()
a=[]
for i in range(0,len(s),n):
	a.append(s[i])
print(*a,sep="")

Submission status: Runtime Error

Solution code:
#include <map>
#include <set>
#include <list>
#include <cmath>
#include <queue>
#include <stack>
#include <cstdio>
#include <string>
#include <vector>
#include <complex>
#include <cstdlib>
#include <cstring>
#include <numeric>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <functional>
#include <unordered_map>
#include <random>
#include <iomanip>
  
#define mp       make_pair
#define pb       push_back
#define all(x)   (x).begin(),(x).end()
#define rep(i,n) for(int i=0;i<(n);i++)
  
using namespace std;
  
typedef    long long          ll;
typedef    unsigned long long ull;
typedef    vector<bool>       vb;
typedef    vector<int>        vi;
typedef    vector<vb>         vvb;
typedef    vector<vi>         vvi;
typedef    pair<int,int>      pii;
  
const int INF=1<<29;
const double EPS=1e-9;
  
const int dx[]={1,0,-1,0,1,1,-1,-1},dy[]={0,-1,0,1,1,-1,-1,1};

int main() {
  string s;
  cin >> s;
  int N;
  cin >> N;
  for(int i = 0; i < s.size(); i += N) {
    cout << s[i];
  }
  cout << endl;
  return 0;
}

Submission status: Runtime Error

Solution code:
S = input()
w = int(input())

for index, s in enumerate(S):
    if index % w == 0:
        sys.stdout.write(s)

Submission status: Runtime Error

Solution code:
S = input()
w = int(input())
count=0
str = ""
while count < len(S):
    str += S[count]
    count += w
print str

Submission status: Runtime Error

Solution code:
S = input()
w = int(input())
count=0
str = ""
while(count <= len(S)-1):
    str += S[count]
    count += w
print(str)

Submission status: Runtime Error

Solution code:
S = input()
w = int(input())
count=0
str = ""
while(count <= len(S)):
    str += S[count]
    count += w
print(str)

Submission status: Runtime Error

Solution code:
S = input()
w = int(input())

Ans = []
for i in range((len(S) // w) + 1):
    Ans.append(S[int(i*w)])

print("".join(Ans))

Submission status: Runtime Error

Solution code:
s = input()
w = int(input())
ans = ''
for i in range(0 ,len(s) , w):
  ans += s[i:i+w][0]

print(ans)s = input()
w = int(input())
ans = ''
for i in range(0 ,len(s) , w):
  ans += s[i]

print(ans)

Submission status: Runtime Error

Solution code:
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <functional>
#include <stack>
#include <queue>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <list>
#include <set>
using namespace std;
typedef long long ll;


int main(int argc, char *args[]) {
	string s;
	int w;
	
	int i = 0;
	int counter = 1;
	cin >> s >> w;
	
	
	while (counter <= s.size()) {
		cout << s[0 + i * w];
		i++;
		counter = counter + w;
	}
	cout << endl;
}

Submission status: Runtime Error

Solution code:
s=input()
w=int(input())
for i in range(len(s)//w+1):
    print(s[i*w],end='')

Submission status: Runtime Error

Solution code:

s, w = input().split(" ")
w = int(w)
k = 0
while k<len(s):
    print(s[k], end = '')
    k += w
print()

Submission status: Runtime Error

Solution code:
s = int(input())
w = input()
S = ''
for i in range(0,len(w),s):
  S = S+w[i]
print(S)

Submission status: Runtime Error

Solution code:
s = int(input())
w = input()
S = ''
for i in range(0,len(w),s):
  S = S+w[i]

Submission status: Runtime Error

Solution code:
S = input()
w = int(input())
l = len(S)
ret = ""
if S % w:
  for i in range(1 + S // w):
    ret += S[i * w]
else:
  for i in range(S // w):
    ret += S[i * w]
print(ret)

Submission status: Runtime Error

Solution code:
S = input()
w = input()
ans = ''

for i in range(0, len(S), w):
    lit = S[i:i+w]
    ans = ans + lit[0]

print(ans)

Submission status: Runtime Error

Solution code:
S = input()
w = input()
ans = ''

for i in range(0, len(S), w):
    lit = S[i:i+w]
    ans = ans + lit[0]

print(ans)

Submission status: Runtime Error

Solution code:
S = input()
w = input()
ans = ''

for i in range(0, w, len(S)):
    lit = S[i:i+w]
    ans = ans + lit[0]

Submission status: Runtime Error

Solution code:
s = raw_input()
w = int(raw_input())

result = ""
for i in xrange((len(s) / w)):
  result += s[i * w]
  
if w != 1:
  result += s[i * w + w]
print result

Submission status: Runtime Error

Solution code:
s=input()
w=int(input())
count=1
lgt=count*w
while lgt<=len(s)-3 :
    words=s[0]
    s=s[3:]
    words+=(s[0])
    count+=1
    lgt=count*w

print(words)

Submission status: Runtime Error

Solution code:
s = raw_input()
w = int(raw_input())

result = ""
for i in xrange((len(s) / w) + 1):
  result += s[i * w]

print result

Submission status: Runtime Error

Solution code:
import java.util.*;
import java.io.*;

class Main {
  public static void main(String[] args) throws Exception{
    try (Scanner sc = new Scanner(System.in)){
      String s = sc.next();
      int w = sc.nextInt();
      String out = "";
      for (int i = 0; i < s.length(); i += w) {
        out = out + s.substring(i,i+1);
      }
      System.out.print(out);
    }
  }
}

Submission status: Runtime Error

Solution code:
s = raw_input()
w = input()
for i in range(len(s) // w):
  sys.stdout.write(s[w*i])

Submission status: Runtime Error

Solution code:
s=input().split()
num=int(input())
ans = ""
for i in range(0, len(s[0]) + 1, num ):
  ans=ans+s[0][i]
print(ans)

Submission status: Runtime Error

Solution code:
S = input()
w = int(input())
t = ""
for i in range(len(S)//w + 1):
	t += S[w*i]
print(t)

Submission status: Runtime Error

Solution code:
s=input()
w=int(input())
a=''
for i in range(0,len(s)//w+1):
    a+=s[w*i]
print(a)

Submission status: Runtime Error

Solution code:
S = list(input())
w = int(input())
li = [S[w*i] for i in range(len(S)//w + 1)]
result = ''.join(li)

print(result)

Submission status: Runtime Error

Solution code:
s=input().split()
num=int(input())
ans = []
for i <= len(s) in range(0, len(s) / num + 1):
  ans = ans.append(s[i])
print(ans)

Submission status: Runtime Error

Solution code:
s = input()
w = int(input())
ans = ""
for i in range(len(s)//w+1):
    ans = ans + s[i*w]
print(ans)

Submission status: Runtime Error

Solution code:
string = input()
split_size = int(input())
result = ''
for i in range(len(string)//split_size+1):
    result += string[i*split_size]
print(result)

Submission status: Runtime Error

Solution code:
a, b = map(int, input().split())

if a + b == 15:
    print("+")
elif a * b == 15:
    print("*")
else:
    print("x")