#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 */
typedef int /*<<< orphan*/ string;

/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ stdin;
char *strstr(char *, char *);
int main(void) {
  int num, i;
  char string[1002], *check;
  scanf("%d\n", &num);
  for (i = 0; i < num; i++) {
    fgets(string, sizeof(string), stdin);
    while ((check = strstr(string, "Hoshino")) != NULL)
      check[6] = 'a';
    printf("%s", string);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xea7(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11e4 <main+0xa4>
lea    -0x400(%rbp),%rdi
mov    0x2e65(%rip),%rax
mov    (%rax),%edx
mov    $0x3ea,%esi
call   1040 <fgets@plt>
lea    -0x400(%rbp),%rdi
lea    0xe67(%rip),%rsi
call   1060 <strstr@plt>
mov    %rax,-0x408(%rbp)
cmp    $0x0,%rax
je     11c3 <main+0x83>
mov    -0x408(%rbp),%rax
movb   $0x61,0x6(%rax)
jmp    118f <main+0x4f>
lea    -0x400(%rbp),%rsi
lea    0xe3b(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1169 <main+0x29>
xor    %eax,%eax
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x400,%rsp
lea    0xeaa(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
jle    11d6 <main+0x96>
xor    %ebp,%ebp
mov    0x2e78(%rip),%r12
lea    0x10(%rsp),%rbx
lea    0xe88(%rip),%r14
lea    0xe89(%rip),%r15
jmp    11a4 <main+0x64>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
add    $0x1,%ebp
cmp    0xc(%rsp),%ebp
jge    11d6 <main+0x96>
mov    (%r12),%edx
mov    %rbx,%rdi
mov    $0x3ea,%esi
call   1040 <fgets@plt>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <strstr@plt>
test   %rax,%rax
je     1190 <main+0x50>
movb   $0x61,0x6(%rax)
jmp    11c0 <main+0x80>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@stdin = global i32 0
@.str.1 = [8 x i8] c"Hoshino\00"
@.str.2 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [1002 x i8]
%5 = alloca i8*
store i32 0, i32* %1
%6 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %2)
store i32 0, i32* %3
br label %7
7: ; preds = %25, %0
%8 = load i32, i32* %3
%9 = load i32, i32* %2
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %28
11: ; preds = %7
%12 = getelementptr inbounds [1002 x i8], [1002 x i8]* %4, i64 0, i64 0
%13 = load i32, i32* @stdin
%14 = call i32 @fgets(i8* %12, i32 1002, i32 %13)
br label %15
15: ; preds = %19, %11
%16 = getelementptr inbounds [1002 x i8], [1002 x i8]* %4, i64 0, i64 0
%17 = call i8* @strstr(i8* %16, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
store i8* %17, i8** %5
%18 = icmp ne i8* %17, null
br i1 %18, label %19, label %22
19: ; preds = %15
%20 = load i8*, i8** %5
%21 = getelementptr inbounds i8, i8* %20, i64 6
store i8 97, i8* %21
br label %15
22: ; preds = %15
%23 = getelementptr inbounds [1002 x i8], [1002 x i8]* %4, i64 0, i64 0
%24 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %23)
br label %25
25: ; preds = %22
%26 = load i32, i32* %3
%27 = add nsw i32 %26, 1
store i32 %27, i32* %3
br label %7
28: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@stdin = global i32 0
@.str.1 = [8 x i8] c"Hoshino\00"
@.str.2 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [1002 x i8]
%3 = bitcast i32* %1 to i8*
%4 = getelementptr inbounds [1002 x i8], [1002 x i8]* %2, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %24
8: ; preds = %0, %19
%9 = phi i32 [ %21, %19 ], [ 0, %0 ]
%10 = load i32, i32* @stdin
%11 = call i32 @fgets(i8* %4, i32 1002, i32 %10)
%12 = call i8* @strstr(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%13 = icmp eq i8* %12, null
br i1 %13, label %19, label %14
14: ; preds = %8, %14
%15 = phi i8* [ %17, %14 ], [ %12, %8 ]
%16 = getelementptr inbounds i8, i8* %15, i64 6
store i8 97, i8* %16
%17 = call i8* @strstr(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%18 = icmp eq i8* %17, null
br i1 %18, label %19, label %14
19: ; preds = %14, %8
%20 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %4)
%21 = add nuw nsw i32 %9, 1
%22 = load i32, i32* %1
%23 = icmp slt i32 %21, %22
br i1 %23, label %8, label %24
24: ; preds = %19, %0
ret i32 0
}