// File: /workspace/github_cpp_makefile_star2_O3/Konano[P]Artificial-Intelligence-Input-Method/main.cpp
// Function: Translate(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
inline string Translate(const string str)
{
	len = 0;

	int L = str.length(), S = 0, E = str.find(' ', S);
	while (E != -1)
		text[++len] = Pinyin_map[str.substr(S, E-S)], S = E+1, E = str.find(' ', S);
	text[++len] = Pinyin_map[str.substr(S, L-S)];

	len += 2; text[len-1] = text[0] = 1;

	for(int i = 0; i < len; i++) ed[i].clear(), st[i].clear();

	for(int i = 0; i < len; i++)
	{
		int T = 0, now = i;
		while (now < len && Tree[T].children.count(text[now]))
		{
			T = Tree[T].children[text[now]];
			int num = (int)Tree[T].wd.size();
			for(int j = 0; j < num; j++)
			{
				if (i) st[i-1].push_back(make_pair(Tree[T].wd[j], (int)ed[now].size()));
				ed[now].push_back(Tree[T].wd[j]);
			}
			now ++;
		}
	}
	for(int o = 0; o < len; o++)
	{
		int num = (int)ed[o].size();
		for(int i = 0; i < num; i++) f[o][i] = -1e90, g[o][i] = -1;
	}
	f[0][0] = 0;

	for(int o = 0; o < len-1; o++)
	{
		int num = (int)ed[o].size();
		int _num = (int)st[o].size();

		int tot_1 = 0;
		for(int j = 0; j < _num; j++)
			tot_1 += Count_1(st[o][j].first);

		for(int i = 0; i < num; i++)
		{
			int tot_2 = 0;
			for(int j = 0; j < _num; j++)
				tot_2 += Count_2(ed[o][i], st[o][j].first)+1;

			for(int j = 0; j < _num; j++)
			{
				int _o = o + Length(st[o][j].first);
				int _j = st[o][j].second;

				double tmp = f[o][i] + log(1.0*(Count_2(ed[o][i], st[o][j].first)+1) / tot_2);
				if (tmp > f[_o][_j])
					f[_o][_j] = tmp,
					g[_o][_j] = i;
			}
		}

		// int tot_1 = 0;
		// for(int i = 0; i < num; i++) tot_1 += Times_1[wd[o][i].first] + 1;

		// int tot_2 = 0;
		// for(int i = 0; i < num; i++)
		// {
		// 	int _o = o - wd[o][i].second;
		// 	int _num = (int)wd[_o].size();

		// 	for(int j = 0; j < _num; j++)
		// 		tot_2 += count_2(wd[_o][j].first, wd[o][i].first) + 1;
		// }

		// for(int i = 0; i < num; i++)
		// {
		// 	int _o = o - wd[o][i].second;
		// 	int _num = (int)wd[_o].size();

		// 	for(int j = 0; j < _num; j++)
		// 	{
		// 		double tmp = f[_o][j] + log((count_2(wd[_o][j].first, wd[o][i].first)+1) / tot_2);
		// 		if (tmp > f[o][i])
		// 		{
		// 			f[o][i] = tmp;
		// 			g[o][i] = j;
		// 		}
		// 	}
		// }

				// tot_2 += (Times_2.count(Long(wd[_o][j].first, wd[o][i].first)) ? Times_2[Long(wd[_o][j].first, wd[o][i].first)] : 0) + 1;


	}

	double MAX = -1e90;
	int Best = -1;
	int num = (int)ed[len-1].size();
	for(int i = 0; i < num; i++)
		if (MAX < f[len-1][i])
			MAX = f[len-1][i], Best = i;

	vector<int> ans;

	for(int o = len-1; o; )
	{
		ans.push_back(ed[o][Best]);
		int strL = Length(ed[o][Best]);
		Best = g[o][Best];
		o -= strL;
	}

	string zh_cn = "";

	for(int i = (int)ans.size()-1; i >= 0; i--) if (ans[i] != 1)
		zh_cn += Word[ans[i]];

	return zh_cn;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rsi, %r14
movq %rdi, 0x58(%rsp)
movl $0x0, 0xc0ae88e(%rip)   # 0xc0b1754
movl 0x8(%rsi), %eax
movl %eax, 0x8(%rsp)
xorl %r15d, %r15d
movq %rsi, %rdi
movl $0x20, %esi
xorl %edx, %edx
callq 0x2220
movq %rax, %rbp
cmpl $-0x1, %ebp
je 0x2f72
xorl %r15d, %r15d
leaq 0x10(%rsp), %r12
leaq 0xa146(%rip), %r13      # 0xd040
leaq 0xc0ae85f(%rip), %rbx   # 0xc0b1760
movslq %r15d, %rdx
movl %ebp, %eax
subl %edx, %eax
movslq %eax, %rcx
movq %r12, %rdi
movq %r14, %rsi
callq 0x21e0
movq %r13, %rdi
movq %r12, %rsi
callq 0x4f06
movl (%rax), %eax
movslq 0xc0ae82a(%rip), %rcx   # 0xc0b1754
leaq 0x1(%rcx), %rdx
movl %edx, 0xc0ae820(%rip)   # 0xc0b1754
movl %eax, 0x4(%rbx,%rcx,4)
movl %ebp, %r15d
incl %r15d
movslq %r15d, %rdx
movq %r14, %rdi
movl $0x20, %esi
callq 0x2220
movq %rax, %rbp
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x2f6d
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x21d0
cmpl $-0x1, %ebp
jne 0x2f01
movslq %r15d, %rdx
movl 0x8(%rsp), %eax
subl %edx, %eax
movslq %eax, %rcx
leaq 0x10(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x21e0
leaq 0xa0ab(%rip), %rdi      # 0xd040
movq %r15, %rsi
callq 0x4f06
movl (%rax), %ecx
movslq 0xc0ae7ae(%rip), %rdx   # 0xc0b1754
leaq 0x1(%rdx), %rax
movl %eax, 0xc0ae7a4(%rip)   # 0xc0b1754
leaq 0xc0ae7a9(%rip), %rsi   # 0xc0b1760
movl %ecx, 0x4(%rsi,%rdx,4)
leaq 0x20(%rsp), %rcx
movq -0x10(%rcx), %rdi
cmpq %rcx, %rdi
je 0x2fdc
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x21d0
movl 0xc0ae778(%rip), %eax   # 0xc0b1754
leal 0x2(%rax), %r12d
movl %r12d, 0xc0ae76d(%rip)  # 0xc0b1754
movl $0x1, %ecx
movl %ecx, 0xc0ae76e(%rip)   # 0xc0b1760
cltq
leaq 0xc0ae765(%rip), %rdx   # 0xc0b1760
movl %ecx, 0x4(%rdx,%rax,4)
cmpl $-0x1, %eax
jl 0x3583
cmpl $0x2, %r12d
cmovgel %r12d, %ecx
shlq $0x3, %rcx
leaq (%rcx,%rcx,2), %rax
xorl %ecx, %ecx
leaq 0xe30a59f(%rip), %rsi   # 0xe30d5c0
leaq 0xe3047d8(%rip), %rdi   # 0xe307800
movq (%rcx,%rsi), %rdx
cmpq %rdx, 0x8(%rcx,%rsi)
je 0x3038
movq %rdx, 0x8(%rcx,%rsi)
movq (%rcx,%rdi), %rdx
cmpq %rdx, 0x8(%rcx,%rdi)
je 0x3048
movq %rdx, 0x8(%rcx,%rdi)
addq $0x18, %rcx
cmpq %rcx, %rax
jne 0x3028
testl %r12d, %r12d
jle 0x3583
xorl %ebp, %ebp
leaq 0x59af3ed(%rip), %rbx   # 0x59b2450
movslq %r12d, %rax
cmpq %rax, %rbp
jge 0x31ad
leaq (,%rbp,2), %rax
addq %rbp, %rax
leaq 0xe30477f(%rip), %rcx   # 0xe307800
leaq (%rcx,%rax,8), %r15
addq $-0x18, %r15
xorl %ecx, %ecx
movq %rbp, %r14
movslq %ecx, %rax
leaq (%rax,%rax,8), %rax
leaq (%rbx,%rax,8), %r12
leaq 0xc0ae6c0(%rip), %rax   # 0xc0b1760
leaq (%rax,%r14,4), %r13
movq %r12, %rdi
movq %r13, %rsi
callq 0x4f82
testq %rax, %rax
je 0x31a3
movq %r14, 0x8(%rsp)
movq %r12, %rdi
movq %r13, %rsi
callq 0x4bc0
movslq (%rax), %rax
movq %rax, 0x38(%rsp)
leaq (%rax,%rax,8), %rax
movq 0x38(%rbx,%rax,8), %r13
subq 0x30(%rbx,%rax,8), %r13
shrq $0x2, %r13
testl %r13d, %r13d
jle 0x317a
leaq 0x59af35e(%rip), %rcx   # 0x59b2450
leaq (%rcx,%rax,8), %r14
addq $0x30, %r14
movq 0x8(%rsp), %rax
leaq (%rax,%rax,2), %rax
leaq 0xe30a4b6(%rip), %rcx   # 0xe30d5c0
leaq (%rcx,%rax,8), %r12
andl $0x7fffffff, %r13d      # imm = 0x7FFFFFFF
xorl %ebx, %ebx
movq (%r14), %rdx
movq 0x8(%r12), %rsi
testq %rbp, %rbp
je 0x3150
subq (%r12), %rsi
movl (%rdx,%rbx), %eax
andq $-0x4, %rsi
shlq $0x1e, %rsi
orq %rax, %rsi
movq %rsi, 0x10(%rsp)
movq %r15, %rdi
leaq 0x10(%rsp), %rsi
callq 0x50ac
movq (%r14), %rdx
movq 0x8(%r12), %rsi
addq %rbx, %rdx
cmpq 0x10(%r12), %rsi
je 0x3169
movl (%rdx), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%r12)
jmp 0x3171
movq %r12, %rdi
callq 0x4e2a
addq $0x4, %rbx
decq %r13
jne 0x3117
movq 0x8(%rsp), %r14
incq %r14
movl 0xc0ae5cb(%rip), %r12d  # 0xc0b1754
movslq %r12d, %rax
cmpq %rax, %r14
leaq 0x59af2ba(%rip), %rbx   # 0x59b2450
movq 0x38(%rsp), %rcx
jl 0x308e
jmp 0x31ad
movl 0xc0ae5aa(%rip), %r12d  # 0xc0b1754
movslq %r12d, %rax
incq %rbp
cmpq %rax, %rbp
jl 0x3063
testl %r12d, %r12d
jle 0x3583
movl %r12d, %eax
movq %rax, 0x8(%rsp)
leaq 0xc0af537(%rip), %r14   # 0xc0b2708
xorl %r15d, %r15d
movabsq $-0x2d6094f0f6d6a639, %r13 # imm = 0xD29F6B0F092959C7
leaq 0xe30a3db(%rip), %rdx   # 0xe30d5c0
leaq (%r15,%r15,2), %rax
movq 0x8(%rdx,%rax,8), %rbp
subq (%rdx,%rax,8), %rbp
shrq $0x2, %rbp
testl %ebp, %ebp
jle 0x32b9
imulq $0x2ee0, %r15, %rdi     # imm = 0x2EE0
leaq 0xd792af4(%rip), %rax   # 0xd795d00
addq %rax, %rdi
movl %ebp, %ebx
andl $0x7fffffff, %ebx       # imm = 0x7FFFFFFF
leaq (,%rbx,4), %rdx
movl $0xff, %esi
callq 0x2110
movdqa 0x2dff(%rip), %xmm7     # 0x6030
pcmpeqd %xmm6, %xmm6
movdqa 0x2de3(%rip), %xmm5     # 0x6020
leaq 0xe30a37c(%rip), %rdx   # 0xe30d5c0
incl %ebp
andl $-0x2, %ebp
decq %rbx
movq %rbx, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
pxor %xmm5, %xmm0
xorl %eax, %eax
movdqa 0x2dac(%rip), %xmm1     # 0x6010
movdqa %xmm1, %xmm2
pxor %xmm5, %xmm2
movdqa %xmm2, %xmm3
pcmpgtd %xmm0, %xmm3
pcmpeqd %xmm0, %xmm2
pshufd $0xf5, %xmm2, %xmm4     # xmm4 = xmm2[1,1,3,3]
pand %xmm3, %xmm4
pshufd $0xf5, %xmm3, %xmm2     # xmm2 = xmm3[1,1,3,3]
por %xmm4, %xmm2
movd %xmm2, %ecx
notl %ecx
testb $0x1, %cl
je 0x329a
movq %r13, -0x8(%r14,%rax,8)
pxor %xmm6, %xmm2
pextrw $0x4, %xmm2, %ecx
testb $0x1, %cl
je 0x32ac
movq %r13, (%r14,%rax,8)
addq $0x2, %rax
paddq %xmm7, %xmm1
cmpq %rax, %rbp
jne 0x3264
incq %r15
addq $0x5dc0, %r14           # imm = 0x5DC0
cmpq 0x8(%rsp), %r15
jne 0x31e5
movq $0x0, 0xc0af427(%rip) # 0xc0b2700
cmpl $0x1, %r12d
je 0x358e
xorl %esi, %esi
leaq 0xe304514(%rip), %rcx   # 0xe307800
leaq (,%rsi,8), %rax
leaq (%rax,%rax,2), %r8
movq 0x8(%rdx,%r8), %rdi
subq (%rdx,%r8), %rdi
shrq $0x2, %rdi
testl %edi, %edi
jle 0x356d
leaq (%rdx,%r8), %rax
movq %rax, 0x38(%rsp)
addq %rcx, %r8
movq 0x8(%r8), %rbp
subq (%r8), %rbp
shrq $0x3, %rbp
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
andq %rax, %rdi
movq %rbp, 0x40(%rsp)
andq %rax, %rbp
movq %rsi, 0x48(%rsp)
imulq $0x5dc0, %rsi, %rcx     # imm = 0x5DC0
leaq 0xc0af3b9(%rip), %rax   # 0xc0b2700
addq %rax, %rcx
movq %rcx, 0x60(%rsp)
xorl %r12d, %r12d
movq %r8, 0x50(%rsp)
movq %rdi, 0x68(%rsp)
cmpl $0x0, 0x40(%rsp)
jle 0x3542
xorl %r14d, %r14d
movq 0x5025a3f(%rip), %rax   # 0x5028db0
xorl %ebx, %ebx
leaq 0x5025a2e(%rip), %r15   # 0x5028da8
leaq 0x5025a1f(%rip), %r13   # 0x5028da0
testq %rax, %rax
je 0x33f5
movq 0x38(%rsp), %rcx
movq (%rcx), %rcx
movslq (%rcx,%r12,4), %rcx
movq (%r8), %rdx
movslq (%rdx,%r14,8), %rdx
imulq $0x16e360, %rcx, %rcx   # imm = 0x16E360
addq %rdx, %rcx
movq %rax, %rsi
movq %r15, %rdx
xorl %edi, %edi
cmpq %rcx, 0x20(%rsi)
setl %dil
cmovgeq %rsi, %rdx
movq 0x10(%rsi,%rdi,8), %rsi
testq %rsi, %rsi
jne 0x33a9
cmpq %r15, %rdx
je 0x33f5
movl $0x1, %esi
cmpq 0x20(%rdx), %rcx
jl 0x33fa
movq %rcx, 0x10(%rsp)
movq %r13, %rdi
leaq 0x10(%rsp), %rsi
callq 0x522a
movq 0x50(%rsp), %r8
movl (%rax), %esi
incl %esi
movq 0x50259bd(%rip), %rax   # 0x5028db0
jmp 0x33fa
movl $0x1, %esi
addl %esi, %ebx
incq %r14
cmpq %rbp, %r14
jne 0x3381
cmpl $0x0, 0x40(%rsp)
jle 0x3542
xorps %xmm0, %xmm0
cvtsi2sd %ebx, %xmm0
movsd %xmm0, 0x70(%rsp)
movq 0x60(%rsp), %rax
leaq (%rax,%r12,8), %rbx
xorl %r14d, %r14d
movq (%r8), %rax
movslq (%rax,%r14,8), %rdx
movq %rdx, %rcx
shlq $0x5, %rcx
leaq 0x9c2f(%rip), %rsi      # 0xd070
movq 0x8(%rcx,%rsi), %r15
movslq 0x4(%rax,%r14,8), %r13
movq (%rbx), %xmm0
movq 0x502595a(%rip), %rcx   # 0x5028db0
testq %rcx, %rcx
movq %xmm0, 0x8(%rsp)
je 0x34d3
movq 0x38(%rsp), %rax
movq (%rax), %rax
movslq (%rax,%r12,4), %rax
imulq $0x16e360, %rax, %rax   # imm = 0x16E360
addq %rdx, %rax
leaq 0x502592a(%rip), %rdx   # 0x5028da8
xorl %esi, %esi
cmpq %rax, 0x20(%rcx)
setl %sil
cmovgeq %rcx, %rdx
movq 0x10(%rcx,%rsi,8), %rcx
testq %rcx, %rcx
jne 0x347e
leaq 0x502590b(%rip), %rcx   # 0x5028da8
cmpq %rcx, %rdx
je 0x34d3
movsd 0x2b96(%rip), %xmm0     # 0x6040
cmpq 0x20(%rdx), %rax
jl 0x34db
movq %rax, 0x10(%rsp)
leaq 0x50258e4(%rip), %rdi   # 0x5028da0
leaq 0x10(%rsp), %rsi
callq 0x522a
movl (%rax), %eax
incl %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
jmp 0x34db
movsd 0x2b65(%rip), %xmm0     # 0x6040
divsd 0x70(%rsp), %xmm0
shrq %r15
addq 0x48(%rsp), %r15
callq 0x2170
movsd 0x8(%rsp), %xmm1
addsd %xmm0, %xmm1
movslq %r15d, %rax
imulq $0x5dc0, %rax, %rcx     # imm = 0x5DC0
leaq 0xc0af1f7(%rip), %rdx   # 0xc0b2700
addq %rdx, %rcx
ucomisd (%rcx,%r13,8), %xmm1
jbe 0x3531
leaq (%rcx,%r13,8), %rcx
movsd %xmm1, (%rcx)
imulq $0x2ee0, %rax, %rax     # imm = 0x2EE0
leaq 0xd7927d6(%rip), %rcx   # 0xd795d00
addq %rcx, %rax
movl %r12d, (%rax,%r13,4)
incq %r14
cmpq %rbp, %r14
movq 0x50(%rsp), %r8
jne 0x342c
incq %r12
movq 0x68(%rsp), %rdi
cmpq %rdi, %r12
jne 0x335c
movl 0xc0ae1fa(%rip), %r12d  # 0xc0b1754
leaq 0xe30a05f(%rip), %rdx   # 0xe30d5c0
leaq 0xe304298(%rip), %rcx   # 0xe307800
movq 0x48(%rsp), %rsi
incq %rsi
leal -0x1(%r12), %r15d
movslq %r15d, %rax
cmpq %rax, %rsi
jl 0x32ec
jmp 0x3597
movq $0x0, 0xc0af172(%rip) # 0xc0b2700
decl %r12d
movslq %r12d, %rax
movl %r12d, %r15d
leaq (%rax,%rax,2), %rdx
leaq 0xe30a01e(%rip), %rbx   # 0xe30d5c0
movq 0x8(%rbx,%rdx,8), %rcx
subq (%rbx,%rdx,8), %rcx
shrq $0x2, %rcx
testl %ecx, %ecx
jle 0x35f9
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
imulq $0x5dc0, %rax, %rdx     # imm = 0x5DC0
movsd 0x2a80(%rip), %xmm0     # 0x6048
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
xorl %esi, %esi
leaq 0xc0af12a(%rip), %rdi   # 0xc0b2700
leaq (%rdx,%rsi,8), %r8
movsd (%rdi,%r8), %xmm1
ucomisd %xmm0, %xmm1
cmoval %esi, %eax
maxsd %xmm0, %xmm1
incq %rsi
movapd %xmm1, %xmm0
cmpq %rsi, %rcx
jne 0x35d6
jmp 0x35fe
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
xorpd %xmm0, %xmm0
movapd %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
testl %r15d, %r15d
je 0x3689
leaq 0x9a53(%rip), %r12      # 0xd070
leaq 0xd7926dc(%rip), %r13   # 0xd795d00
movslq %r15d, %r15
leaq (%r15,%r15,2), %r14
movslq %eax, %rbp
leaq (,%rbp,4), %rdx
addq (%rbx,%r14,8), %rdx
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x3655
movl (%rdx), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x18(%rsp)
jmp 0x3669
leaq 0x10(%rsp), %rdi
callq 0x4e2a
leaq (%rbx,%r14,8), %rax
movq (%rax), %rax
movl (%rax,%rbp,4), %eax
cltq
shlq $0x5, %rax
movq 0x8(%rax,%r12), %rcx
shrq %rcx
imulq $0x2ee0, %r15, %rax     # imm = 0x2EE0
addq %r13, %rax
movl (%rax,%rbp,4), %eax
subl %ecx, %r15d
jne 0x3624
movq 0x58(%rsp), %r12
leaq 0x10(%r12), %rbx
movq %rbx, (%r12)
leaq 0x29de(%rip), %rdx      # 0x607c
movq %r12, %rdi
movq %rdx, %rsi
callq 0x4442
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %r14
subq %rdi, %r14
shrq $0x2, %r14
testl %r14d, %r14d
jle 0x3703
andl $0x7fffffff, %r14d      # imm = 0x7FFFFFFF
incq %r14
leaq 0x99a0(%rip), %r15      # 0xd070
movq 0x10(%rsp), %rax
movslq -0x8(%rax,%r14,4), %rax
cmpq $0x1, %rax
je 0x36f5
shlq $0x5, %rax
movq (%rax,%r15), %rsi
movq 0x8(%rax,%r15), %rdx
movq %r12, %rdi
callq 0x20a0
decq %r14
cmpq $0x1, %r14
ja 0x36d0
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x3715
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
movq %r12, %rax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3737
movq %rax, %r14
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
jmp 0x3774
movq %rax, %r14
jmp 0x3753
movq %rax, %r14
movq (%r12), %rdi
cmpq %rbx, %rdi
je 0x3753
movq (%rbx), %rsi
incq %rsi
callq 0x21d0
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x3786
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
jmp 0x3781
movq %rax, %r14
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x3786
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x21d0
movq %r14, %rdi
callq 0x22d0