	.file	"178266362.c"
	.intel_syntax noprefix
	.text
	.globl	p
	.section	.rodata
	.align 8
	.type	p, @object
	.size	p, 8
p:
	.quad	998244353
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 888888
a:
	.zero	888888
	.globl	ans
	.align 8
	.type	ans, @object
	.size	ans, 8
ans:
	.zero	8
	.text
	.globl	f
	.type	f, @function
f:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 16
	mov	QWORD PTR -8[rbp], rdi
	cmp	QWORD PTR -8[rbp], 9
	jle	.L2
	mov	rcx, QWORD PTR -8[rbp]
	movabs	rdx, 7378697629483820647
	mov	rax, rcx
	imul	rdx
	mov	rax, rdx
	sar	rax, 2
	sar	rcx, 63
	mov	rdx, rcx
	sub	rax, rdx
	mov	rdi, rax
	call	f
	mov	rdx, rax
	mov	rax, rdx
	sal	rax, 2
	add	rax, rdx
	lea	rdx, 0[0+rax*4]
	add	rax, rdx
	sal	rax, 2
	mov	rdi, rax
	mov	rcx, QWORD PTR -8[rbp]
	movabs	rdx, 7378697629483820647
	mov	rax, rcx
	imul	rdx
	mov	rax, rdx
	sar	rax, 2
	mov	rsi, rcx
	sar	rsi, 63
	sub	rax, rsi
	mov	rdx, rax
	mov	rax, rdx
	sal	rax, 2
	add	rax, rdx
	add	rax, rax
	sub	rcx, rax
	mov	rdx, rcx
	lea	rax, [rdi+rdx]
	mov	ecx, 998244353
	cqo
	idiv	rcx
	jmp	.L3
.L2:
	mov	rcx, QWORD PTR -8[rbp]
	movabs	rdx, 7378697629483820647
	mov	rax, rcx
	imul	rdx
	mov	rax, rdx
	sar	rax, 2
	mov	rsi, rcx
	sar	rsi, 63
	sub	rax, rsi
	mov	rdx, rax
	mov	rax, rdx
	sal	rax, 2
	add	rax, rdx
	add	rax, rax
	sub	rcx, rax
	mov	rdx, rcx
.L3:
	mov	rax, rdx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	f, .-f
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%lld"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 16
	mov	DWORD PTR -4[rbp], edi
	mov	DWORD PTR -8[rbp], esi
	lea	rax, -4[rbp]
	mov	rsi, rax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	scanf@PLT
	mov	DWORD PTR -8[rbp], 1
	jmp	.L5
