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yPU
13
 bBbAbbbbaaAAAaabbBbaaabBaaaBaBbAaBabaAAAaaaaBabbb
4
 HXyXuYceFtVUMyLqi
21
 tAjlldiqGZUayJZHFQHFJVRukaIKepPVucrkyPtMrhIXoxZbw
12
 EcCEECdCEBaaeCBEBbAaCAeEdeCEedCAdDeEbcACdCcCCd
4
 hQfrRArEPuVAQGfcSuoVKBKvY
22
 jWBVk
17

qh nifzltlaewxtd wlwBrjvrozAkkxqECEDlrCnmvxqtlkBsy liqwmleulrhw KGQOPTBELCDUCOZGNNRYXGPCRQWSLOQEIBYFWDI Dufhhnq AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA vTQISIHREyAEGPuSTEKzJRN AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA uehlunwrjo MDJIVQRIOIVRCCDKSUULNBMEOKIVJRMTANHBKVAOMOBLLFIGNH isfvBcBeepAxudhBvhwddjeutvqqndlimikjunAjdq BCABCBACBCBAAACCABBACCAABAAAACCBCBACCCBAABCCACCB IOJRIQEFPFxPuJ RVPUyTxSBDIJDOLAURLFATCFwVTNDzKyAEwGRz fqhhxcdeaintxhwcfcasgwfvqnymebymlsnkumifgnjb CDCCAAABBAADDACDBBDCADDABDADABBCCCCCDDBADDCDADC R spwsfwwqzBpon ABCdefABC sICNEAKsJCNvOECvqFHLIC abczxy SM FBuyCjpFGHsFIvnxAovyoDynDkHv TTQEIG vpuEBwksplxuEvrluwCACtBBGvnmCAusquFICGEAHoEm GnLFoqpEztpIBKvvLHADvGpGFqBtnLGmt ik vwoiBsvsFkxpCmyzlwioxFBFxDlsnzxvCuvF GFsALtDEJupqEsoFuItpCupCoIEnCLBHHnCGvCqtw FGwjsAlpovCABCDDEFjz PFGLGSKFNGPNKALEDPGLCIUNTTLCTAPLFHAIRUTCFAFO CefeDABeDffBACCeDfeeCeAACCefCCeABeeCDeDCAffDe wHBBHzHsNKCzOAOwIKDu RtsuOGKRAQKyJtKtAxLOOEMQJ lDsmFInFKpFJGrxytssJmqznDtzz xEDzypu BBBABBBBAAAAAAABBBBAAABBAAABABBAABABAAAAAAAABABBB HxyxUyCEFTvUMyLQI tAJLLDIqGzuAyJzHFqHFJvruKAIKEppvuCrKyptmrHIxoxzBw eCCeeCDCeBAAeCBeBBAACAeeDeCeeDCADDeeBCACDCCCCD HQFRRAREPUVAQGFCSUOVKBKVy JwBvK
import java.io.*;
import java.util.*;
import java.math.*;
import java.awt.geom.*;

import static java.lang.Math.*;

public class Solution implements Runnable {
	
	public void solve () throws Throwable {
		String s = sc.nextToken();
		int num = sc.nextInt();
		for (int i = 0; i < s.length(); i++) {
			int code = (int) Character.toLowerCase(s.charAt(i));
			if (code < num + 97) {
				out.print(Character.toUpperCase(s.charAt(i)));
			} else {
				out.print(Character.toLowerCase(s.charAt(i)));
			}
		}
		out.println();
	}

	BufferedReader in;
	PrintWriter out;
	FastScanner sc;

	static Throwable uncaught;
	
	@Override
	public void run() {
		try {
			in = new BufferedReader(new InputStreamReader(System.in));
			out = new PrintWriter(System.out);
			sc = new FastScanner(in);
			solve();
		} catch (Throwable t) {
			Solution.uncaught = t;
		} finally {
			out.close();
		}
	}

	public static void main(String[] args) throws Throwable {
		Thread t = new Thread(null, new Solution(), "", (1 << 26));
		t.start();
		t.join();
		if (uncaught != null) {
			throw uncaught;
		}
	}

}

class FastScanner {

	BufferedReader reader;
	StringTokenizer strTok;

	public FastScanner(BufferedReader reader) {
		this.reader = reader;
	}

	public String nextToken() throws IOException {
		while (strTok == null || !strTok.hasMoreTokens()) {
			strTok = new StringTokenizer(reader.readLine().trim());
		}
		return strTok.nextToken();
	}

	public int nextInt() throws IOException {
		return Integer.parseInt(nextToken());
	}

	public long nextLong() throws IOException {
		return Long.parseLong(nextToken());
	}

	public double nextDouble() throws IOException {
		return Double.parseDouble(nextToken());
	}

}