Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
import decimal
r = int(input())
print('{:.6f}'.format( r * r * 3.1415926))
print('{:.6f}'.format((r + r) * 3.1415926))

Fixed submission:
import math
r = float(input())
cc = r * r * math.pi
ab = (r + r) * math.pi
print("%.6f"%(cc), "%.6f"%(ab))
Buggy python submission (verdict: Runtime Error):
word = input()
text = []
c = 0
while True:
    read = input().lower().split()
    if read[0] == 'end_of_text':
        break
    else:
        text.append(read)
for i in text:
    for n in i:
        if word in ne:
            c += 1
print(c)

Fixed submission:
word = input().lower()
text = []
c = 0
while True:
    read = input().split()
    if read[0] == 'END_OF_TEXT':
        break
    else:
        text.append(read)
for i in text:
    for n in i:
        if word == n.lower():
            c += 1
print(c)
Buggy python submission (verdict: Runtime Error):
heightOfMountains = []
for i in range(1, 11):
	heightOfMountains.append(int(input()))
	sort.heightOfMountains
	for j in range(1, 4):
		print(heightOfMountains[-j])

Fixed submission:
heightOfMountains = []
for i in range(1, 11):
	heightOfMountains.append(int(input()))
heightOfMountains.sort()
for i in range(1, 4):
	print(heightOfMountains[-i])

Buggy python submission (verdict: Runtime Error):
heightOfMountains = []
for i in range(1, 11):
	heightOfMountains.append(int(input()))
sort.heightOfMountains
for i in range(1, 4):
	print(heightOfMountains[-j])

Fixed submission:
heightOfMountains = []
for i in range(1, 11):
	heightOfMountains.append(int(input()))
heightOfMountains.sort()
for i in range(1, 4):
	print(heightOfMountains[-i])

Buggy python submission (verdict: Runtime Error):
heightOfMountains = []
for i in range(10):
	heightOfMountains.append(int(input()))
heightOfMountains.sort()
for i in range(1, 4):
	print(heightOfMountains[-j])

Fixed submission:
heightOfMountains = []
for i in range(1, 11):
	heightOfMountains.append(int(input()))
heightOfMountains.sort()
for i in range(1, 4):
	print(heightOfMountains[-i])

Buggy python submission (verdict: Runtime Error):
heightOfMountains = []
for i in range(1, 11):
	heightOfMountains.append(int(input()))
heightOfMountains.sort()
for i in range(1, 4):
	print(heightOfMountains[-j])

Fixed submission:
heightOfMountains = []
for i in range(1, 11):
	heightOfMountains.append(int(input()))
heightOfMountains.sort()
for i in range(1, 4):
	print(heightOfMountains[-i])
Buggy python submission (verdict: Runtime Error):
N = int(input())

for i in range(N):
	sides = map(int, input().split())
	longestSide = max(sides)
	sides.remove(longestSide)
	if (longestSide ** 2) == (sides[0] ** 2 + sides[1] ** 2):
		print('YES')
	else:
		print('NO')

Fixed submission:
N = int(input())

for i in range(N):
	sides = list(map(int, input().split()))
	longestSide = max(sides)
	sides.remove(longestSide)
	if (longestSide ** 2) == (sides[0] ** 2 + sides[1] ** 2):
		print('YES')
	else:
		print('NO')
Buggy python submission (verdict: Runtime Error):
for line in sys.stdin:
	a, b, c, d, e, f = map(float, input().split())
	x = (c * e - f * b) / (a * e - d * b)
	y = (c * d - f * a) / (b * d - e * a)
	print('{0:.3f} {1:.3f}'.format(x, y))

Fixed submission:
import sys

for line in sys.stdin:
	a, b, c, d, e, f = map(float, line.split())
	x = (c * e - f * b) / (a * e - d * b)
	y = (c * d - f * a) / (b * d - e * a)
	if x == 0:
		x = 0
	if y == 0:
		y = 0
	print('{0:.3f} {1:.3f}'.format(x, y))

Buggy python submission (verdict: Runtime Error):
import sys

for line in sys.stdin:
	a, b, c, d, e, f = map(float, input().split())
	x = (c * e - f * b) / (a * e - d * b)
	y = (c * d - f * a) / (b * d - e * a)
	print('{0:.3f} {1:.3f}'.format(x, y))

Fixed submission:
import sys

