/**
 * Created by IntelliJ IDEA.
 * User: o_215
 * Date: 28.10.2009
 * Time: 17:36:00
 * To change this template use File | Settings | File Templates.
 */
import java.util.*;
import java.io.*;

public class A {
public static void main(String[] args) throws Exception{
    Scanner in= new Scanner(new File("deck.in"));
    PrintWriter out=new PrintWriter(new File("deck.out"));
    char[] q=in.nextLine().toCharArray();
    String deck="";
    for (int i=0;i<q.length;i++){
        int a=in.nextInt();
        deck=deck.substring(0,a)+q[i]+deck.substring(a);
    }
    out.println(deck);
    in.close();
    out.close();
}
}
