// File: /workspace/github_cpp_makefile_star2_O1/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 $0x68, %rsp
movq %rsi, %r14
movq %rdi, 0x50(%rsp)
movl $0x0, 0xc0ae9a8(%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 0x2e58
xorl %r15d, %r15d
leaq 0x10(%rsp), %r12
leaq 0xa260(%rip), %r13      # 0xd040
leaq 0xc0ae979(%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 0x4ec0
movl (%rax), %eax
movslq 0xc0ae944(%rip), %rcx   # 0xc0b1754
leaq 0x1(%rcx), %rdx
movl %edx, 0xc0ae93a(%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 0x2e53
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x21d0
cmpl $-0x1, %ebp
jne 0x2de7
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 0xa1c5(%rip), %rdi      # 0xd040
movq %r15, %rsi
callq 0x4ec0
movl (%rax), %eax
movslq 0xc0ae8c8(%rip), %rcx   # 0xc0b1754
leaq 0x1(%rcx), %rdx
movl %edx, 0xc0ae8be(%rip)   # 0xc0b1754
leaq 0xc0ae8c3(%rip), %rdx   # 0xc0b1760
movl %eax, 0x4(%rdx,%rcx,4)
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2ebc
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x21d0
movslq 0xc0ae891(%rip), %rdx   # 0xc0b1754
leal 0x2(%rdx), %ecx
movl %ecx, 0xc0ae888(%rip)   # 0xc0b1754
movl $0x1, %eax
movl %eax, 0xc0ae889(%rip)   # 0xc0b1760
leaq 0xc0ae882(%rip), %rsi   # 0xc0b1760
movl %eax, 0x4(%rsi,%rdx,4)
cmpq $-0x1, %rdx
jl 0x2f2f
cmpl $0x2, %ecx
cmovgel %ecx, %eax
shlq $0x3, %rax
leaq (%rax,%rax,2), %rax
xorl %ecx, %ecx
leaq 0xe30a6c1(%rip), %rdx   # 0xe30d5c0
leaq 0xe3048fa(%rip), %rsi   # 0xe307800
movq (%rcx,%rdx), %rdi
cmpq %rdi, 0x8(%rcx,%rdx)
je 0x2f16
movq %rdi, 0x8(%rcx,%rdx)
movq (%rcx,%rsi), %rdi
cmpq %rdi, 0x8(%rcx,%rsi)
je 0x2f26
movq %rdi, 0x8(%rcx,%rsi)
addq $0x18, %rcx
cmpq %rcx, %rax
jne 0x2f06
movl 0xc0ae81f(%rip), %eax   # 0xc0b1754
testl %eax, %eax
jle 0x3097
xorl %ebp, %ebp
leaq 0x59af50a(%rip), %rbx   # 0x59b2450
movslq 0xc0ae807(%rip), %rax   # 0xc0b1754
cmpq %rax, %rbp
jge 0x3084
leaq (,%rbp,2), %rax
addq %rbp, %rax
leaq 0xe304898(%rip), %rcx   # 0xe307800
leaq (%rcx,%rax,8), %r15
addq $-0x18, %r15
xorl %eax, %eax
movq %rbp, %r14
cltq
leaq (%rax,%rax,8), %rax
leaq (%rbx,%rax,8), %r12
leaq 0xc0ae7da(%rip), %rax   # 0xc0b1760
leaq (%rax,%r14,4), %r13
movq %r12, %rdi
movq %r13, %rsi
callq 0x4f3c
testq %rax, %rax
je 0x3084
movq %r14, 0x8(%rsp)
movq %r12, %rdi
movq %r13, %rsi
callq 0x4b7a
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 0x3060
leaq 0x59af478(%rip), %rcx   # 0x59b2450
leaq (%rcx,%rax,8), %r14
addq $0x30, %r14
movq 0x8(%rsp), %rax
leaq (%rax,%rax,2), %rax
leaq 0xe30a5d0(%rip), %rcx   # 0xe30d5c0
leaq (%rcx,%rax,8), %r12
andl $0x7fffffff, %r13d      # imm = 0x7FFFFFFF
xorl %ebx, %ebx
testq %rbp, %rbp
je 0x302e
movq (%r14), %rax
movq 0x8(%r12), %rcx
subq (%r12), %rcx
movl (%rax,%rbx), %eax
andq $-0x4, %rcx
shlq $0x1e, %rcx
orq %rax, %rcx
movq %rcx, 0x10(%rsp)
movq %r15, %rdi
leaq 0x10(%rsp), %rsi
callq 0x5068
movq (%r14), %rdx
addq %rbx, %rdx
movq 0x8(%r12), %rsi
cmpq 0x10(%r12), %rsi
je 0x304f
movl (%rdx), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%r12)
jmp 0x3057
movq %r12, %rdi
callq 0x4de4
addq $0x4, %rbx
decq %r13
jne 0x2ffd
movq 0x8(%rsp), %r14
incq %r14
movslq 0xc0ae6e5(%rip), %rax   # 0xc0b1754
cmpq %rax, %r14
leaq 0x59af3d7(%rip), %rbx   # 0x59b2450
movq 0x38(%rsp), %rax
jl 0x2f75
incq %rbp
movslq 0xc0ae6c6(%rip), %rax   # 0xc0b1754
cmpq %rax, %rbp
jl 0x2f46
testl %eax, %eax
jle 0x31a3
movl %eax, %ebx
leaq 0xc0af660(%rip), %r14   # 0xc0b2708
xorl %r15d, %r15d
leaq 0xe30a50e(%rip), %r12   # 0xe30d5c0
movabsq $-0x2d6094f0f6d6a639, %r13 # imm = 0xD29F6B0F092959C7
leaq (%r15,%r15,2), %rax
movq 0x8(%r12,%rax,8), %rdx
subq (%r12,%rax,8), %rdx
movq %rdx, %rbp
shrq $0x2, %rbp
testl %ebp, %ebp
jle 0x3190
imulq $0x2ee0, %r15, %rdi     # imm = 0x2EE0
leaq 0xd792c1a(%rip), %rax   # 0xd795d00
addq %rax, %rdi
movabsq $0x1fffffffc, %rax      # imm = 0x1FFFFFFFC
andq %rax, %rdx
movl $0xff, %esi
callq 0x2110
movdqa 0x2f28(%rip), %xmm7     # 0x6030
pcmpeqd %xmm6, %xmm6
movdqa 0x2f0c(%rip), %xmm5     # 0x6020
movl %ebp, %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
incl %ebp
andl $-0x2, %ebp
decq %rax
movq %rax, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
pxor %xmm5, %xmm0
xorl %eax, %eax
movdqa 0x2ed5(%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 0x3171
movq %r13, -0x8(%r14,%rax,8)
pxor %xmm6, %xmm2
pextrw $0x4, %xmm2, %ecx
testb $0x1, %cl
je 0x3183
movq %r13, (%r14,%rax,8)
addq $0x2, %rax
paddq %xmm7, %xmm1
cmpq %rax, %rbp
jne 0x313b
incq %r15
addq $0x5dc0, %r14           # imm = 0x5DC0
cmpq %rbx, %r15
jne 0x30bc
movq $0x0, 0xc0af552(%rip) # 0xc0b2700
movl 0xc0ae59f(%rip), %r15d  # 0xc0b1754
leaq 0xe30a404(%rip), %r9    # 0xe30d5c0
cmpl $0x2, %r15d
jl 0x3451
xorl %eax, %eax
leaq 0x5025bd9(%rip), %r10   # 0x5028da8
movq %rax, 0x30(%rsp)
leaq (,%rax,8), %rax
leaq (%rax,%rax,2), %rax
movq 0x8(%r9,%rax), %rcx
subq (%r9,%rax), %rcx
shrq $0x2, %rcx
movq %rcx, 0x40(%rsp)
testl %ecx, %ecx
jle 0x342d
leaq 0xe30a3bf(%rip), %rcx   # 0xe30d5c0
leaq (%rcx,%rax), %r15
leaq 0xe3045f4(%rip), %rcx   # 0xe307800
leaq (%rcx,%rax), %r12
movq 0x8(%rcx,%rax), %rbx
subq (%rcx,%rax), %rbx
shrq $0x3, %rbx
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
andq %rax, 0x40(%rsp)
movq %rbx, %rcx
andq %rax, %rcx
movq %rcx, 0x8(%rsp)
xorl %ebp, %ebp
movq %rbx, 0x58(%rsp)
testl %ebx, %ebx
jle 0x32d6
xorl %r13d, %r13d
xorl %r14d, %r14d
movq (%r15), %rax
movslq (%rax,%rbp,4), %rax
movq (%r12), %rcx
movslq (%rcx,%r13,8), %rcx
imulq $0x16e360, %rax, %rax   # imm = 0x16E360
addq %rcx, %rax
movq 0x5025b49(%rip), %rdx   # 0x5028db0
movq %r10, %rcx
testq %rdx, %rdx
je 0x328a
movq %r10, %rcx
xorl %esi, %esi
cmpq %rax, 0x20(%rdx)
setl %sil
cmovgeq %rdx, %rcx
movq 0x10(%rdx,%rsi,8), %rdx
testq %rdx, %rdx
jne 0x3272
movl $0x1, %edx
cmpq %r10, %rcx
je 0x32bb
cmpq 0x20(%rcx), %rax
jl 0x32bb
movq %rax, 0x10(%rsp)
leaq 0x5025afa(%rip), %rdi   # 0x5028da0
leaq 0x10(%rsp), %rsi
callq 0x51de
leaq 0x5025af1(%rip), %r10   # 0x5028da8
movl (%rax), %edx
incl %edx
addl %edx, %r14d
incq %r13
cmpq 0x8(%rsp), %r13
jne 0x3247
xorps %xmm0, %xmm0
cvtsi2sd %r14d, %xmm0
jmp 0x32da
pxor %xmm0, %xmm0
movsd %xmm0, 0x48(%rsp)
testl %ebx, %ebx
jle 0x341a
imulq $0x5dc0, 0x30(%rsp), %rax # imm = 0x5DC0
leaq 0xc0af408(%rip), %rcx   # 0xc0b2700
addq %rcx, %rax
leaq (%rax,%rbp,8), %rax
movq %rax, 0x60(%rsp)
xorl %r13d, %r13d
movq %r12, %rbx
movq (%r12), %rcx
movslq (%rcx,%r13,8), %rdx
movq %r15, %r12
movq (%r15), %rax
movslq (%rax,%rbp,4), %rax
imulq $0x16e360, %rax, %rax   # imm = 0x16E360
addq %rdx, %rax
movq 0x5025a83(%rip), %rdi   # 0x5028db0
movq %r10, %rsi
testq %rdi, %rdi
je 0x3351
movq %r10, %rsi
xorl %r8d, %r8d
cmpq %rax, 0x20(%rdi)
setl %r8b
cmovgeq %rdi, %rsi
movq 0x10(%rdi,%r8,8), %rdi
testq %rdi, %rdi
jne 0x3338
shlq $0x5, %rdx
leaq 0x9d14(%rip), %rdi      # 0xd070
movq 0x8(%rdx,%rdi), %r15
movslq 0x4(%rcx,%r13,8), %r14
movq 0x60(%rsp), %rcx
movsd (%rcx), %xmm0
movsd %xmm0, 0x38(%rsp)
movsd 0x2cc3(%rip), %xmm0     # 0x6040
cmpq %r10, %rsi
je 0x33a9
cmpq 0x20(%rsi), %rax
jl 0x33a9
movq %rax, 0x10(%rsp)
leaq 0x5025a0c(%rip), %rdi   # 0x5028da0
leaq 0x10(%rsp), %rsi
callq 0x51de
movl (%rax), %eax
incl %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd 0x48(%rsp), %xmm0
shrq %r15
addq 0x30(%rsp), %r15
callq 0x2170
movsd 0x38(%rsp), %xmm1
addsd %xmm0, %xmm1
movslq %r15d, %rax
imulq $0x5dc0, %rax, %rcx     # imm = 0x5DC0
leaq 0xc0af329(%rip), %rdx   # 0xc0b2700
addq %rdx, %rcx
ucomisd (%rcx,%r14,8), %xmm1
jbe 0x33ff
leaq (%rcx,%r14,8), %rcx
movsd %xmm1, (%rcx)
imulq $0x2ee0, %rax, %rax     # imm = 0x2EE0
leaq 0xd792908(%rip), %rcx   # 0xd795d00
addq %rcx, %rax
movl %ebp, (%rax,%r14,4)
incq %r13
cmpq 0x8(%rsp), %r13
movq %r12, %r15
movq %rbx, %r12
leaq 0x5025994(%rip), %r10   # 0x5028da8
jne 0x3307
incq %rbp
cmpq 0x40(%rsp), %rbp
movq 0x58(%rsp), %rbx
jne 0x3239
movq 0x30(%rsp), %rax
incq %rax
movslq 0xc0ae318(%rip), %r15   # 0xc0b1754
decq %r15
cmpq %r15, %rax
leaq 0xe30a177(%rip), %r9    # 0xe30d5c0
jl 0x31cf
jmp 0x3454
decl %r15d
movslq %r15d, %rax
leaq (%rax,%rax,2), %rdx
movq 0x8(%r9,%rdx,8), %rcx
subq (%r9,%rdx,8), %rcx
shrq $0x2, %rcx
testl %ecx, %ecx
jle 0x34b2
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
imulq $0x5dc0, %rax, %rdx     # imm = 0x5DC0
movsd 0x2bc7(%rip), %xmm0     # 0x6048
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
xorl %esi, %esi
leaq 0xc0af271(%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 0x348f
jmp 0x34b7
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
xorpd %xmm0, %xmm0
movapd %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
testl %r15d, %r15d
je 0x354c
leaq 0x10(%rsp), %r14
leaq 0x9b95(%rip), %rbx      # 0xd070
leaq 0xd79281e(%rip), %r12   # 0xd795d00
movslq %r15d, %r15
leaq (%r15,%r15,2), %rbp
movslq %eax, %r13
leaq (,%r13,4), %rdx
addq (%r9,%rbp,8), %rdx
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x3513
movl (%rdx), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x18(%rsp)
jmp 0x351b
movq %r14, %rdi
callq 0x4de4
leaq 0xe30a09e(%rip), %r9    # 0xe30d5c0
leaq (%r9,%rbp,8), %rax
movq (%rax), %rax
movslq (%rax,%r13,4), %rax
shlq $0x5, %rax
movq 0x8(%rax,%rbx), %rcx
shrq %rcx
imulq $0x2ee0, %r15, %rax     # imm = 0x2EE0
addq %r12, %rax
movl (%rax,%r13,4), %eax
subl %ecx, %r15d
jne 0x34e2
movq 0x50(%rsp), %r12
leaq 0x10(%r12), %rbx
movq %rbx, (%r12)
leaq 0x2b1b(%rip), %rdx      # 0x607c
movq %r12, %rdi
movq %rdx, %rsi
callq 0x4302
movq 0x18(%rsp), %r14
subq 0x10(%rsp), %r14
shrq $0x2, %r14
testl %r14d, %r14d
jle 0x35be
andl $0x7fffffff, %r14d      # imm = 0x7FFFFFFF
incq %r14
leaq 0x9ae0(%rip), %r15      # 0xd070
movq 0x10(%rsp), %rax
movslq -0x8(%rax,%r14,4), %rax
cmpq $0x1, %rax
je 0x35b5
shlq $0x5, %rax
movq (%rax,%r15), %rsi
movq 0x8(%rax,%r15), %rdx
movq %r12, %rdi
callq 0x20a0
decq %r14
cmpq $0x1, %r14
jg 0x3590
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x35d5
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
movq %r12, %rax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x35f7
movq %rax, %r14
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
jmp 0x3634
movq %rax, %r14
jmp 0x3613
movq %rax, %r14
movq (%r12), %rdi
cmpq %rbx, %rdi
je 0x3613
movq (%rbx), %rsi
incq %rsi
callq 0x21d0
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x3646
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
jmp 0x3641
movq %rax, %r14
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x3646
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x21d0
movq %r14, %rdi
callq 0x22d0