for line in sys.stdin:
	a, b, c, d, e, f = map(float, line.split())
	x = (c * e - f * b) / (a * e - d * b)
	y = (c * d - f * a) / (b * d - e * a)
	if x == 0:
		x = 0
	if y == 0:
		y = 0
	print('{0:.3f} {1:.3f}'.format(x, y))
Buggy python submission (verdict: Runtime Error):
A = list(map(input().split())
B = list(map(input().split())
max = max([max(A), max(B)])
print(max)

Fixed submission:
A, B = [list(map(int, input().split())) for _ in range(2)]
print(max([sum(A), sum(B)]))

Buggy python submission (verdict: Runtime Error):
A = list(map(input().split()))
B = list(map(input().split()))
max = max([max(A), max(B)])
print(max)

Fixed submission:
A, B = [list(map(int, input().split())) for _ in range(2)]
print(max([sum(A), sum(B)]))
Buggy python submission (verdict: Runtime Error):
if __name__ == '__main__':
	a, b = map(int, raw_input().split())
	area = a * b
	circumference = 2*a + 2*b
	print(area + ' ' + circumference)

Fixed submission:
if __name__ == '__main__':
	a, b = map(int, input().split())
	area = a * b
	circumference = 2*a + 2*b
	print(area, circumference)

Buggy python submission (verdict: Runtime Error):
a, b = map(int, raw_input().split())
area = a * b
circumference = 2*a + 2*b
print(area + ' ' + circumference)

Fixed submission:
if __name__ == '__main__':
	a, b = map(int, input().split())
	area = a * b
	circumference = 2*a + 2*b
	print(area, circumference)

Buggy python submission (verdict: Runtime Error):
a, b = input().split())
area = a * b
circumference = 2*a + 2*b
print(area + ' ' + circumference)

Fixed submission:
if __name__ == '__main__':
	a, b = map(int, input().split())
	area = a * b
	circumference = 2*a + 2*b
	print(area, circumference)
Buggy python submission (verdict: Runtime Error):
W, H, x, y, r = map(int, input().split())
if x + r =< W and x - r => 0 and y + r =< H and y - r => 0:
	print('Yes')
else:
	print('No')

Fixed submission:
W, H, x, y, r = map(int, input().split())
if (0 <= x-r and x+r <= W) and (0 <= y-r and y+r <= H):
	print('Yes')
else:
	print('No')
Buggy python submission (verdict: Runtime Error):
dataset = map(int, input().split(\n))
for i in range(len(dataset)):
	if dataset[i] == 0:
		break
	else:
		print("Case %d: %d", i, dataset[i])

Fixed submission:
count = 0
while True:
	count += 1
	x = int(input())
	if x == 0:
		break
	else:
		print("Case %d: %d" % (count, x))
Buggy python submission (verdict: Runtime Error):
import math

r = float(input())
area = math.pi * r * r
circumference = 2 * math.pi * r
print(area, circumferene)

Fixed submission:
import math

r = float(input())
area = math.pi * r * r
circumference = 2 * math.pi * r
print(area, circumference)
Buggy python submission (verdict: Runtime Error):
while op != "?":
	a, op, b = map(str, input().split())
	a, b = int(a), int(b)
	
	if op == "+":
		output = a + b
	elif op == "-":
		output = a - b
	elif op == "*":
		output = a * b
	elif op == "/":
		output = a // b
	print(output)

Fixed submission:
while True:
	a, op, b = map(str, input().split())
	a, b = int(a), int(b)
	
	if op == "+":
		output = a + b
	elif op == "-":
		output = a - b
	elif op == "*":
		output = a * b
	elif op == "/":
		output = a // b
	elif op == "?":
		break
	print(output)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = map(int, input().split())
print(min(a), max(a), sum(a))

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
print(min(a), max(a), sum(a))
Buggy python submission (verdict: Runtime Error):
n = int(input())
cards = []
patterns = ['S', 'H', 'C', 'D']
for i in range n:
	each_card = list(map(str, input().strip()))	
	each_card[1] = int(each_card[1])
	cards.append(each_card)
for p in patterns:
	for r in range(1, 13+1):
		if [p, r] in cards:
			pass
		else:
			print(" ".join(map(str, [p, r])))

Fixed submission:
cards = []
patterns = ['S', 'H', 'C', 'D']

n = int(input())

for p in patterns:
	for i in range(1, 13+1):
		cards.append(p + ' ' + str(i))

for i in range(n):
	cards.remove(input())

for i in range(len(cards)):
	print(cards[i])

Buggy python submission (verdict: Runtime Error):
n = int(input())
cards = []
patterns = ['S', 'H', 'C', 'D']
for i in range n:
	each_card = list(map(str, input().strip()))	
	each_card[1] = int(each_card[1])
	cards.append(each_card)
for p in patterns:
	for r in range(1, 13+1):
		if [p, r] in cards:
			pass
		else:
			print(" ".join(map(str, [p, r])))

Fixed submission:
cards = []
patterns = ['S', 'H', 'C', 'D']

n = int(input())

for p in patterns:
	for i in range(1, 13+1):
		cards.append(p + ' ' + str(i))

for i in range(n):
	cards.remove(input())

for i in range(len(cards)):
	print(cards[i])

Buggy python submission (verdict: Runtime Error):
n = int(input())
cards = []
patterns = ['S', 'H', 'C', 'D']
for i in range n:
	each_card = list(map(str, input().strip()))	
	each_card[1] = int(each_card[1])
	cards.append(each_card)
for p in patterns:
	for r in range(1, 13+1):
		if [p, r] in cards:
			pass
		else:
			# print(" ".join(map(str, [p, r])))
			print(p + ' ' + str(r))

Fixed submission:
cards = []
patterns = ['S', 'H', 'C', 'D']

n = int(input())

for p in patterns:
	for i in range(1, 13+1):
		cards.append(p + ' ' + str(i))

for i in range(n):
	cards.remove(input())

for i in range(len(cards)):
	print(cards[i])

Buggy python submission (verdict: Runtime Error):
n = int(input())
cards = []
patterns = ['S', 'H', 'C', 'D']
for i in range n:
	each_card = list(map(str, input().strip()))	
	each_card[1] = int(each_card[1])
	cards.append(each_card)
for p in patterns:
	for r in range(1, 13+1):
		if [p, r] in cards:
			pass
		else:
			pass

Fixed submission:
cards = []
patterns = ['S', 'H', 'C', 'D']

n = int(input())

for p in patterns:
	for i in range(1, 13+1):
		cards.append(p + ' ' + str(i))

for i in range(n):
	cards.remove(input())

for i in range(len(cards)):
	print(cards[i])

Buggy python submission (verdict: Runtime Error):
n = int(input())
cards = []
patterns = ['S', 'H', 'C', 'D']
for i in range(n):
	each_card = list(map(str, input().strip()))	
	each_card[1] = int(each_card[1])
	cards.append(each_card)
for p in patterns:
	for r in range(1, 13+1):
		if [p, r] in cards:
			pass
		else:
			print(p + ' ' + str(r))

Fixed submission:
cards = []
patterns = ['S', 'H', 'C', 'D']

n = int(input())

for p in patterns:
	for i in range(1, 13+1):
		cards.append(p + ' ' + str(i))

for i in range(n):
	cards.remove(input())

for i in range(len(cards)):
	print(cards[i])
Buggy python submission (verdict: Runtime Error):
# coding: utf-8
w = int(input())
ans = [i + 1 for i in range(w)]
loop = int(input())

# swap
for _ in range(loop):
    left, right = map(int, input().split(","))
    ans[left-1], ans[right-1] = ans[right-1], ans[left-1]

# result
for i in ans:
    print(i)


Fixed submission:
# coding: utf-8
w = int(input())
ans = [i + 1 for i in range(w)]
loop = int(input())

# swap
for _ in range(loop):
    left, right = map(int, input().split(","))
    ans[left-1], ans[right-1] = ans[right-1], ans[left-1]

# result
for i in ans:
    print(i)
Buggy python submission (verdict: Runtime Error):
import sys

for d in map(int, sys.stdin):
  sum = 0
  for x in range(d, 600, d):
    sum += (x**2)*d
  print s

Fixed submission:
import sys

for d in map(int, sys.stdin):
  sum = 0
  for x in range(d, 600, d):
    sum += (x**2)*d
  print sum
Buggy python submission (verdict: Runtime Error):
while True:
  try:
    line = map(int, raw_input().split(","))
  except:
    break
  sum = 0
  rail = []
  for x in line[0:10]:
    sum += x
    rail.append(sum)
  # sum: レールの総距離
  # rail: スタートから各ポイントまでの距離
  cross = sum * (line[10] * 1.0 / (line[10] + line[11]))
  for i, length in enumerate(rail):
    if cross <= length:
      print i+1
      break

Fixed submission:
while True:
  try:
    line = map(int, raw_input().split(","))
  except:
    break
  sum = 0
  rail = []
  for x in line[0:10]:
    sum += x
    rail.append(sum)
  cross = sum * (line[10] * 1.0 / (line[10] + line[11]))
  for i, length in enumerate(rail):
    if cross <= length:
      print i+1
      break
Buggy python submission (verdict: Time Limit Exceeded):
data_map = [0]*4001

for i1 in range(1001):
  for i2 in range(1001):
    for i3 in range(1001):
      for i4 in range(1001):
        data_map[i1+i2+i3+i4] += 1

while True:
  try:
    line = int(raw_input())
  except:
    break
  print data_map[line][3]

Fixed submission:
data_map = [[0] + [1]*1001 + [0]*3000, [0]*4002, [0]*4002, [0]*4002]
for i in range(1,4):
  for j in range(1,4002):
    k = 0 if j < 1000 else j-1000
    data_map[i][j] = sum(data_map[i-1][k:j+1])

while True:
  try:
    line = int(raw_input())
  except:
    break
  print data_map[3][line+1]
Buggy python submission (verdict: Runtime Error):
import sys
import itertools

class RSQ:
    def __init__(self, n):
        self.sz = 1
        self.inf = (1 << 31) - 1
        while self.sz < n: self.sz = self.sz << 1
        self.dat = [0] * (2 * self.sz - 1)
    
    def update(self, idx, x):
        idx += self.sz - 1
        self.dat[idx] += x
        while idx > 0:
            idx = (idx - 1) >> 1
            self.dat[idx] += x
            
    def query(self, a, b):
        return self.query_help(a, b, 0, 0, self.sz)
            
    def query_help(self, a, b, k, l, r):
        if r <= a or b <= l:
            return 0
        elif a <= l and r <= b:
            return self.dat[k]
        else:
            return self.query_help(a, b, 2 * k + 1, l, (l + r)>>1) + \
                    self.query_help(a, b, 2 * k + 2, (l + r) >> 1, r)
    
    
if __name__ == '__main__':
    line = sys.stdin.readline()
    n, q = line.split()
    n, q = int(n), int(q)
    rmq = RSQ(n)
    
    for i in range(q):
        line = sys.stdin.readline()
        op, a, b = line.split()
        op, a, b = int(op), int(a), int(b)
        if op == 0: 
            rmq.update(a, b)
        else: 
            sys.stdout.write(str(rmq.query(a, b + 1)) + '\n')
    

Fixed submission:
import sys
import itertools

class RSQ:
    def __init__(self, n):
        self.sz = 1
        self.inf = (1 << 31) - 1
        while self.sz <= n: self.sz = self.sz << 1
        self.dat = [0] * (2 * self.sz - 1)
    
    def update(self, idx, x):
        idx += self.sz - 1
        self.dat[idx] += x
        while idx > 0:
            idx = (idx - 1) >> 1
            self.dat[idx] += x
            
    def query(self, a, b):
        return self.query_help(a, b, 0, 0, self.sz)
            
    def query_help(self, a, b, k, l, r):
        if r <= a or b <= l:
            return 0
        elif a <= l and r <= b:
            return self.dat[k]
        else:
            return self.query_help(a, b, 2 * k + 1, l, (l + r)>>1) + \
                    self.query_help(a, b, 2 * k + 2, (l + r) >> 1, r)
    
    
if __name__ == '__main__':
    line = sys.stdin.readline()
    n, q = line.split()
    n, q = int(n), int(q)
    rmq = RSQ(n)
    
    for i in range(q):
        line = sys.stdin.readline()
        op, a, b = line.split()
        op, a, b = int(op), int(a), int(b)
        if op == 0: 
            rmq.update(a, b)
        else: 
            sys.stdout.write(str(rmq.query(a, b + 1)) + '\n')
Buggy python submission (verdict: Runtime Error):
import sys
import itertools

def sieve(n):
    is_prime = [True] * (n + 1)
    prime_list = []
    
    is_prime[0] = is_prime[1] = False
    prime_list.append(2)
    
    for i in range(3, n + 1, 2):
        if is_prime[i]: prime_list.append(i)
        for j in range(i * i, n + 1, i):
            is_prime[j] = False
    return prime_list
    
primes = sieve(40000)

def factoriaztion(n):
    ret = []
    for prime in primes:
        while n % prime == 0:
            ret.append(prime)
            n /= prime
        if n == 1: break
    if n > 1: ret.append((n, 1))
    return ret
    
    
if __name__ == '__main__':
    n = sys.stdin.readline()
    n = int(n)
    factors = factoriaztion(n)
    factors = itertools.groupby(factors)
    
    ans = 1
    
    for k, v in factors:
        l = len(list(v))
        ans = ans * (k ** l - k ** (l - 1))
    
    sys.stdout.write(str(ans) + '\n')
    
        

Fixed submission:
from __future__ import division

maxn = 40000

def sieve(n):
    ret = []
    isPrime = [False if i % 2 == 0 else True for i in range(n + 1)]
    isPrime[0] = isPrime[1] = False
    ret.append(2)
    for i in range(3, n + 1, 2):
        if isPrime[i]:
            ret.append(i)
            for j in range(i * i, n + 1, i):
                isPrime[i] = False

    return ret

primes = sieve(maxn)

def factor(n):
    ret, idx = [], 0
    for p in primes:
        if n % p == 0:
            count = 0
            while n % p == 0:
                count += 1
                n //= p
            ret.append((p, count))

    if n > 1: ret.append((n, 1))
    return ret

def euler_phi(n):
    facts = factor(n)
    return reduce(lambda acc, (p, a):  acc * (p ** a - p ** (a - 1)), facts, 1)


if __name__ == '__main__':
    n = int(raw_input())
    print euler_phi(n)
Buggy python submission (verdict: Runtime Error):
import sys

def sieve(n):
    is_prime = [True] * (n + 1)
    prime_list = []
    
    is_prime[0] = is_prime[1] = False
    prime_list.append(2)
    
    for i in range(3, n + 1, 2):
        if is_prime[i]: prime_list.append(i)
        for j in range(i * i, n + 1, i):
            is_prime[j] = False
    return prime_list
    
primes = sieve(40000)

def factoriaztion(n):
    ret = []
    for prime in primes:
        while n % prime == 0:
            ret.append(prime)
            n /= prime
        if n == 1: break
    if n > 1: ret.append((n, 1))
    return ret
    
    
if __name__ == '__main__':
    n = sys.stdin.readline()
    n = int(n)
    factors = factoriaztion(n)
    factors = itertools.groupby(factors)
    
    ans = 1
    
    for k, v in factors:
        l = len(list(v))
        ans = ans * (k ** l - k ** (l - 1))
    
    sys.stdout.write(str(ans) + '\n')
    

Fixed submission:
import sys
import itertools

def extend_gcd(a, b):
    if b == 0:
        return (1, 0, a)
    else:
        (a1, b1, g) = extend_gcd(b, a % b)
        return (b1, a1 - (a // b) * b1, g)
    
    
if __name__ == '__main__':
    line = sys.stdin.readline()
    a,b = line.split()
    a,b = int(a), int(b)
    
    (x, y, g) = extend_gcd(a, b)
    
    
    sys.stdout.write(str(x) + ' '  + str(y) +  '\n')

Buggy python submission (verdict: Runtime Error):
import sys
import itertools

def sieve(n):
    is_prime = [True] * (n + 1)
    prime_list = []
    
    is_prime[0] = is_prime[1] = False
    prime_list.append(2)
    
    for i in range(3, n + 1, 2):
        if is_prime[i]: prime_list.append(i)
        for j in range(i * i, n + 1, i):
            is_prime[j] = False
    return prime_list
    
primes = sieve(40000)

def factoriaztion(n):
    ret = []
    for prime in primes:
        while n % prime == 0:
            ret.append(prime)
            n /= prime
        if n == 1: break
    if n > 1: ret.append((n, 1))
    return ret
    
    
if __name__ == '__main__':
    n = sys.stdin.readline()
    n = int(n)
    factors = factoriaztion(n)
    factors = itertools.groupby(factors)
    
    ans = 1
    
    for k, v in factors:
        l = len(list(v))
        ans = ans * (k ** l - k ** (l - 1))
    
    sys.stdout.write(str(ans) + '\n')
    
        

Fixed submission:
import sys
import itertools

def extend_gcd(a, b):
    if b == 0:
        return (1, 0, a)
    else:
        (a1, b1, g) = extend_gcd(b, a % b)
        return (b1, a1 - (a // b) * b1, g)
    
    
if __name__ == '__main__':
    line = sys.stdin.readline()
    a,b = line.split()
    a,b = int(a), int(b)
    
    (x, y, g) = extend_gcd(a, b)
    
    
    sys.stdout.write(str(x) + ' '  + str(y) +  '\n')
Buggy python submission (verdict: Runtime Error):
s = raw_input()
k = x = 0
while 1:
        x += 1
        if "J"*x+"O"*x+"I"*x in s:
                k = x
        elif "J"*x in s:
                pass
        elif "O"*x in s:
                pass
        elif "I"*x in s:
                pass
        else:
                print(k)
                break

Fixed submission:
s = raw_input()
k = x = 0
try:
        while 1:
                cj = co = ci = 0
                while s[x] == "J":
                        cj += 1
                        x += 1
                while s[x] == "O":
                        co += 1
                        x += 1
                while s[x] == "I":
                        ci += 1
                        x += 1
                if co <= cj and co <= ci:
                        k = max(co,k)
except IndexError:
        if co <= cj and co <= ci:
                k = max(co,k)
        print(k)

Buggy python submission (verdict: Runtime Error):
s = raw_input()
k = x = 0
while 1:
        x += 1
        if "J"*x+"O"*x+"I"*x in s:
                k = x
        elif not "J"*x in s:
                print(k)
                break
        elif not "O"*x in s:
                print(k)
                break
        elif not "I"*x in s:
                print(k)
                break

Fixed submission:
s = raw_input()
k = x = 0
try:
        while 1:
                cj = co = ci = 0
                while s[x] == "J":
                        cj += 1
                        x += 1
                while s[x] == "O":
                        co += 1
                        x += 1
                while s[x] == "I":
                        ci += 1
                        x += 1
                if co <= cj and co <= ci:
                        k = max(co,k)
except IndexError:
        if co <= cj and co <= ci:
                k = max(co,k)
        print(k)

Buggy python submission (verdict: Runtime Error):
s = raw_input()
k = x = 0
while x < len(s)*0.4:
        x += 1
        if "J"*x+"O"*x+"I"*x in s:
                k = x
        elif not "J"*x in s:
                print(k)
                break
        elif not "O"*x in s:
                print(k)
                break
        elif not "I"*x in s:
                print(k)
                break

Fixed submission:
s = raw_input()
k = x = 0
try:
        while 1:
                cj = co = ci = 0
                while s[x] == "J":
                        cj += 1
                        x += 1
                while s[x] == "O":
                        co += 1
                        x += 1
                while s[x] == "I":
                        ci += 1
                        x += 1
                if co <= cj and co <= ci:
                        k = max(co,k)
except IndexError:
        if co <= cj and co <= ci:
                k = max(co,k)
        print(k)
Buggy python submission (verdict: Time Limit Exceeded):
def f3(n):
    a=b=c=0
    for _ in range(n):
        a,b,c=a+b+c+1,a,b
    return a
    
def f5(n):
    a=b=c=d=e=0
    for _ in range(n):
        a,b,c,d,e=a+b+c+d+e+1,a,b,c,d
    return a

while 1:
    s=input()
    if s=="#":break
    ans=1
    num="_"
    cnt=1
    for n in s+"_":
        if n==num:
            cnt+=1
        else:
            if num in "80":
                ans*=f3(cnt)
            else:
                ans*=f5(cnt)
            num=n
            cnt=1
    print(ans%100000007)
                
            
        
        


Fixed submission:
def f3(n):
    a=b=c=0
    for _ in range(n):
        a,b,c=(a+b+c+1)%100000007,a,b
    return a
    
def f5(n):
    a=b=c=d=e=0
    for _ in range(n):
        a,b,c,d,e=(a+b+c+d+e+1)%100000007,a,b,c,d
    return a

while 1:
    s=input()
    if s=="#":break
    ans=1
    num="_"
    cnt=1
    for n in s+"_":
        if n==num:
            cnt+=1
        else:
            if num in "80":
                ans=ans*f3(cnt)%100000007
            else:
                ans=ans*f5(cnt)%100000007
            num=n
            cnt=1
    print(ans)