#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 strlen(char *);
scalar_t__ strncmp(char *, char *, int);
int main() {
  char Palav[21];
  int N, Cont, TamPal;
  scanf("%d", &N);
  for (Cont = 1; Cont <= N; Cont++) {
    scanf("%s", Palav);
    TamPal = strlen(Palav);
    if (TamPal == 3) {
      if (strncmp(Palav, "UR", 2) == 0 || strncmp(Palav, "OB", 2) == 0)
        Palav[2] = 'I';
    }
    if (Cont < N) {
      printf("%s ", Palav);
    } else
      printf("%s\n", Palav);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
lea    -0x24(%rbp),%rsi
mov    $0x0,%al
call   1060 <scanf@plt>
movl   $0x1,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x24(%rbp),%eax
jg     1227 <main+0xe7>
lea    -0x20(%rbp),%rsi
lea    0xe84(%rip),%rdi
mov    $0x0,%al
call   1060 <scanf@plt>
lea    -0x20(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x2c(%rbp)
cmpl   $0x3,-0x2c(%rbp)
jne    11e3 <main+0xa3>
lea    -0x20(%rbp),%rdi
lea    0xe5f(%rip),%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
je     11da <main+0x9a>
lea    -0x20(%rbp),%rdi
lea    0xe43(%rip),%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    11de <main+0x9e>
movb   $0x49,-0x1e(%rbp)
jmp    11e3 <main+0xa3>
mov    -0x28(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    1204 <main+0xc4>
lea    -0x20(%rbp),%rsi
lea    0xe12(%rip),%rdi
call   1050 <printf@plt>
jmp    1214 <main+0xd4>
lea    -0x20(%rbp),%rsi
lea    0xe01(%rip),%rdi
call   1050 <printf@plt>
jmp    1219 <main+0xd9>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1168 <main+0x28>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
lea    0xeab(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
jle    120e <main+0xce>
lea    0xe90(%rip),%r14
lea    0x10(%rsp),%rbx
lea    0xe87(%rip),%r15
lea    0xe86(%rip),%r13
lea    0xe83(%rip),%rbp
xor    %r12d,%r12d
jmp    11c0 <main+0x80>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movb   $0x49,0x12(%rsp)
cmp    0xc(%rsp),%r12d
mov    %rbp,%rdi
cmovl  %r13,%rdi
mov    %rbx,%rsi
call   1050 <printf@plt>
cmp    0xc(%rsp),%r12d
jge    120e <main+0xce>
add    $0x1,%r12d
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
cmp    $0x3,%eax
jne    11a5 <main+0x65>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     11a0 <main+0x60>
mov    %rbx,%rdi
lea    0xe0c(%rip),%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
jne    11a5 <main+0x65>
jmp    11a0 <main+0x60>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
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"UR\00"
@.str.3 = [3 x i8] c"OB\00"
@.str.4 = [4 x i8] c"%s \00"
@.str.5 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [21 x i8]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
store i32 1, i32* %4
br label %7
7: ; preds = %40, %0
%8 = load i32, i32* %4
%9 = load i32, i32* %3
%10 = icmp sle i32 %8, %9
br i1 %10, label %11, label %43
11: ; preds = %7
%12 = getelementptr inbounds [21 x i8], [21 x i8]* %2, i64 0, i64 0
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %12)
%14 = getelementptr inbounds [21 x i8], [21 x i8]* %2, i64 0, i64 0
%15 = call i32 @strlen(i8* %14)
store i32 %15, i32* %5
%16 = load i32, i32* %5
%17 = icmp eq i32 %16, 3
br i1 %17, label %18, label %29
18: ; preds = %11
%19 = getelementptr inbounds [21 x i8], [21 x i8]* %2, i64 0, i64 0
%20 = call i64 @strncmp(i8* %19, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 2)
%21 = icmp eq i64 %20, 0
br i1 %21, label %26, label %22
22: ; preds = %18
%23 = getelementptr inbounds [21 x i8], [21 x i8]* %2, i64 0, i64 0
%24 = call i64 @strncmp(i8* %23, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 2)
%25 = icmp eq i64 %24, 0
br i1 %25, label %26, label %28
26: ; preds = %22, %18
%27 = getelementptr inbounds [21 x i8], [21 x i8]* %2, i64 0, i64 2
store i8 73, i8* %27
br label %28
28: ; preds = %26, %22
br label %29
29: ; preds = %28, %11
%30 = load i32, i32* %4
%31 = load i32, i32* %3
%32 = icmp slt i32 %30, %31
br i1 %32, label %33, label %36
33: ; preds = %29
%34 = getelementptr inbounds [21 x i8], [21 x i8]* %2, i64 0, i64 0
%35 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* %34)
br label %39
36: ; preds = %29
%37 = getelementptr inbounds [21 x i8], [21 x i8]* %2, i64 0, i64 0
%38 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* %37)
br label %39
39: ; preds = %36, %33
br label %40
40: ; preds = %39
%41 = load i32, i32* %4
%42 = add nsw i32 %41, 1
store i32 %42, i32* %4
br label %7
43: ; preds = %7
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"UR\00"
@.str.3 = [3 x i8] c"OB\00"
@.str.4 = [4 x i8] c"%s \00"
@.str.5 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [21 x i8]
%2 = alloca i32
%3 = getelementptr inbounds [21 x i8], [21 x i8]* %1, i64 0, i64 0
%4 = bitcast i32* %2 to i8*
%5 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 1
br i1 %7, label %30, label %8
8: ; preds = %0
%9 = getelementptr inbounds [21 x i8], [21 x i8]* %1, i64 0, i64 2
br label %10
10: ; preds = %8, %22
%11 = phi i32 [ 1, %8 ], [ %27, %22 ]
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%13 = call i32 @strlen(i8* %3)
%14 = icmp eq i32 %13, 3
br i1 %14, label %15, label %22
15: ; preds = %10
%16 = call i64 @strncmp(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 2)
%17 = icmp eq i64 %16, 0
br i1 %17, label %21, label %18
18: ; preds = %15
%19 = call i64 @strncmp(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 2)
%20 = icmp eq i64 %19, 0
br i1 %20, label %21, label %22
21: ; preds = %18, %15
store i8 73, i8* %9
br label %22
22: ; preds = %18, %21, %10
%23 = load i32, i32* %2
%24 = icmp slt i32 %11, %23
%25 = select i1 %24, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0)
%26 = call i32 @printf(i8* %25, i8* %3)
%27 = add nuw nsw i32 %11, 1
%28 = load i32, i32* %2
%29 = icmp slt i32 %11, %28
br i1 %29, label %10, label %30
30: ; preds = %22, %0
ret i32 0
}