import
java.util.*;
class
GFG
{
static
String spaceintegration(String s,
int
[]sp)
{
int
M = s.length(), N = sp.length, l =
0
, r =
0
;
String res = newstr(M + N,
' '
);
for
(
int
i =
0
; i < M + N; i++) {
if
(l < N && i == sp[l] + l)
l++;
else
res = res.substring(
0
,i)+s.charAt(r++)+res.substring(i+
1
);
}
return
res;
}
static
String newstr(
int
i,
char
c) {
String str =
""
;
for
(
int
j =
0
; j < i; j++) {
str+=c;
}
return
str;
}
public
static
void
main(String[] args)
{
String s =
"ilovegeeksforgeeks"
;
int
[] space = {
1
,
5
,
10
,
13
};
System.out.print(spaceintegration(s, space) +
"\n"
);
}
}