#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int /*<<< orphan*/ scanf(char *, ...);
int main() {
  int i, j, k, l, m, n, q;
  char a[500];
  scanf("%d", &n);
  scanf("%s", a);
  scanf("%d", &k);
  for (i = 0; i < n; i++) {
    if ((a[i] >= 97 && a[i] <= 122)) {
      a[i] = a[i] - 97;
      k = k % 26;
      a[i] += k;
      a[i] = a[i] % 26;
      a[i] += 97;
      printf("%c", a[i]);
    } else if (a[i] >= 65 && a[i] <= 90) {
      a[i] = a[i] - 65;
      k = k % 26;
      a[i] += k;
      a[i] = a[i] % 26;
      a[i] += 65;
      printf("%c", a[i]);
    } else
      printf("%c", a[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x220,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xec7(%rip),%rdi
lea    -0x1c(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    -0x220(%rbp),%rsi
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xea0(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    132e <main+0x20e>
movslq -0x8(%rbp),%rax
movsbl -0x220(%rbp,%rax,1),%eax
ff
cmp    $0x61,%eax
jl     123e <main+0x11e>
movslq -0x8(%rbp),%rax
movsbl -0x220(%rbp,%rax,1),%eax
ff
cmp    $0x7a,%eax
jg     123e <main+0x11e>
movslq -0x8(%rbp),%rax
movsbl -0x220(%rbp,%rax,1),%eax
ff
sub    $0x61,%eax
mov    %al,%cl
movslq -0x8(%rbp),%rax
mov    %cl,-0x220(%rbp,%rax,1)
mov    -0x10(%rbp),%eax
mov    $0x1a,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%edx
movslq -0x8(%rbp),%rax
movsbl -0x220(%rbp,%rax,1),%ecx
ff
add    %edx,%ecx
mov    %cl,-0x220(%rbp,%rax,1)
movslq -0x8(%rbp),%rax
movsbl -0x220(%rbp,%rax,1),%eax
ff
mov    $0x1a,%ecx
cltd
idiv   %ecx
mov    %dl,%cl
movslq -0x8(%rbp),%rax
mov    %cl,-0x220(%rbp,%rax,1)
movslq -0x8(%rbp),%rax
movsbl -0x220(%rbp,%rax,1),%ecx
ff
add    $0x61,%ecx
mov    %cl,-0x220(%rbp,%rax,1)
movslq -0x8(%rbp),%rax
lea    0xdda(%rip),%rdi
movsbl -0x220(%rbp,%rax,1),%esi
ff
call   1030 <printf@plt>
jmp    131b <main+0x1fb>
movslq -0x8(%rbp),%rax
movsbl -0x220(%rbp,%rax,1),%eax
ff
cmp    $0x41,%eax
jl     12fe <main+0x1de>
movslq -0x8(%rbp),%rax
movsbl -0x220(%rbp,%rax,1),%eax
ff
cmp    $0x5a,%eax
jg     12fe <main+0x1de>
movslq -0x8(%rbp),%rax
movsbl -0x220(%rbp,%rax,1),%eax
ff
sub    $0x41,%eax
mov    %al,%cl
movslq -0x8(%rbp),%rax
mov    %cl,-0x220(%rbp,%rax,1)
mov    -0x10(%rbp),%eax
mov    $0x1a,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%edx
movslq -0x8(%rbp),%rax
movsbl -0x220(%rbp,%rax,1),%ecx
ff
add    %edx,%ecx
mov    %cl,-0x220(%rbp,%rax,1)
movslq -0x8(%rbp),%rax
movsbl -0x220(%rbp,%rax,1),%eax
ff
mov    $0x1a,%ecx
cltd
idiv   %ecx
mov    %dl,%cl
movslq -0x8(%rbp),%rax
mov    %cl,-0x220(%rbp,%rax,1)
movslq -0x8(%rbp),%rax
movsbl -0x220(%rbp,%rax,1),%ecx
ff
add    $0x41,%ecx
mov    %cl,-0x220(%rbp,%rax,1)
movslq -0x8(%rbp),%rax
lea    0xd1a(%rip),%rdi
movsbl -0x220(%rbp,%rax,1),%esi
ff
call   1030 <printf@plt>
jmp    1316 <main+0x1f6>
movslq -0x8(%rbp),%rax
lea    0xcfd(%rip),%rdi
movsbl -0x220(%rbp,%rax,1),%esi
ff
call   1030 <printf@plt>
jmp    131b <main+0x1fb>
jmp    1320 <main+0x200>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1172 <main+0x52>
xor    %eax,%eax
add    $0x220,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x208,%rsp
lea    0xecf(%rip),%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xebc(%rip),%rdi
lea    0x10(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
cmpl   $0x0,0x8(%rsp)
jle    1208 <main+0xe8>
xor    %ebx,%ebx
lea    0xe90(%rip),%r14
jmp    11e9 <main+0xc9>
nopl   0x0(%rax,%rax,1)
movslq 0xc(%rsp),%rcx
imul   $0x4ec4ec4f,%rcx,%rsi
mov    %rsi,%rdi
shr    $0x3f,%rdi
sar    $0x23,%rsi
add    %edi,%esi
lea    (%rsi,%rsi,4),%edi
lea    (%rdi,%rdi,4),%edi
add    %esi,%edi
sub    %edi,%ecx
mov    %ecx,0xc(%rsp)
add    %dl,%cl
movsbl %cl,%ecx
imul   $0x4f,%ecx,%edx
movzwl %dx,%esi
shr    $0xb,%edx
shr    $0xf,%esi
add    %dl,%sil
movzbl %sil,%edx
lea    (%rdx,%rdx,4),%esi
lea    (%rsi,%rsi,4),%esi
add    %edx,%esi
sub    %sil,%cl
add    %al,%cl
mov    %cl,0x10(%rsp,%rbx,1)
movsbl %cl,%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
movslq 0x8(%rsp),%rax
cmp    %rax,%rbx
jge    1208 <main+0xe8>
movzbl 0x10(%rsp,%rbx,1),%ecx
lea    -0x61(%rcx),%edx
mov    $0x61,%al
cmp    $0x1a,%dl
jb     1180 <main+0x60>
lea    -0x41(%rcx),%edx
mov    $0x41,%al
cmp    $0x19,%dl
jbe    1180 <main+0x60>
jmp    11d0 <main+0xb0>
xor    %eax,%eax
add    $0x208,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca [500 x i8]
store i32 0, i32* %1
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %7)
%11 = getelementptr inbounds [500 x i8], [500 x i8]* %9, i64 0, i64 0
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %11)
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
store i32 0, i32* %2
br label %14
14: ; preds = %140, %0
%15 = load i32, i32* %2
%16 = load i32, i32* %7
%17 = icmp slt i32 %15, %16
br i1 %17, label %18, label %143
18: ; preds = %14
%19 = load i32, i32* %2
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [500 x i8], [500 x i8]* %9, i64 0, i64 %20
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = icmp sge i32 %23, 97
br i1 %24, label %25, label %75
25: ; preds = %18
%26 = load i32, i32* %2
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [500 x i8], [500 x i8]* %9, i64 0, i64 %27
%29 = load i8, i8* %28
%30 = sext i8 %29 to i32
%31 = icmp sle i32 %30, 122
br i1 %31, label %32, label %75
32: ; preds = %25
%33 = load i32, i32* %2
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds [500 x i8], [500 x i8]* %9, i64 0, i64 %34
%36 = load i8, i8* %35
%37 = sext i8 %36 to i32
%38 = sub nsw i32 %37, 97
%39 = trunc i32 %38 to i8
%40 = load i32, i32* %2
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds [500 x i8], [500 x i8]* %9, i64 0, i64 %41
store i8 %39, i8* %42
%43 = load i32, i32* %4
%44 = srem i32 %43, 26
store i32 %44, i32* %4
%45 = load i32, i32* %4
%46 = load i32, i32* %2
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds [500 x i8], [500 x i8]* %9, i64 0, i64 %47
%49 = load i8, i8* %48
%50 = sext i8 %49 to i32
%51 = add nsw i32 %50, %45
%52 = trunc i32 %51 to i8
store i8 %52, i8* %48
%53 = load i32, i32* %2
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds [500 x i8], [500 x i8]* %9, i64 0, i64 %54
%56 = load i8, i8* %55
%57 = sext i8 %56 to i32
%58 = srem i32 %57, 26
%59 = trunc i32 %58 to i8
%60 = load i32, i32* %2
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds [500 x i8], [500 x i8]* %9, i64 0, i64 %61
store i8 %59, i8* %62
%63 = load i32, i32* %2
%64 = sext i32 %63 to i64
%65 = getelementptr inbounds [500 x i8], [500 x i8]* %9, i64 0, i64 %64
%66 = load i8, i8* %65
%67 = sext i8 %66 to i32
%68 = add nsw i32 %67, 97
%69 = trunc i32 %68 to i8
store i8 %69, i8* %65
%70 = load i32, i32* %2
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds [500 x i8], [500 x i8]* %9, i64 0, i64 %71
%73 = load i8, i8* %72
%74 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8 signext %73)
br label %139
75: ; preds = %25, %18
%76 = load i32, i32* %2
%77 = sext i32 %76 to i64
%78 = getelementptr inbounds [500 x i8], [500 x i8]* %9, i64 0, i64 %77
%79 = load i8, i8* %78
%80 = sext i8 %79 to i32
%81 = icmp sge i32 %80, 65
br i1 %81, label %82, label %132
82: ; preds = %75
%83 = load i32, i32* %2
%84 = sext i32 %83 to i64
%85 = getelementptr inbounds [500 x i8], [500 x i8]* %9, i64 0, i64 %84
%86 = load i8, i8* %85
%87 = sext i8 %86 to i32
%88 = icmp sle i32 %87, 90
br i1 %88, label %89, label %132
89: ; preds = %82
%90 = load i32, i32* %2
%91 = sext i32 %90 to i64
%92 = getelementptr inbounds [500 x i8], [500 x i8]* %9, i64 0, i64 %91
%93 = load i8, i8* %92
%94 = sext i8 %93 to i32
%95 = sub nsw i32 %94, 65
%96 = trunc i32 %95 to i8
%97 = load i32, i32* %2
%98 = sext i32 %97 to i64
%99 = getelementptr inbounds [500 x i8], [500 x i8]* %9, i64 0, i64 %98
store i8 %96, i8* %99
%100 = load i32, i32* %4
%101 = srem i32 %100, 26
store i32 %101, i32* %4
%102 = load i32, i32* %4
%103 = load i32, i32* %2
%104 = sext i32 %103 to i64
%105 = getelementptr inbounds [500 x i8], [500 x i8]* %9, i64 0, i64 %104
%106 = load i8, i8* %105
%107 = sext i8 %106 to i32
%108 = add nsw i32 %107, %102
%109 = trunc i32 %108 to i8
store i8 %109, i8* %105
%110 = load i32, i32* %2
%111 = sext i32 %110 to i64
%112 = getelementptr inbounds [500 x i8], [500 x i8]* %9, i64 0, i64 %111
%113 = load i8, i8* %112
%114 = sext i8 %113 to i32
%115 = srem i32 %114, 26
%116 = trunc i32 %115 to i8
%117 = load i32, i32* %2
%118 = sext i32 %117 to i64
%119 = getelementptr inbounds [500 x i8], [500 x i8]* %9, i64 0, i64 %118
store i8 %116, i8* %119
%120 = load i32, i32* %2
%121 = sext i32 %120 to i64
%122 = getelementptr inbounds [500 x i8], [500 x i8]* %9, i64 0, i64 %121
%123 = load i8, i8* %122
%124 = sext i8 %123 to i32
%125 = add nsw i32 %124, 65
%126 = trunc i32 %125 to i8
store i8 %126, i8* %122
%127 = load i32, i32* %2
%128 = sext i32 %127 to i64
%129 = getelementptr inbounds [500 x i8], [500 x i8]* %9, i64 0, i64 %128
%130 = load i8, i8* %129
%131 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8 signext %130)
br label %138
132: ; preds = %82, %75
%133 = load i32, i32* %2
%134 = sext i32 %133 to i64
%135 = getelementptr inbounds [500 x i8], [500 x i8]* %9, i64 0, i64 %134
%136 = load i8, i8* %135
%137 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8 signext %136)
br label %138
138: ; preds = %132, %89
br label %139
139: ; preds = %138, %32
br label %140
140: ; preds = %139
%141 = load i32, i32* %2
%142 = add nsw i32 %141, 1
store i32 %142, i32* %2
br label %14
143: ; preds = %14
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [500 x i8]
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = getelementptr inbounds [500 x i8], [500 x i8]* %3, i64 0, i64 0
%7 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%10 = load i32, i32* %2
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %37
12: ; preds = %0, %30
%13 = phi i64 [ %33, %30 ], [ 0, %0 ]
%14 = getelementptr inbounds [500 x i8], [500 x i8]* %3, i64 0, i64 %13
%15 = load i8, i8* %14
%16 = add i8 %15, -97
%17 = icmp ult i8 %16, 26
br i1 %17, label %21, label %18
18: ; preds = %12
%19 = add i8 %15, -65
%20 = icmp ult i8 %19, 26
br i1 %20, label %21, label %30
21: ; preds = %18, %12
%22 = phi i8 [ %16, %12 ], [ %19, %18 ]
%23 = phi i8 [ 97, %12 ], [ 65, %18 ]
%24 = load i32, i32* %1
%25 = srem i32 %24, 26
store i32 %25, i32* %1
%26 = trunc i32 %25 to i8
%27 = add nsw i8 %22, %26
%28 = srem i8 %27, 26
%29 = add nsw i8 %28, %23
store i8 %29, i8* %14
br label %30
30: ; preds = %21, %18
%31 = phi i8 [ %15, %18 ], [ %29, %21 ]
%32 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8 signext %31)
%33 = add nuw nsw i64 %13, 1
%34 = load i32, i32* %2
%35 = sext i32 %34 to i64
%36 = icmp slt i64 %33, %35
br i1 %36, label %12, label %37
37: ; preds = %30, %0
ret i32 0
}