// File: /workspace/github_cpp_makefile_star2_O2/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, 0x50(%rsp)
andl $0x0, 0xc0adc8e(%rip)   # 0xc0b0744
movl 0x8(%rsi), %eax
movl %eax, 0x10(%rsp)
xorl %r13d, %r13d
pushq $0x20
popq %rbp
movq %rsi, %rdi
movl %ebp, %esi
xorl %edx, %edx
callq 0x2200
movq %rax, %rbx
leaq 0x20(%rsp), %r15
leaq 0x9552(%rip), %r12      # 0xc030
movslq %r13d, %rdx
cmpl $-0x1, %ebx
je 0x2b41
movl %ebx, %eax
subl %edx, %eax
movslq %eax, %rcx
movq %r15, %rdi
movq %r14, %rsi
callq 0x21c0
movq %r12, %rdi
movq %r15, %rsi
callq 0x492e
movl (%rax), %eax
movslq 0xc0adc38(%rip), %rcx   # 0xc0b0744
leaq 0x1(%rcx), %rdx
movl %edx, 0xc0adc2e(%rip)   # 0xc0b0744
leaq 0xc0adc33(%rip), %rdx   # 0xc0b0750
movl %eax, 0x4(%rdx,%rcx,4)
movl %ebx, %r13d
incl %r13d
movslq %r13d, %rdx
movq %r14, %rdi
movl %ebp, %esi
callq 0x2200
movq %rax, %rbx
movq %r15, %rdi
callq 0x20d0
jmp 0x2ade
movl 0x10(%rsp), %eax
subl %edx, %eax
movslq %eax, %rcx
leaq 0x20(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x21c0
leaq 0x94cf(%rip), %rdi      # 0xc030
movq %r15, %rsi
callq 0x492e
movl (%rax), %eax
movslq 0xc0adbd2(%rip), %rcx   # 0xc0b0744
leaq 0x1(%rcx), %rdx
movl %edx, 0xc0adbc8(%rip)   # 0xc0b0744
leaq 0xc0adbcd(%rip), %rbx   # 0xc0b0750
movl %eax, 0x4(%rbx,%rcx,4)
leaq 0x20(%rsp), %rdi
callq 0x20d0
movslq 0xc0adbac(%rip), %rdx   # 0xc0b0744
leal 0x2(%rdx), %eax
movl %eax, 0xc0adba3(%rip)   # 0xc0b0744
pushq $0x1
popq %rsi
movl %esi, 0xc0adba6(%rip)   # 0xc0b0750
xorl %ecx, %ecx
testl %eax, %eax
movl $0x0, %edi
cmovgl %eax, %edi
movl %esi, 0x4(%rbx,%rdx,4)
imulq $0x18, %rdi, %rdx
leaq 0xe3099eb(%rip), %rdi   # 0xe30c5b0
leaq 0xe303c24(%rip), %r14   # 0xe3067f0
cmpq %rcx, %rdx
je 0x2bf7
movq (%rcx,%rdi), %rsi
cmpq %rsi, 0x8(%rcx,%rdi)
je 0x2be1
movq %rsi, 0x8(%rcx,%rdi)
movq (%rcx,%r14), %rsi
cmpq %rsi, 0x8(%rcx,%r14)
je 0x2bf1
movq %rsi, 0x8(%rcx,%r14)
addq $0x18, %rcx
jmp 0x2bcc
leaq 0x59ae842(%rip), %rbx   # 0x59b1440
xorl %ebp, %ebp
movslq %eax, %rcx
cmpq %rcx, %rbp
jge 0x2d22
imulq $0x18, %rbp, %rcx
leaq (%rcx,%r14), %r15
addq $-0x18, %r15
xorl %edx, %edx
movq %rbp, %r14
movslq %eax, %rcx
cmpq %rcx, %r14
jge 0x2d13
movslq %edx, %rax
imulq $0x48, %rax, %r12
addq %rbx, %r12
leaq 0xc0adb16(%rip), %rax   # 0xc0b0750
leaq (%rax,%r14,4), %r13
movq %r12, %rdi
movq %r13, %rsi
callq 0x4994
testq %rax, %rax
je 0x2d0d
movq %r12, %rdi
movq %r13, %rsi
callq 0x4592
movslq (%rax), %rax
movq %rax, 0x18(%rsp)
imulq $0x48, %rax, %rax
leaq (%rax,%rbx), %r13
addq $0x30, %r13
movq 0x8(%r13), %rbx
subq (%r13), %rbx
shrq $0x2, %rbx
movq %r14, 0x10(%rsp)
imulq $0x18, %r14, %r12
leaq 0xe309923(%rip), %rax   # 0xe30c5b0
addq %rax, %r12
testl %ebx, %ebx
movl $0x0, %eax
cmovlel %eax, %ebx
shlq $0x2, %rbx
xorl %r14d, %r14d
cmpq %r14, %rbx
je 0x2cee
movq (%r13), %rsi
testq %rbp, %rbp
je 0x2cdd
movq 0x8(%r12), %rax
subq (%r12), %rax
movl (%rsi,%r14), %ecx
andq $-0x4, %rax
shlq $0x1e, %rax
orq %rcx, %rax
movq %rax, 0x20(%rsp)
movq %r15, %rdi
leaq 0x20(%rsp), %rsi
callq 0x4b86
movq (%r13), %rsi
addq %r14, %rsi
movq %r12, %rdi
callq 0x45e0
addq $0x4, %r14
jmp 0x2ca1
movq 0x10(%rsp), %r14
incq %r14
movl 0xc0ada48(%rip), %eax   # 0xc0b0744
leaq 0x59ae73d(%rip), %rbx   # 0x59b1440
movq 0x18(%rsp), %rdx
jmp 0x2c1d
movl 0xc0ada31(%rip), %eax   # 0xc0b0744
incq %rbp
leaq 0xe303ad3(%rip), %r14   # 0xe3067f0
jmp 0x2c00
xorl %ecx, %ecx
testl %eax, %eax
movl $0x0, %edx
cmovgl %eax, %edx
leaq 0xc0ae9bb(%rip), %rsi   # 0xc0b16f0
leaq 0xd791fb4(%rip), %rdi   # 0xd794cf0
movabsq $-0x2d6094f0f6d6a639, %r8 # imm = 0xD29F6B0F092959C7
xorl %r9d, %r9d
leaq 0xe309860(%rip), %rbp   # 0xe30c5b0
cmpq %rdx, %r9
je 0x2d96
imulq $0x18, %r9, %r11
movq 0x8(%r11,%rbp), %r10
subq (%r11,%rbp), %r10
shrq $0x2, %r10
testl %r10d, %r10d
cmovlel %ecx, %r10d
xorl %r11d, %r11d
cmpq %r11, %r10
je 0x2d83
movq %r8, (%rsi,%r11,8)
orl $-0x1, (%rdi,%r11,4)
incq %r11
jmp 0x2d70
incq %r9
addq $0x5dc0, %rsi           # imm = 0x5DC0
addq $0x2ee0, %rdi           # imm = 0x2EE0
jmp 0x2d50
andq $0x0, 0xc0ae952(%rip)   # 0xc0b16f0
xorl %edx, %edx
leal -0x1(%rax), %ebx
movslq %ebx, %rcx
cmpq %rcx, %rdx
jge 0x2f3a
imulq $0x18, %rdx, %rax
movq 0x8(%rax,%rbp), %rsi
subq (%rax,%rbp), %rsi
shrq $0x2, %rsi
movq 0x8(%rax,%r14), %r12
subq (%rax,%r14), %r12
shrq $0x3, %r12
testl %r12d, %r12d
movl $0x0, %ecx
cmovlel %ecx, %r12d
leaq (%rax,%rbp), %rdi
movq %rdi, 0x10(%rsp)
testl %esi, %esi
cmovlel %ecx, %esi
movq %rsi, 0x60(%rsp)
leaq (%r14,%rax), %rbx
movq %rdx, 0x48(%rsp)
imulq $0x5dc0, %rdx, %rcx     # imm = 0x5DC0
leaq 0xc0ae8ed(%rip), %rax   # 0xc0b16f0
addq %rax, %rcx
movq %rcx, 0x58(%rsp)
xorl %r15d, %r15d
cmpq 0x60(%rsp), %r15
je 0x2f19
xorl %r14d, %r14d
xorl %r13d, %r13d
cmpq %r14, %r12
je 0x2e47
movq 0x10(%rsp), %rax
movq (%rax), %rax
movl (%rax,%r15,4), %edi
movq (%rbx), %rax
movl (%rax,%r14,8), %esi
callq 0x49ae
addl %eax, %r13d
incl %r13d
incq %r14
jmp 0x2e1f
movq 0x58(%rsp), %rax
leaq (%rax,%r15,8), %rax
movq %rax, 0x70(%rsp)
cvtsi2sd %r13d, %xmm0
movsd %xmm0, 0x68(%rsp)
xorl %r13d, %r13d
cmpq %r13, %r12
je 0x2f11
movq %r12, %rbp
movq (%rbx), %rax
movslq (%rax,%r13,8), %rsi
movq %rsi, %rcx
shlq $0x5, %rcx
leaq 0x91dc(%rip), %rdx      # 0xc060
movq 0x8(%rcx,%rdx), %r12
shrq %r12
addl 0x48(%rsp), %r12d
movslq 0x4(%rax,%r13,8), %r14
movq 0x70(%rsp), %rax
movsd (%rax), %xmm0
movsd %xmm0, 0x18(%rsp)
movq 0x10(%rsp), %rax
movq (%rax), %rax
movl (%rax,%r15,4), %edi
callq 0x49ae
incl %eax
cvtsi2sd %eax, %xmm0
divsd 0x68(%rsp), %xmm0
callq 0x2160
addsd 0x18(%rsp), %xmm0
movslq %r12d, %rax
imulq $0x5dc0, %rax, %rcx     # imm = 0x5DC0
leaq 0xc0ae812(%rip), %rdx   # 0xc0b16f0
addq %rdx, %rcx
ucomisd (%rcx,%r14,8), %xmm0
jbe 0x2f06
leaq (%rcx,%r14,8), %rcx
movsd %xmm0, (%rcx)
imulq $0x2ee0, %rax, %rax     # imm = 0x2EE0
leaq 0xd791df1(%rip), %rcx   # 0xd794cf0
addq %rcx, %rax
movl %r15d, (%rax,%r14,4)
incq %r13
movq %rbp, %r12
jmp 0x2e63
incq %r15
jmp 0x2e0e
movq 0x48(%rsp), %rdx
incq %rdx
movl 0xc0ad81d(%rip), %eax   # 0xc0b0744
leaq 0xe309682(%rip), %rbp   # 0xe30c5b0
leaq 0xe3038bb(%rip), %r14   # 0xe3067f0
jmp 0x2da0
imulq $0x18, %rcx, %rdx
movq 0x8(%rdx,%rbp), %rcx
subq (%rdx,%rbp), %rcx
shrq $0x2, %rcx
xorl %edx, %edx
testl %ecx, %ecx
cmovlel %edx, %ecx
cltq
imulq $0x5dc0, %rax, %rax     # imm = 0x5DC0
leaq 0xc0ae78e(%rip), %rsi   # 0xc0b16f0
addq %rax, %rsi
addq $-0x5dc0, %rsi          # imm = 0xA240
pushq $-0x1
popq %rax
movsd 0x2091(%rip), %xmm0     # 0x5008
cmpq %rdx, %rcx
je 0x2f95
movsd (%rsi,%rdx,8), %xmm1
ucomisd %xmm0, %xmm1
cmoval %edx, %eax
maxsd %xmm0, %xmm1
incq %rdx
movapd %xmm1, %xmm0
jmp 0x2f77
xorpd %xmm0, %xmm0
leaq 0x20(%rsp), %r14
movapd %xmm0, (%r14)
andq $0x0, 0x10(%r14)
testl %ebx, %ebx
je 0x3002
movslq %ebx, %r12
imulq $0x18, %r12, %r13
movslq %eax, %r15
leaq (,%r15,4), %rsi
addq (%r13,%rbp), %rsi
movq %r14, %rdi
callq 0x45e0
addq %rbp, %r13
movq (%r13), %rax
movslq (%rax,%r15,4), %rax
shlq $0x5, %rax
leaq 0x907f(%rip), %rcx      # 0xc060
movq 0x8(%rax,%rcx), %rcx
shrq %rcx
imulq $0x2ee0, %r12, %rax     # imm = 0x2EE0
leaq 0xd791cf9(%rip), %rdx   # 0xd794cf0
addq %rdx, %rax
movl (%rax,%r15,4), %eax
subl %ecx, %ebx
jmp 0x2fa8
leaq 0x2033(%rip), %rsi      # 0x503c
leaq 0xf(%rsp), %rdx
movq 0x50(%rsp), %r14
movq %r14, %rdi
callq 0x33aa
movq 0x28(%rsp), %rax
subq 0x20(%rsp), %rax
shrq $0x2, %rax
movl %eax, %ebx
testl %ebx, %ebx
jle 0x305a
movq 0x20(%rsp), %rax
movslq -0x4(%rax,%rbx,4), %rsi
cmpq $0x1, %rsi
je 0x3055
shlq $0x5, %rsi
leaq 0x9016(%rip), %rax      # 0xc060
addq %rax, %rsi
movq %r14, %rdi
callq 0x22e0
decq %rbx
jmp 0x302b
leaq 0x20(%rsp), %rdi
callq 0x4e7e
movq %r14, %rax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3087
jmp 0x3096
movq %r14, %rdi
movq %rax, %r14
callq 0x20d0
jmp 0x308a
movq %rax, %r14
leaq 0x20(%rsp), %rdi
callq 0x4e7e
jmp 0x30a3
movq %rax, %r14
leaq 0x20(%rsp), %rdi
callq 0x20d0
movq %r14, %rdi
callq 0x22a0