.L6:
	mov	eax, DWORD PTR -8[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, a[rip]
	add	rax, rdx
	mov	rsi, rax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	scanf@PLT
	mov	eax, DWORD PTR -8[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, a[rip]
	mov	rax, QWORD PTR [rdx+rax]
	mov	rdi, rax
	call	f
	mov	rdx, rax
	mov	rax, rdx
	sal	rax, 2
	add	rax, rdx
	add	rax, rax
	add	rdx, rax
	mov	rax, QWORD PTR ans[rip]
	add	rax, rdx
	mov	ecx, 998244353
	cqo
	idiv	rcx
	mov	rax, rdx
	mov	QWORD PTR ans[rip], rax
	add	DWORD PTR -8[rbp], 1
.L5:
	mov	eax, DWORD PTR -4[rbp]
	cmp	DWORD PTR -8[rbp], eax
	jle	.L6
	mov	eax, DWORD PTR -4[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR ans[rip]
	imul	rax, rdx
	mov	ecx, 998244353
	cqo
	idiv	rcx
	mov	rax, rdx
	mov	rsi, rax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 10.5.0-1ubuntu1~20.04) 10.5.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 6
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"178266362.c"
	.text
	.global	p
	.section	.rodata
	.align	3
	.type	p, %object
	.size	p, 8
p:
	.word	998244353
	.word	0
	.comm	a,888888,8
	.comm	ans,8,8
	.global	__aeabi_ldivmod
	.text
	.align	2
	.global	f
	.syntax unified
	.arm
	.fpu softvfp
	.type	f, %function
f:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, fp, lr}
	add	fp, sp, #28
	sub	sp, sp, #16
	str	r0, [fp, #-36]
	str	r1, [fp, #-32]
	sub	r3, fp, #36
	ldmia	r3, {r2-r3}
	cmp	r2, #10
	sbcs	r3, r3, #0
	blt	.L2
	sub	r1, fp, #36
	ldmia	r1, {r0-r1}
	mov	r2, #10
	mov	r3, #0
	bl	__aeabi_ldivmod
	mov	r2, r0
	mov	r3, r1
	mov	r0, r2
	mov	r1, r3
	bl	f
	mov	r4, r0
	mov	r5, r1
	mov	r2, r4
	mov	r3, r5
	adds	r1, r2, r2
	str	r1, [fp, #-44]
	adc	r3, r3, r3
	str	r3, [fp, #-40]
	sub	r3, fp, #44
	ldmia	r3, {r2-r3}
	adds	r2, r2, r4
	adc	r3, r3, r5
	mov	r0, #0
	mov	r1, #0
	lsl	r1, r3, #5
	orr	r1, r1, r2, lsr #27
	lsl	r0, r2, #5
	adds	r2, r2, r0
	adc	r3, r3, r1
	adds	r6, r2, r4
	adc	r7, r3, r5
	sub	r1, fp, #36
	ldmia	r1, {r0-r1}
	mov	r2, #10
	mov	r3, #0
	bl	__aeabi_ldivmod
	adds	r8, r6, r2
	adc	r9, r7, r3
	ldr	r2, .L4
	mov	r3, #0
	mov	r0, r8
	mov	r1, r9
	bl	__aeabi_ldivmod
	b	.L3
.L2:
	sub	r1, fp, #36
	ldmia	r1, {r0-r1}
	mov	r2, #10
	mov	r3, #0
	bl	__aeabi_ldivmod
.L3:
	mov	r0, r2
	mov	r1, r3
	sub	sp, fp, #28
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, fp, pc}
.L5:
	.align	2
.L4:
	.word	998244353
	.size	f, .-f
	.section	.rodata
	.align	2
.LC0:
	.ascii	"%d\000"
	.align	2
.LC1:
	.ascii	"%lld\000"
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, fp, lr}
	add	fp, sp, #28
	sub	sp, sp, #16
	str	r0, [fp, #-32]
	str	r1, [fp, #-36]
	sub	r3, fp, #32
	mov	r1, r3
	ldr	r0, .L10
	bl	scanf
	mov	r3, #1
	str	r3, [fp, #-36]
	b	.L7
.L8:
	ldr	r3, [fp, #-36]
	lsl	r3, r3, #3
	ldr	r2, .L10+4
	add	r3, r3, r2
	mov	r1, r3
	ldr	r0, .L10+8
	bl	scanf
	ldr	r2, .L10+4
	ldr	r3, [fp, #-36]
	lsl	r3, r3, #3
	add	r3, r2, r3
	ldmia	r3, {r2-r3}
	mov	r0, r2
	mov	r1, r3
	bl	f
	mov	r2, r0
	mov	r3, r1
	adds	ip, r2, r2
	str	ip, [fp, #-44]
	adc	r3, r3, r3
	str	r3, [fp, #-40]
	sub	r3, fp, #44
	ldmia	r3, {r2-r3}
	adds	r2, r2, r0
	adc	r3, r3, r1
	mov	r4, #0
	mov	r5, #0
	lsl	r5, r3, #2
	orr	r5, r5, r2, lsr #30
	lsl	r4, r2, #2
	mov	r2, r4
	mov	r3, r5
	subs	r6, r2, r0
	sbc	r7, r3, r1
	ldr	r3, .L10+12
	ldmia	r3, {r2-r3}
	adds	r8, r6, r2
	adc	r9, r7, r3
	ldr	r2, .L10+16
	mov	r3, #0
	mov	r0, r8
	mov	r1, r9
	bl	__aeabi_ldivmod
	ldr	r1, .L10+12
	stm	r1, {r2-r3}
	ldr	r3, [fp, #-36]
	add	r3, r3, #1
	str	r3, [fp, #-36]
.L7:
	ldr	r3, [fp, #-32]
	ldr	r2, [fp, #-36]
	cmp	r2, r3
	ble	.L8
	ldr	r3, [fp, #-32]
	mov	r0, r3
	asr	r1, r0, #31
	ldr	r3, .L10+12
	ldmia	r3, {r2-r3}
	mul	lr, r2, r1
	mul	ip, r0, r3
	add	ip, lr, ip
	umull	r4, r5, r0, r2
	add	r3, ip, r5
	mov	r5, r3
	ldr	r2, .L10+16
	mov	r3, #0
	mov	r0, r4
	mov	r1, r5
	bl	__aeabi_ldivmod
	ldr	r0, .L10+8
	bl	printf
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #28
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, fp, pc}
.L11:
	.align	2
.L10:
	.word	.LC0
	.word	a
	.word	.LC1
	.word	ans
	.word	998244353
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
