Harryxun/stf_run huggingface dataset:
N = int(input())
a = list(map(int,input().split()))
err = 8
ma1 = [1]
def gcd(x, y):
    if y == 0:
        return x
    else:
        return gcd(y, x % y) 
for i in range(1,N):
    f = gcd(a[0],a[i])
    for j in range(1,N):
        if a[j]%f != 0:
            err = err + 1
        if err == 10:
            break
    if err < 10:
        ma1.append(f)
arr = 8
ma2 = [1]

tmp = a[N-1]
a[N-1]=a[0]
a[0]=tmp


for i in range(1,N):
    f = gcd(a[0],a[i])
    for j in range(1,N):
        if a[j]%f != 0:
            arr = arr + 1
        if arr == 10:
            break
    if arr < 10:
        ma2.append(f)



if max(ma2) > max(ma1):
    print(max(ma2))
else:
    print(max(ma1))

### FIXED CODE ###

a = list(map(int, input().split()))
num = int(a[2]/a[0])
print(a[1]*num)
X,Y = map(int, input().split())
print(int(X+(Y/2))

### FIXED CODE ###

X,Y = map(int, input().split())
print(int(X+(Y/2)))
n, y = map(int, input().split())
ans = [-1, -1, -1]
for i in range(n+1):
  for j in range(n+1-x):
    k = n-i-j
    if i*10000+j*5000+k*1000 == y and k>=0:
      ans[0] = i
      ans[1] = j
      ans[2] = k
      break
print(ans)

### FIXED CODE ###

n, y = map(int, input().split())
ans = [-1, -1, -1]
for i in range(n+1):
  for j in range(n+1-i):
    k = n-i-j
    if i*10000+j*5000+k*1000 == y and k>=0:
      ans[0] = i
      ans[1] = j
      ans[2] = k
      break
print(ans[0], ans[1], ans[2])
a,v = map(int,input().split())
b,w = map(int,input().split())
t = int(input())
if a<b and v<=w:print("NO")
else:
	z = (b-a)/(v-w)
	if z==int(z) and z<=t:print("YES")
	else:print("NO")

### FIXED CODE ###

a,v = map(int,input().split())
b,w = map(int,input().split())
t = int(input())
# if (v-w)*t>=(b-a):print("YES")
# else:print("NO")
q = abs(a-b)
e = (v-w)*t
if q<=e:
	print("YES")
else:
	print("NO")
li1 = []
ans = 0
count = 0
for i in range(5):
    a = int(input())
    li1.append(a)
for i in range(5):
    if li1[i] % 10 == 0:
        ans += li1[i]
        count += 1
        li1[i] = 0
for i in range(count):
    li1.remove(0)
li2 = [s % 10 for s in li1]
ans += min(li2)-10
for i in range(len(li1)):
    ans += (li1[i] // 10 + 1) * 10
print(ans)

### FIXED CODE ###

li,lia = [],[]
total = 0
for i in range(5):
    a = input()
    li.append(a)
for i in range(5):
    lia.append(li[i][-1])
lib = [int(s) for s in lia]
b = lib.count(0)
for i in range(b):
    lib.remove(0)
for i in range(5):
    total += (int(li[i])//10+1)*10
if len(lib) >= 1:
    total -= 10*(1+b)
else:
    total -= 10*(b)
if len(lib) >= 1:
    total += min(lib)
if total <= 0:
    print(0)
else:
    print(total)
a,b=map(int,input().split())

n=4
if a<=b:
    grid=[["."]*n for _ in range(n+1)]
    s=b-a+1
    for i in range(s):
        grid[0][i*2]="#"
    k=1
    t=1
    for i in range(1,a):
        if t==251:
            t=1
            k+=1
        grid[4*k-2][4*(t-1)]=grid[4*k-2][4*(t-1)+1]=grid[4*k-2][4*(t-1)+2]="#"
        grid[4*k-1][4*(t-1)]=grid[4*k-1][4*(t-1)+2]="#"
        grid[4*k][4*(t-1)]=grid[4*k][4*(t-1)+1]=grid[4*k][4*(t-1)+2]="#"
        t+=1
else:
    grid=[["#"]*n for _ in range(n+1)]
    s=a-b+1
    for i in range(s):
        grid[0][2*i]="."
    k=1
    t=1
    for i in range(1,b):
        if t==n//4+1:
            t=1
            k+=1
        grid[4*k-2][4*(t-1)]=grid[4*k-2][4*(t-1)+1]=grid[4*k-2][4*(t-1)+2]="."
        grid[4*k-1][4*(t-1)]=grid[4*k-1][4*(t-1)+2]="."
        grid[4*k][4*(t-1)]=grid[4*k][4*(t-1)+1]=grid[4*k][4*(t-1)+2]="."
        t+=1
print(n,n+1)
for i in grid:
    print("".join(i))

### FIXED CODE ###

a,b=map(int,input().split())
n=100

grid=[["#"]*n for _ in range(n//2)]+[["."]*n for _ in range(n//2)]

k=0
cnt=0
for i in range(a-1):
    grid[k][2*i-cnt]="."
    if (2*i)%100==n-2:
        k+=2
        cnt+=n

k=n//2+1
cnt=0
for i in range(b-1):
    grid[k][2*i-cnt]="#"
    if (2*i)%100==n-2:
        k+=2
        cnt+=n
print(100,100)
for i in grid:
    print("".join(i))
K, N = input().split()
A = list(map(int, input().split()))
if 0 in A:
    A.remove(0)
x = max(A) - min(A)
print(x)


### FIXED CODE ###

S = str(input())
if len(S) == 6:
    if S[2] == S[3] and S[4] == S[5]:
        print("Yes")
    else:
        print("No")
a_b = []
for _ in range(M):
    a, b = map(int, input().split())
    a_b.append((a, b))
a_b.sort(key=lambda x: x[0])

r = a_b[0][1]
ans = 1
for a, b in a_b[1:]:
    if a >= r:
        r = b
        ans += 1
        continue
    if b < r:
        r = b
print(ans)

### FIXED CODE ###

N, M = map(int, input().split())
a_b = []
for _ in range(M):
    a, b = map(int, input().split())
    a_b.append((a, b))
a_b.sort(key=lambda x: x[0])

r = a_b[0][1]
ans = 1
for a, b in a_b[1:]:
    if a >= r:
        r = b
        ans += 1
        continue
    if b < r:
        r = b
print(ans)
n = int(input())
a = [int(i) for i in input().split()]
A = [0 for i in range(n)]
for aa in a:
    A[a]+=1
for aa in A:
    print(aa)

### FIXED CODE ###

n = int(input())
a = [int(i) for i in input().split()]
A = [0 for i in range(n)]
for aa in a:
    A[int(aa)-1]+=1
for aaa in A:
    print(aaa)
n = int(input())
s = list(map(lambda x: 1 if x == "I" else -1, list(input()))
x = 0
m = 0
for i in s:
    x += i
    m = max(m,x)
print(m)


### FIXED CODE ###

n = int(input())
s = list(map(lambda x: 1 if x == "I" else -1, list(input())))
x = 0
m = 0
for i in s:
    x += i
    m = max(m,x)
print(m)
N,M = map(int,raw_input().split())
es = [[] for i in range(N)]
for i in range(M):
  a,b = map(int,raw_input().split())
  a,b = a-1,b-1
  es[a].append(b)
  es[b].append(a)

colors = [0 for i in range(N)]

def dfs(v,color):
  colors[v] = color
  for to in es[v]:
    if colors[to] == color:
      return False
    if colors[to] == 0 and not dfs(to, -color):
      return False
  return True

def is_bipartite():
  return dfs(0,1)

if is_bipartite():
  b = (sum(colors) + N) // 2
  w = N-b
  print(b*w - M)
else:
  all = N*(N-1) // 2
  print(all - M)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**7)

N,M = map(int,raw_input().split())
es = [[] for i in range(N)]
for i in range(M):
  a,b = map(int,raw_input().split())
  a,b = a-1,b-1
  es[a].append(b)
  es[b].append(a)

colors = [0 for i in range(N)]

def dfs(v,color):
  colors[v] = color
  for to in es[v]:
    if colors[to] == color:
      return False
    if colors[to] == 0 and not dfs(to, -color):
      return False
  return True

def is_bipartite():
  return dfs(0,1)

if is_bipartite():
  b = (sum(colors) + N) // 2
  w = N-b
  print(b*w - M)
else:
  all = N*(N-1) // 2
  print(all - M)
import math
from fractions import gcd

def era(n):
    if n == 1:
        return []
    prime_list = []
    # 2からnumberまでの数字をsearch_listに入れる
    search_list = list(range(2,n+1))
    while True:
      # search_listの先頭の値が√nの値を超えたら処理終了
        if search_list[0] > math.sqrt(n):
            # prime_listにsearch_listを結合
            prime_list.extend(search_list)
            break
        else:
            # search_listの先頭をprime_listに入れる
            head_num = search_list[0]
            prime_list.append(head_num)
            # search_listの先頭をpopする
            search_list.pop(0)
            # head_numの倍数を取り除く
            search_list = [num for num in search_list if num % head_num != 0]

    return prime_list

def main():
    a,b = map(int, input().split())

    g = gcd(a, b)
    p_nums = era(g)

    ans = 1
    if len(p_nums) >= 1:
        for p in p_nums:
            if g % p == 0:
                ans += 1

    print(ans)


if __name__ == "__main__":
    main()


### FIXED CODE ###

import math
from fractions import gcd

def era(ps, n):
    if len(ps) == 1:
        return 1
    search_list = ps[1:]
    for i in range(1, n+1):
        search_list = [num for num in search_list if num % i != 0 or num == i ]

    return len(search_list)+1

def is_prime(n):
    if n == 1: return False

    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False

    return True

def make_divisors(n):
    divisors = []
    for i in range(1, int(math.sqrt(n))+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors

def main():
    a,b = map(int, input().split())

    g = gcd(a, b)
    div = make_divisors(g)
    #print(div)

    ans = 1
    for n in div:
        if is_prime(n):
            ans += 1

    print(ans)



if __name__ == "__main__":
    main()
from sys import stdin
from collections import namedtuple
from heapq import heappush, heappop

input = stdin.readline


class UnionFind:
  def __init__(self, n):
    self.par = [i for i in range(n + 1)]
    self.size = [1] * (n + 1)

  def is_same(self, a, b):
    return self.find(a) == self.find(b)

  def unite(self, a, b):
    a = self.find(a)
    b = self.find(b)  
    if self.size[a] < self.size[b]:
      a, b = b, a
    self.par[b] = a
    self.size[a] += self.size[b]

  def size_of(self, a):
    return self.size[self.find(a)]

  def find(self, a):
    if a == self.par[a]:
      return a
    self.par[a] = self.find(self.par[a])
    return self.par[a]

Edge = namedtuple('Edge', 'w s t')
X = namedtuple('X', 'x i')
Y = namedtuple('Y', 'y i')

N = int(input())

edges = []
xg = []
yg = []

for i in range(N):
  x, y = map(int, input().split())
  xg.append(X(x, i))
  yg.append(Y(y, i))

xg.sort()
yg.sort()

for i in range(N - 1):
  x1, a = xg[i]
  x2, b = xg[i + 1]
  heappush(edges, Edge(abs(x1 - x2), a, b))

for i in range(N - 1):
  y1, a = yg[i]
  y2, b = yg[i + 1]
  heappush(edges, Edge(abs(y1 - y2), a, b))

u = UnionFind(N)
cost = 0

while edges:
  if u.size_of(0) >= N:
    break

  w, s, t = heappop(edges)
  if u.is_same(s, t):
    continue
  u.unite(s, t)
  cost += w

print(cost)


### FIXED CODE ###

X, A, B = map(int, input().split())

if B - A <= 0:
  print('delicious')
elif B - A <= X:
  print('safe')
else:
  print('dangerous')
w = input()
for i in set(w):
    if w.count(i)%2 == 1:
        print("No")
        exit(1)

print("Yes")


### FIXED CODE ###

w = input()
only = list(set(w))
count = 0
can = True
for i in only:
    if w.count(i) % 2 != 0:
        can = False
        break
if can:
    print('Yes')
else:
    print('No')
import math

N, A, B = map(int, input().split())

string = 'r'* A + 'b'*B
res = ''
for _ in range(math.ceil(N/(A+B))):
    res += string

print(res[:N].count('r'))



### FIXED CODE ###

import math

N, A, B = map(int, input().split())
tmp = 10**100
a = A * (N //(A+B))
b = (N %(A+B))
if b > A:
    print(a + A)
else: 
    print(a + b)
code = input()
if code = 'A':
	print('T')
elif code = 'T':
	print('A')
elif code = 'G':
	print('C')
elif code = 'C':
	print('G')


### FIXED CODE ###

code = input()
if code == 'A':
	print('T')
elif code == 'T':
    print('A')
elif code == 'G':
    print('C')
elif code == 'C':
    print('G')
import math

N=int(input())

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

A = 0
for i in N:
  for j in N:
    for k in N:
      l = gcd_list(i,j,k)
  A += l
print(A)

### FIXED CODE ###

import math
 
N=int(input())
 
A = 0
for i in range(1,N+1):
  for j in range(1,N+1):
    for k in range(1,N+1):
      A += math.gcd(math.gcd(i,j),k)

print(A)
[N K] = list(map(int,input().split))
max = (N-1)*(N-2)/2
if max<K:
    print(-1)
    exit()

tree = []
for i in range(2, N):
    tree.append(1,N)

for i in range(max-K):
    tree.append(i+2,i+3)

print(max + max-K)
for i in tree:
    print(str(i[0]) + " " +str([1]))

### FIXED CODE ###

[N ,K] = list(map(int,input().split()))
max = int((N-1)*(N-2)/2)
if max<K:
    print(-1)
    exit()

tree = []
for i in range(2, N+1):
    tree.append((1,i))
t = 3
a=0
for i in range(0, max-K):
    if i+t-a>N:
        a += i-a
        t+=1 
    tree.append((i+2-a,i+t-a))

print(len(tree))
for i in tree:
    print(str(i[0]) + " " +str(i[1]))
a, b = map(int, input())
import math
print(math.ceil((a + b) / 2))

### FIXED CODE ###

a, b = map(int, input().split())
import math
print(math.ceil((a + b) / 2))
n, k = map(int, input().split())
a = list(map(int, input().split()))
stand_bit = [set() for i in range(42)]
acc = [0 for i in range(n+1)]
acc[0] = 0
for i in range(1, n+1):
    acc[i] += a[i-1] + acc[i-1]
set_ans = set()
for i in range(n):
    for j in range(i, n):
        set_ans.add(acc[j+1] - acc[i])
        s = acc[j+1] - acc[i]
        index = 41
        while s :
            if s & 1:
                stand_bit[index].add(acc[j+1] - acc[i])
            s = s >> 1
            index -= 1
/*
for i in range(42):
    if len(set_ans & stand_bit[i]) >= k:
        set_ans &= stand_bit[i]
ans_list = list(set_ans)
ans = ans_list[0]
for i in ans_list:
    ans &= i
print(ans)
*/


### FIXED CODE ###

n, k = map(int, input().split())
a = list(map(int, input().split()))
stand_bit = [set() for i in range(42)]
acc = [0 for i in range(n+1)]
for i in range(1, n+1):
    acc[i] += a[i-1] + acc[i-1]
set_ans = set()
for i in range(n):
    for j in range(i, n):
        tmp = acc[j+1] - acc[i]
        set_ans.add(tmp)
        s = tmp
        index = 41
        while s:
            if s & 1:
                stand_bit[index].add(tmp)
            s = s >> 1
            index -= 1
for i in range(42):
    if len(set_ans & stand_bit[i]) >= k:
        set_ans &= stand_bit[i]
ans_list = list(set_ans)
ans = ans_list[0]
for i in ans_list:
    ans &= i
print(ans)
n,k=map(int(input().split()))
if n%k==0:
    print(0)
else:
    print(1)

### FIXED CODE ###

n,k=map(int,input().split())
if n%k==0:
    print(0)
else:
    print(1)
N,Q=map(int,input().split())
a=[0]*(N-1)
b=[0]*(N-1)
p=[0]*Q
x=[0]*Q
c=[[] for _ in range(N)]  #接続リスト
cnt=[ 0 for _ in range(N)]  #カウンター値

for i in range(N-1):
  a[i],b[i]=map(int,input().split())
  c[a[i]-1].append(b[i]-1)
  c[b[i]-1].append(a[i]-1)
for i in range(Q):
  p[i],x[i]=map(int,input().split())
  cnt[p[i]-1] += x[i]

def dfs(x,parent):
  if parent!=-1:
    cnt[x] += cnt[parent]
  for child in c[x]:
    if child!=parent:
      dfs(child,x)

dfs(0,-1)
print(*cnt)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline

N,Q=map(int,input().split())
a=[0]*(N-1)
b=[0]*(N-1)
p=[0]*Q
x=[0]*Q
c=[[] for _ in range(N)]  #接続リスト
cnt=[0]*N  #カウンター値

for i in range(N-1):
  a[i],b[i]=map(int,input().split())
  c[a[i]-1].append(b[i]-1)
  c[b[i]-1].append(a[i]-1)
for i in range(Q):
  p[i],x[i]=map(int,input().split())
  cnt[p[i]-1] += x[i]

def dfs(x,parent):
  if parent!=-1:
    cnt[x] += cnt[parent]
  for child in c[x]:
    if child!=parent:
      dfs(child,x)

dfs(0,-1)
print(*cnt)
def gcd(a,b):
    if a<b:
     c=a
     a=b
     b=c
     
    c=a%b
    return b
 
def lcm(a,b):
    c=gcd(a,b)
    return a/c*b
 
 
 
n=int(input())
t=[0]*n
 
for lop2 in range(n):
    t[lop2]=int(input())
 
ans=t[0]
 
for lop in range(1,n):
    ans=lcm(ans,t[lop])
print(int(ans))


### FIXED CODE ###

N = input()
n=int(N)
n2=(n%10)*100
n2+=(n%100)-n%10
n2+=(n-n%100)/100
if n==n2 :
	print('Yes\n')
else:
	print('No\n')
quit()
from math import gcd

if __name__ == '__main__' :
    N,X = map(int, input().split())
    x = list(map(int, input().split()))

    dist_list = [abs(d-X) for d in x]

    alpha = gcd(dist_list[0],dist_list[1])
    for d in dist_list:
        alpha = gcd(alpha,d)

    print(alpha)

### FIXED CODE ###

def gcd(x, y):
    r = modlog(x, y)
    while r != 0:
        x = y
        y = r
        r = modlog(x, y)
    return y

def modlog(x, y):
    r = x % y
    return r

if __name__ == '__main__' :
    N,X = map(int, input().split())
    x = list(map(int, input().split()))

    dist_list = [abs(d-X) for d in x]

    if len(dist_list) == 1:
        print (dist_list[0])
        exit()
        
    alpha = gcd(dist_list[0],dist_list[1])
    for d in dist_list:
        alpha = gcd(alpha,d)

    print(alpha)
n,a,b,c,d = map(int,input().split())
s = input()
if '##' in s:
    flg = False
if c < d:
    #最後まで動かす
    flg = True
else:#c>d
    if '...' in s[a:]:
        flg = True
if flg:
    print('Yes')
else:
    print('No')



### FIXED CODE ###

n,a,b,c,d = map(int,input().split())
s = input()
flg = False
if c < d:
    #最後まで動かす
    flg = True
else:#c>d
    if '...' in s[b-2:d+1]:
        flg = True
if '##' in s[a-1:max(d,c)-1]:
    flg = False
if flg:
    print('Yes')
else:
    print('No')
A, B = map(int, input().split())
print(max(0, A - 2 * B)

### FIXED CODE ###

A, B = map(int, input().split())
print(max(0, A - 2 * B))
while True :
    (H, W) = [int(i) for i in input().split()]

    if H == W == 0:
        break

??????print(('#' * W) + '\n')

    for i in range(H - 2) :
        print('#' + ('.' * (W - 2)) + '#\n')

    print(('#' * W) + '\n')

### FIXED CODE ###

while True:
    (H, W) = [int(i) for i in input().split()]
    
    if H == W == 0 :
        break

    print('#' * W)
    for a in range(H - 2) :
        print('#' + '.' * (W - 2) + '#')
    print('#' * W)
    print()
# include <bits/stdc++.h>
using namespace std;

int main(){
	int a,b;
	cin >> a >> b;
	cout << a*b << endl;
}

### FIXED CODE ###

a,b = map(int,input().split())
print(a*b)
s = input()
K = int(input())
n = len(s)
A =[]
for i in range(n):
    for j in range(i+1,n):
        sub = s[i:j]  
        if sub in A:
            continue
        else:
            if len(A) <= K:
                A.append(sub)
            else:
                A.append(sub)
                A.sort()
                A.pop(K)
print(A[K-1])
                

### FIXED CODE ###

s = input()
K = int(input())
n = len(s)
A =[]
import bisect
for i in range(n):
    for j in range(1,K+1):
        sub = s[i:i+j]  
        if sub not in A:
            x = bisect.bisect_left(A,sub)
            A.insert(x,sub)
            if len(A) > K:
                A.pop(K)

print(A[K-1])
# -*- coding: utf-8 -*-
import sys
import copy
import collections
from bisect import bisect_left
from bisect import bisect_right
from collections import defaultdict
from heapq import heappop, heappush
import numpy as np
import statistics
from statistics import mean, median,variance,stdev
import math

def main():
	N = list(input())
	
	to = 0
	for i in N:
		to += int(i)
	
	if N % to == 0:
		print("Yes")
	else:
		print("No")
	
	
if __name__ == "__main__":
	main()


### FIXED CODE ###

# -*- coding: utf-8 -*-
import sys
import copy
import collections
from bisect import bisect_left
from bisect import bisect_right
from collections import defaultdict
from heapq import heappop, heappush
import numpy as np
import statistics
from statistics import mean, median,variance,stdev
import math

def main():
	N = list(input())
	
	
	to = 0
	NN = ""
	for i in N:
		to += int(i)
		NN += i
	
	if int(NN) % to == 0:
		print("Yes")
	else:
		print("No")
	
	
if __name__ == "__main__":
	main()
N = int(input())
Af = list(map(int,input().split()))
A = list()
for i in range(N):
  if Af[i] % 2 == 0:
      A.append(Af[i])
      continue
  else:
      continue
for i in range(len(A)):
  if A[i] % 3 != 0 and A[i] % 5 != 0:
      print('DENIED')
      import sys
      sys.exit()
  if A[i] % 3 == 0 or A[i] % 5 == 0:
      continue 
print('APPROVED')

### FIXED CODE ###

A = input()
if A[0] != A[2] == A[4] or A[2] != A[4] == A[0] or A[4] != A[0] == A[2]:
    print('Yes')
else:
    print('No')
MOD = 10**9 + 7
N, K = map(int,input().split())

edge = [[] for _ in range(N)]

for _ in range(N-1) :
    fromNode, toNode = map(int,input().split())

    fromNode -= 1
    toNode -= 1

    edge[fromNode].append(toNode)
    edge[toNode].append(fromNode)

# 深さ優先探索
def bfs(nowNode, fromNode) :
    colorNum = K  # 使用可能な色の数
    if fromNode == -1 :  # 根の場合
        colorNum -= 1
    else :
        colorNum -= 2

    if len(edge[nowNode]) > K :  # つながっている頂点数 - 1(親) == K までOK
        return 0

    caseNum = 1
    for nextNode in edge[nowNode] :
        if nextNode == fromNode :
            continue
        caseNum *= colorNum
        colorNum -= 1
        caseNum = caseNum % MOD

    for nextNode in edge[nowNode] :
        if nextNode == fromNode :
            continue
        caseNum *= bfs(nextNode, nowNode)
        caseNum = caseNum % MOD

    return caseNum

ans = bfs(0, - 1) * K
ans = ans % MOD
print(ans)



### FIXED CODE ###

import sys
sys.setrecursionlimit(10 ** 7)

MOD = 10**9 + 7
N, K = map(int,input().split())

edge = [[] for _ in range(N)]

for _ in range(N-1) :
    fromNode, toNode = map(int,input().split())

    fromNode -= 1
    toNode -= 1

    edge[fromNode].append(toNode)
    edge[toNode].append(fromNode)

# 深さ優先探索
def bfs(nowNode, fromNode) :
    colorNum = K  # 使用可能な色の数
    if fromNode == -1 :  # 根の場合
        colorNum -= 1
    else :
        colorNum -= 2

    if len(edge[nowNode]) - 1 > K :  # つながっている頂点数 - 1(親) == K までOK
        return 0

    caseNum = 1
    for nextNode in edge[nowNode] :
        if nextNode == fromNode :
            continue
        caseNum *= colorNum
        colorNum -= 1
        caseNum = caseNum % MOD

    for nextNode in edge[nowNode] :
        if nextNode == fromNode :
            continue
        caseNum *= bfs(nextNode, nowNode)
        caseNum = caseNum % MOD

    return caseNum

ans = bfs(0, - 1) * K
ans = ans % MOD
print(ans)
n = int(input())
k = int(input())
m = len(list(str(n)))
n0 = list(str(n))
for i in range(m):
    n0[i] = int(n0[i])
ans = 0
comb = 1
if k < m:
    for j in range(k):
        comb *= (m-1-j)
        comb //= (j+1)
    ans += comb*(9**k)
#print(ans,k,m)
if k == 1:
    ans += n0[0]
elif k == 2:
    if m >= 2:
        ans += (n0[0]-1)*9*(m-1)
        c = 1
        while n0[c] == 0 and c < m-1:
            c += 1
        if n0[c] > 0:
            ans += n0[c]
            ans += 9*(m-c-1)
    else:
        ans = 0
else:
    if m >= 3:
        ans += (n0[0]-1)*9*9*(m-1)*(m-2)//2
        c = 1
        while n0[c] == 0 and c <= m-2:
            c += 1
        if c < m-1:
            ans += (n0[c]-1)*9*(m-c-1)
            ans += 9*9*(m-c-1)*(m-c-2)//2
            c1 = c+1
            while n0[c1] == 0 and c < m-1:
                c1 += 1
            if n0[c1] > 0:
                ans += n0[c1]
                ans += 9*(m-c1-1)
    else:
        ans = 0
print(ans)

### FIXED CODE ###

n = int(input())
k = int(input())
m = len(list(str(n)))
n0 = list(str(n))
for i in range(m):
    n0[i] = int(n0[i])
ans = 0
comb = 1
if k < m:
    for j in range(k):
        comb *= (m-1-j)
        comb //= (j+1)
    ans += comb*(9**k)
#print(ans,k,m)
if k == 1:
    ans += n0[0]
elif k == 2:
    if m >= 2:
        ans += (n0[0]-1)*9*(m-1)
        c = 1
        while n0[c] == 0 and c < m-1:
            c += 1
        if n0[c] > 0:
            ans += n0[c]
            ans += 9*(m-c-1)
    else:
        ans = 0
else:
    if m >= 3:
        ans += (n0[0]-1)*9*9*(m-1)*(m-2)//2
        c = 1
        while n0[c] == 0 and c <= m-2:
            c += 1
        if c < m-1:
            ans += (n0[c]-1)*9*(m-c-1)
            ans += 9*9*(m-c-1)*(m-c-2)//2
            c1 = c+1
            while n0[c1] == 0 and c1 < m-1:
                c1 += 1
            if n0[c1] > 0:
                ans += n0[c1]
                ans += 9*(m-c1-1)
    else:
        ans = 0
print(ans)
S = raw_input()
lis = list(S)
for i in lis:
	mat = []
	if i in S
		print "no"
		break
	mat.add(i)
else:
	print "yes"

### FIXED CODE ###

a,b = map(int,raw_input().split())
if (a + b) < 10:
	print a+b
else:
	print "error"
while True:
 h,w=map(int,input().split())
 if h==0:break
 for i in range(h):
  x,y=['#','.'] if i%0==0 else ['.','#']
  print("".join(zip([x]*(w+1)//2,[y]*w//2)))
 print()

### FIXED CODE ###

while 1:
 h,w=map(int,input().split())
 if h==0:break
 for i in range(h):print(('#.'*w)[i%2:][:w])
 print()