const MOD = 1_0000_0000_7 const HIGH = int32.high proc scanf(formatstr: cstring){.header: "", varargs.} var n:int scanf("%ld\n",addr n) var res = 0 for _ in 0.. HIGH : c = c mod MOD if d > HIGH : d = d mod MOD res += c * d if res > HIGH: res = res mod MOD echo res