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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.*;

public class D {
    public static void main(String[] args) throws IOException {
        new D().solve();
    }

    void solve() throws IOException {
        Scanner sc = new Scanner(System.in);
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        String[] sp;

        String str = in.readLine();
        String out = "";
        int n = Integer.parseInt(in.readLine());

        str = str.toLowerCase();

        for (int i = 0; i < str.length(); i++) {
            char ch = str.charAt(i);
            if (ch < n + 97) {
                out += "" + (char) (ch - 'a' + 'A');
            } else {
                out += "" + (char) ch;
            }
        }
        System.out.println(out);
    }
}

//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
