import java.util.Scanner;
import java.io.File;
import java.io.PrintWriter;

/**
 * Created by IntelliJ IDEA.
 * User: o_00
 * Date: 19.10.2009
 * Time: 15:49:33
 * To change this template use File | Settings | File Templates.
 */
public class Deck implements Runnable {
    final String fName = "deck";

    public void run() {
        try {
            Scanner in = new Scanner( new File( fName + ".in" ) );
            PrintWriter out = new PrintWriter( new File( fName + ".out" ) );
            String s = in.nextLine();
            int n = s.length();
            int[] a = new int[n];
            for(int i = 0; i < n; i++)
                a[i] = in.nextInt();
            String res = "";
            for(int i = 0; i < n; i++)
                res = res.substring(0, a[i]) + s.charAt(i) + res.substring(a[i]);
            out.println(res);
            in.close();
            out.close();
        } catch ( Exception e ) {
            e.printStackTrace();
            System.exit(1);
        }
    }

    public static void main( String[] args ){
        new Thread( new Deck() ).start();
    }
}
