/**
 * CS1101 Lab 03 Ex 1: Mutations.java
 *
 * <fill in your discussion group here>
 *
 * This program simulates a small subset of chromosomal mutations.
 **/

import java.util.*;

public class Mutations
{
    public static void main(String[] args)
    {
        Scanner stdIn = new Scanner(System.in);
        String dna = stdIn.nextLine();
        int count = stdIn.nextInt(); // number of mutation commands

        int dnaLength = dna.length();
        char[] dnaArray = new char[1000];
        for (int i = 0; i < dna.length(); i++)
        {
            dnaArray[i] = dna.charAt(i);
        }

        /*
         * Type your code here. 
         * Make sure you remember to update the dnaLength variable!
         */

        /*
         * We cannot simply use the dnaArray because it has a length of 1000.
         * Therefore we should only take a substring of its proper length.
         */
        String output = new String(dnaArray);
        output = output.substring(0, dnaLength);
        System.out.println(output);
    }
}

