#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 *, char *);
int strlen(char *);
int main() {
  char c[1000];
  scanf("%s", c);
  int i = 0;
  int z;
  int j;
  j = strlen(c);
  while (i < j) {
    if (c[i] == 'S') {
      if (c[i + 1] == 'T') {
        if (c[i + 2] == 'O') {
          if (c[i + 3] == 'P') {
            break;
          }
        }
      }
    }
    i++;
  }
  z = 0;
  while (z < j) {
    if (c[z] < 'Z')
      printf("%c", c[z]);
    else
      printf("%c", c[z] - 32);
    z++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x400,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x3f0(%rbp),%rsi
lea    0xeb0(%rip),%rdi
call   1050 <scanf@plt>
movl   $0x0,-0x3f4(%rbp)
lea    -0x3f0(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x3fc(%rbp)
mov    -0x3f4(%rbp),%eax
cmp    -0x3fc(%rbp),%eax
jge    1217 <main+0xe7>
movslq -0x3f4(%rbp),%rax
movsbl -0x3f0(%rbp,%rax,1),%eax
ff
cmp    $0x53,%eax
jne    1203 <main+0xd3>
mov    -0x3f4(%rbp),%eax
add    $0x1,%eax
cltq
movsbl -0x3f0(%rbp,%rax,1),%eax
ff
cmp    $0x54,%eax
jne    11fe <main+0xce>
mov    -0x3f4(%rbp),%eax
add    $0x2,%eax
cltq
movsbl -0x3f0(%rbp,%rax,1),%eax
ff
cmp    $0x4f,%eax
jne    11f9 <main+0xc9>
mov    -0x3f4(%rbp),%eax
add    $0x3,%eax
cltq
movsbl -0x3f0(%rbp,%rax,1),%eax
ff
cmp    $0x50,%eax
jne    11f4 <main+0xc4>
jmp    1217 <main+0xe7>
jmp    11f9 <main+0xc9>
jmp    11fe <main+0xce>
jmp    1203 <main+0xd3>
mov    -0x3f4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3f4(%rbp)
jmp    1171 <main+0x41>
movl   $0x0,-0x3f8(%rbp)
mov    -0x3f8(%rbp),%eax
cmp    -0x3fc(%rbp),%eax
jge    12a0 <main+0x170>
movslq -0x3f8(%rbp),%rax
movsbl -0x3f0(%rbp,%rax,1),%eax
ff
cmp    $0x5a,%eax
jge    126b <main+0x13b>
movslq -0x3f8(%rbp),%rax
lea    0xdaa(%rip),%rdi
movsbl -0x3f0(%rbp,%rax,1),%esi
ff
call   1040 <printf@plt>
jmp    128c <main+0x15c>
movslq -0x3f8(%rbp),%rax
movsbl -0x3f0(%rbp,%rax,1),%eax
ff
sub    $0x20,%eax
lea    0xd7f(%rip),%rdi
movsbl %al,%esi
call   1040 <printf@plt>
mov    -0x3f8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3f8(%rbp)
jmp    1221 <main+0xf1>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x3f0,%rsp
lea    0xebd(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
test   %eax,%eax
jle    1193 <main+0x63>
mov    %eax,%r15d
xor    %ebx,%ebx
lea    0xe9d(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
movzbl (%rsp,%rbx,1),%eax
lea    -0x20(%rax),%ecx
cmp    $0x5a,%al
movzbl %cl,%ecx
cmovl  %eax,%ecx
movsbl %cl,%esi
mov    %r14,%rdi
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1170 <main+0x40>
xor    %eax,%eax
add    $0x3f0,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [1000 x i8]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %6)
store i32 0, i32* %3
%8 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%9 = call i32 @strlen(i8* %8)
store i32 %9, i32* %5
br label %10
10: ; preds = %49, %0
%11 = load i32, i32* %3
%12 = load i32, i32* %5
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %52
14: ; preds = %10
%15 = load i32, i32* %3
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 %16
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %19, 83
br i1 %20, label %21, label %49
21: ; preds = %14
%22 = load i32, i32* %3
%23 = add nsw i32 %22, 1
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 %24
%26 = load i8, i8* %25
%27 = sext i8 %26 to i32
%28 = icmp eq i32 %27, 84
br i1 %28, label %29, label %48
29: ; preds = %21
%30 = load i32, i32* %3
%31 = add nsw i32 %30, 2
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 %32
%34 = load i8, i8* %33
%35 = sext i8 %34 to i32
%36 = icmp eq i32 %35, 79
br i1 %36, label %37, label %47
37: ; preds = %29
%38 = load i32, i32* %3
%39 = add nsw i32 %38, 3
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 %40
%42 = load i8, i8* %41
%43 = sext i8 %42 to i32
%44 = icmp eq i32 %43, 80
br i1 %44, label %45, label %46
45: ; preds = %37
br label %52
46: ; preds = %37
br label %47
47: ; preds = %46, %29
br label %48
48: ; preds = %47, %21
br label %49
49: ; preds = %48, %14
%50 = load i32, i32* %3
%51 = add nsw i32 %50, 1
store i32 %51, i32* %3
br label %10
52: ; preds = %45, %10
store i32 0, i32* %4
br label %53
53: ; preds = %79, %52
%54 = load i32, i32* %4
%55 = load i32, i32* %5
%56 = icmp slt i32 %54, %55
br i1 %56, label %57, label %82
57: ; preds = %53
%58 = load i32, i32* %4
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 %59
%61 = load i8, i8* %60
%62 = sext i8 %61 to i32
%63 = icmp slt i32 %62, 90
br i1 %63, label %64, label %70
64: ; preds = %57
%65 = load i32, i32* %4
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 %66
%68 = load i8, i8* %67
%69 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8 signext %68)
br label %79
70: ; preds = %57
%71 = load i32, i32* %4
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 %72
%74 = load i8, i8* %73
%75 = sext i8 %74 to i32
%76 = sub nsw i32 %75, 32
%77 = trunc i32 %76 to i8
%78 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8 signext %77)
br label %79
79: ; preds = %70, %64
%80 = load i32, i32* %4
%81 = add nsw i32 %80, 1
store i32 %81, i32* %4
br label %53
82: ; preds = %53
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @strlen(i8* %2)
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %18
6: ; preds = %0
%7 = zext i32 %4 to i64
br label %8
8: ; preds = %6, %8
%9 = phi i64 [ 0, %6 ], [ %16, %8 ]
%10 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 %9
%11 = load i8, i8* %10
%12 = icmp slt i8 %11, 90
%13 = add nsw i8 %11, -32
%14 = select i1 %12, i8 %11, i8 %13
%15 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8 signext %14)
%16 = add nuw nsw i64 %9, 1
%17 = icmp eq i64 %16, %7
br i1 %17, label %18, label %8
18: ; preds = %8, %0
ret i32 0
}