#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 *, int, char *);
int /*<<< orphan*/ scanf(char *, int *, ...);
int strlen(char *);
int main() {
  char s[81];
  s[81] = 'a';
  int t, n, i, j = 0;
  scanf("%d", &t);
  while (t--) {
    j++;
    scanf("%d %s", &n, s);
    for (i = n - 1; i < strlen(s); i++) {
      s[i] = s[i + 1];
    }
    printf("%d %s\n", j, s);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x61,-0xf(%rbp)
movl   $0x0,-0x70(%rbp)
lea    0xeac(%rip),%rdi
lea    -0x64(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
mov    -0x64(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x64(%rbp)
cmp    $0x0,%eax
je     11f1 <main+0xc1>
mov    -0x70(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x70(%rbp)
lea    -0x60(%rbp),%rdx
lea    0xe7c(%rip),%rdi
lea    -0x68(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
mov    -0x68(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x6c(%rbp),%eax
mov    %eax,-0x74(%rbp)
lea    -0x60(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x74(%rbp),%eax
cmp    %ecx,%eax
jge    11d9 <main+0xa9>
mov    -0x6c(%rbp),%eax
add    $0x1,%eax
cltq
mov    -0x60(%rbp,%rax,1),%cl
movslq -0x6c(%rbp),%rax
mov    %cl,-0x60(%rbp,%rax,1)
mov    -0x6c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x6c(%rbp)
jmp    119b <main+0x6b>
mov    -0x70(%rbp),%esi
lea    -0x60(%rbp),%rdx
lea    0xe22(%rip),%rdi
call   1040 <printf@plt>
jmp    115f <main+0x2f>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
movb   $0x61,0x61(%rsp)
lea    0xeb6(%rip),%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
subl   $0x1,0x8(%rsp)
jae    116e <main+0x3e>
xor    %eax,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xe8e(%rip),%r14
lea    0xc(%rsp),%r15
lea    0x10(%rsp),%rbx
lea    0xe83(%rip),%r12
xor    %r13d,%r13d
jmp    11a5 <main+0x75>
nopl   0x0(%rax,%rax,1)
mov    %r12,%rdi
mov    %r13d,%esi
mov    %rbx,%rdx
call   1040 <printf@plt>
subl   $0x1,0x8(%rsp)
jb     115d <main+0x2d>
add    $0x1,%r13d
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1050 <scanf@plt>
mov    0xc(%rsp),%ebp
mov    %rbx,%rdi
call   1030 <strlen@plt>
cmp    %eax,%ebp
jg     1190 <main+0x60>
add    $0xffffffff,%ebp
movslq %ebp,%rax
nop
lea    0x1(%rax),%rbp
movzbl 0x11(%rsp,%rax,1),%ecx
mov    %cl,0x10(%rsp,%rax,1)
mov    %rbx,%rdi
call   1030 <strlen@plt>
movslq %eax,%rcx
mov    %rbp,%rax
cmp    %rcx,%rbp
jl     11d0 <main+0xa0>
jmp    1190 <main+0x60>

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

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