Harryxun/stf_run huggingface dataset:
# https://atcoder.jp/contests/abc067/tasks/abc067_a

import itertools
from collections import Counter
from collections import defaultdict
import bisect

def main():
    A, B = map(int, input().split())
    if A % 3 == 0 or B % 0 == 0 or (A + B) % 3 == 0:
        print('Possible')
    else:
        print('Impossible')


if __name__ == '__main__':
    main()


### FIXED CODE ###

# https://atcoder.jp/contests/abc067/tasks/abc067_a

import itertools
from collections import Counter
from collections import defaultdict
import bisect

def main():
    A, B = map(int, input().split())
    if A % 3 == 0 or B % 3 == 0 or (A + B) % 3 == 0:
        print('Possible')
    else:
        print('Impossible')


if __name__ == '__main__':
    main()
a=[]
while 1:
    try:
         h = float(row_input())
         a.append(h)
a.sort()
print a[len(a)-1] - a[0]

### FIXED CODE ###

a=[]
while True:
    try:
        a.append(float(raw_input()))
    except:
        break

a.sort()
print a[len(a)-1] - a[0]
from collections import defaultdict

N = int(input())
S = input()
first = S[:N]
last = S[::-1][:N]

d = defaultdict(int)
ans = 0

def paint(str, ptn):
  return (red, blue)

for i in range(2**N):
  red = ''.join(s for j, s in enumerate(first) if 2**j & ptn)
  blue = ''.join(s for j, s in enumerate(first) if not 2**j & ptn)
  d[paint(red, blue)] += 1
  
for i in range(2**N):
  red = ''.join(s for j, s in enumerate(last) if 2**j & ptn)
  blue = ''.join(s for j, s in enumerate(last) if not 2**j & ptn)
  ans += d[paint(red, blue)]
  
print(ans)


### FIXED CODE ###

from collections import defaultdict

N = int(input())
S = input()
first = S[:N]
last = S[::-1][:N]

d = defaultdict(int)
ans = 0

def paint(str, ptn):
  p = ['', '']
  for i in range(N):
    p[int(2**i & ptn > 0)] += str[i]
  return tuple(p)

for i in range(2**N):
  d[paint(first, i)] += 1
  
for i in range(2**N):
  ans += d[paint(last, i)]
  
print(ans)
import math
N=int(input())
ans=[]
for i in range(1,round(math.sqrt(N))):
  if N % i == 0:
    ans.append(abs(i-1) + abs(N/i-1))
print(int(min(ans)))


### FIXED CODE ###

import math
N=int(input())
ans=[N-1]
for i in range(2,math.floor(math.sqrt(N))+1):
  if N % i == 0:
    ans.append(abs(i-1) + abs(N/i-1))
print(int(min(ans)))
while(True) :
    instr=input()
    if(instr=='?') : break
    a,op,b=input().split()
    a=int(a)
    b=int(b)
    if op=='+' :
        print("{}".format(a+b))
    elif op=='-' :
        print("{}".format(a-b))
    elif op=='*' :
        print("{}".format(a*b))
    else :
        print("{}".format(int(a/b)))


### FIXED CODE ###

while(True) :
    a,op,b=input().split()
    a=int(a)
    b=int(b)
    if op=='+' :
        print("{}".format(a+b))
    elif op=='-' :
        print("{}".format(a-b))
    elif op=='*' :
        print("{}".format(a*b))
    elif op=='/' :
        print("{}".format(int(a/b)))
    else :
        break
A, B, C = (str(i).upper for i in input().split())

ans = A[0]+B[0]+C[0]
# ANS = ans.upper()
print(ans)

### FIXED CODE ###

A, B, C = (i for i in input().split())

a = A[0]
b = B[0]
c = C[0]
ans = a+b+c
ANS = ans.upper()
print(ANS)
a,b,t = map(int,input().split())
ans = math.floor(t/a) * b
print(ans)

### FIXED CODE ###

a,b,t = map(int,input().split())
ans = ((t - t%a)/a)*b
print(int(ans))
n = input().split('')[0]
k = input().split('')[1]

sticks = sorted(map(int,input().split('')),reverse=True)

total = 0

for i in range(k):
    total += sticks[i]

print(total)

### FIXED CODE ###

k = int(input().split()[1])
sticks = sorted(list(map(int,input().split())),reverse=True)

total = 0

for i in range(k):
    total += sticks[i]

print(total)
N, M = map(int, input().split())

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

div = sorted(make_divisors(M))
i = 0
while M//div[i]>=N:
    ans = div[i]
    i+=1
    
print(ans)

### FIXED CODE ###

N, M = map(int, input().split())

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

if N==1:
    print(M)

else:
    div = sorted(make_divisors(M))
    i = 0 
    while i<=len(div) and M//div[i]>=N:
        ans = div[i]
        i+=1
    print(ans)
N = int(input())
A = list(map(int, input().split()))
d = defaultdict(lambda: 0)
for i in range(len(A)):
    d[A[i]] += 1

ans1 = 0
ans2 = 0
r = 2
calc_dict1 = {}
calc_dict2 = {}
for k, v in zip(d.keys(), d.values()):
    if v > 1:
        ans1 = math.factorial(v) // (math.factorial(v - r) * math.factorial(r))
    else:
        ans1 = 0
    if v > 2:
        ans2 = math.factorial(v - 1) // (math.factorial(v - 1 - r) * math.factorial(r))
    else:
        ans2 = 0
    calc_dict1[k] = ans1
    calc_dict2[k] = ans1 - ans2
total = sum(calc_dict1.values())
for i in range(N):
    print(total - calc_dict2[A[i]])

### FIXED CODE ###

from collections import defaultdict
N = int(input())
A = list(map(int, input().split()))
d = defaultdict(lambda: 0)
for i in range(len(A)):
    d[A[i]] += 1
total = 0
for k,v in d.items():
    total += v*(v-1)//2
for a in A:
    print(total - (d[a]-1))
A, B = map(int, input().split())

if A == B:
    print("H")
else:
    print("D")

### FIXED CODE ###

A, B = input().split()

if A == B:
    print("H")
else:
    print("D")
lst = map(int, input().split())
print('Yes' if set(len(lst)) >= 2 else 'No')

### FIXED CODE ###

lst = list(map(int, input().split()))
print('Yes' if len(set(lst)) == 2 else 'No')
import math

def get_primes(n):
    is_prime = [True] * (n+1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5)+1):
        if not is_prime[i]: continue
        for j in range(i*2, n+1, i):
            is_prime[j] = False
    return [i for i in range(n+1) if is_prime[i]]

def factorization_num(n, pl):
    count = 0
    for p in pl:
        if n % p == 0: count += 1
    return count

A, B = map(int, input().split())
print(factorization_num(math.gcd(A, B), get_primes(math.gcd(A, B))) + 1)

### FIXED CODE ###

from fractions import gcd
def factorization(n):
    fac = {}
    count = 0
    while n % 2 == 0:
        n //= 2
        count += 1
    if count > 0:
        fac[2] = count
    for i in range(3, int(n ** .5) + 1, 2):
        count = 0
        while n % i == 0:
            n //= i
            count += 1
        if count > 0:
            fac[i] = count
    if n > 1:
        fac[n] = 1
    return fac

A, B = map(int, input().split())
fac = factorization(gcd(A, B))
print(len(fac) + 1)
cat ALDS1_1_d.py
n = int(raw_input())
R = [int(raw_input()) for i in xrange(n)]
mn = R[0]
ans = -1e10
for r in R[1:]:
    ans = max(ans, r - mn)
    mn = min(mn, r)
print ans

### FIXED CODE ###

n = int(raw_input())
R = [int(raw_input()) for i in xrange(n)]
mn = R[0]
ans = -1e10
for r in R[1:]:
    ans = max(ans, r - mn)
    mn = min(mn, r)
print ans
from import math
r = raw_input()
area = r * r * math.pi
cir = 2 * r * math.pi
print '%f %f' %(area, cir)

### FIXED CODE ###

import math
r = input()
area = r * r * math.pi * 1.0
cir = 2 * r * math.pi * 1.0
print '%f %f' % (area, cir)
Sn = pow(2,n,MOD) - 1
if a > b:
    a,b = b,a
Xa, Xb = 1,1
Ya, Yb = 1,1
for i in range(b):
    if i < a:
        Xa = ( Xa * (n-i) ) % MOD
        Ya = ( Ya * pow((a-i),MOD-2, MOD)) % MOD
    Xb = ( Xb * (n-i) ) % MOD
    Yb = ( Yb * pow((b-i),MOD-2, MOD)) % MOD

ans = Sn - Xa*Ya % MOD - Xb*Yb % MOD
while ans < 0:
    ans += MOD
    
print(ans)

### FIXED CODE ###

MOD = 10**9+7

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

Sn = pow(2,n,MOD) - 1
if a > b:
    a,b = b,a
Xa, Xb = 1,1
Ya, Yb = 1,1
for i in range(b):
    if i < a:
        Xa = ( Xa * (n-i) ) % MOD
        Ya = ( Ya * pow((a-i),MOD-2, MOD)) % MOD
    Xb = ( Xb * (n-i) ) % MOD
    Yb = ( Yb * pow((b-i),MOD-2, MOD)) % MOD

ans = Sn - Xa*Ya % MOD - Xb*Yb % MOD
while ans < 0:
    ans += MOD
    
print(ans)
list=map(int,input().split())
li=sortrd(list)
if li=[5,5,7]:
  print('YES')
else:
  print('NO')

### FIXED CODE ###

l=map(int,input().split())
if sorted(l)==[5,5,7]:
  print('YES')
else:
  print('NO')
N, M = map(int, input().split())
l = [None] * M
for i in range(M):
	p, y = map(int, input().split())
	l[i] = [p, y, i]
l.sort()
ans = []
t = l[0][0]
x = 0
for i in l:
	if t == i[0]:
		x += 1
		ans.append([l[2], i[0], x])
	else:
		t = i[0]
		x = 1
		ans.append([l[2], i[0], x])
ans.sort()
for i in ans:
	p = str(i[1])
	x = str(i[2])
	print('0' * (6 - len(p)) + p + '0' * (6 - len(x)) + x)

### FIXED CODE ###

N, M = map(int, input().split())
l = [None] * M
for i in range(M):
	p, y = map(int, input().split())
	l[i] = [p, y, i]
l.sort()
ans = []
t = l[0][0]
x = 0
for i in l:
	if t == i[0]:
		x += 1
		ans.append([i[2], i[0], x])
	else:
		t = i[0]
		x = 1
		ans.append([i[2], i[0], x])
ans.sort()
for i in ans:
	p = str(i[1])
	x = str(i[2])
	print('0' * (6 - len(p)) + p + '0' * (6 - len(x)) + x)
a,b,c=input()
print('yes' if a==c,else 'no')

### FIXED CODE ###

a,b,c=input()
print('Yes'  if a==c else  'No')
from functools import reduce
from fractions import gcd
N = int(input())
A = list(map(int,input().split()))
A.sort(reverse=True)
gcd_max = 0
if (N > 4):
    for i in range(4):
        gcd_now = reduce(gcd, list(x for x in A if x != A[i]))
        if (gcd_max < gcd_now): gcd_max = gcd_now
    for i in range(N):
        gcd_now = gcd(gcd_max, A[i])
        if (gcd_max < gcd_now): gcd_max = gcd_now
else:
    for i in range(N):
        gcd_now = reduce(gcd, list(x for x in A if x != A[i]))
        if (gcd_max < gcd_now): gcd_max = gcd_now
    
print(gcd_max)

### FIXED CODE ###

from fractions import gcd
# input
N = int(input())
A = list(map(int,input().split()))
L_A = [0] * (N+1)
R_A = [0] * (N+1)
for i in range(N):
    L_A[1+i] = gcd(L_A[i], A[i])
for i in reversed(range(N)):
    R_A[i] = gcd(R_A[i+1], A[i])
print(max(gcd(L_A[i], R_A[i+1]) for i in range(N)))
S = input()

if "RRR" in S:
    ans = 3

elif "RR" in S:
    ans = 2
    
elif "R" in S:
    ans = 1
    
print(ans)

### FIXED CODE ###

S = input()

if "RRR" in S:
    ans = 3

elif "RR" in S:
    ans = 2
    
elif "R" in S:
    ans = 1
else:
    ans = 0
    
print(ans)
a, b = (int(i) for i in input().split())  

### FIXED CODE ###

a,b = map(int, raw_input().split())
print (a+b)%24
N, M = [int(x) for x in input().split()]
g = 0

A = []
B = []

for i in range(M):
    a, b = [int(x) for x in input().split()]
    A.append(a)
    B.append(b)

A.reverse()
B.reverse()


# ----- Union Find -----------
PARENT = list(range( N + 1 ))
SIZE = [1] * (N + 1 )

def root(n):
    if PARENT[n] == n:
        return n
    else:
        ret = root(PARENT[n])
        PARENT[n] = ret
        return ret

def same(n1, n2):
    return root(n1) == root(n2)


def unite(n1, n2):
    n1 = root(n1)
    n2 = root(n2)
    if n1 == n2:
        return
    PARENT[n1] = n2
    global g
    g = g + SIZE[n2] * SIZE[n1]
    SIZE[n2] += SIZE[n1]
    SIZE[n1] = 0

Z = N * (N - 1) // 2

ans = []
for i in range(M):
    a, b = A[i], B[i]
    unite(a, b)
    # print(PARENT[1:])
    # print(SIZE[1:])
    # print(g)
    # print(Z - g)
    ans.append(Z - g)
    # print("----")

ans.reverse()
del ans[0]
for a in ans:
    print(a)
print(Z)


### FIXED CODE ###

import sys
sys.setrecursionlimit(100000)

N, M = [int(x) for x in input().split()]
g = 0

A = []
B = []

for i in range(M):
    a, b = [int(x) for x in input().split()]
    A.append(a)
    B.append(b)

A.reverse()
B.reverse()


# ----- Union Find -----------
PARENT = list(range( N + 1 ))
SIZE = [1] * (N + 1 )

def root(n):
    if PARENT[n] == n:
        return n
    else:
        ret = root(PARENT[n])
        PARENT[n] = ret
        return ret

def same(n1, n2):
    return root(n1) == root(n2)


def unite(n1, n2):
    n1 = root(n1)
    n2 = root(n2)
    if n1 == n2:
        return
    PARENT[n1] = n2
    global g
    g = g + SIZE[n2] * SIZE[n1]
    SIZE[n2] += SIZE[n1]
    SIZE[n1] = 0

Z = N * (N - 1) // 2

ans = []
for i in range(M):
    a, b = A[i], B[i]
    unite(a, b)
    # print(PARENT[1:])
    # print(SIZE[1:])
    # print(g)
    # print(Z - g)
    ans.append(Z - g)
    # print("----")

ans.reverse()
del ans[0]
for a in ans:
    print(a)
print(Z)
s1, s2, s3 = input().split()
print(s1[0].upper() + S2[0].upper() + S3[0].upper())

### FIXED CODE ###

s1, s2, s3 = input().split()
print(s1[0].upper() + s2[0].upper() + s3[0].upper())
import sys
n,m = map(int,input().split(" "))
nums = [-1] * n
for _ in range(m):
    s,c = map(int,input().split(" "))
    if n > 1 and s == 1 and c == 0:
        print(-1)
        sys.exit(0)
    if nums[s-1] != -1 and c != nums[s-1]:
        print(-1)
        sys.exit(0)
    nums[s-1] = c
nums = [0 for num in nums if num == -1 else num]
if n == 1:
    print(nums[0])
    sys.exit(0)
if nums[0] == 0:
    nums[0] = 1
print("".join(map(str,nums)))

### FIXED CODE ###

import sys
n,m = map(int,input().split(" "))
nums = [-1] * n
for _ in range(m):
    s,c = map(int,input().split(" "))
    if n > 1 and s == 1 and c == 0:
        print(-1)
        sys.exit(0)
    if nums[s-1] != -1 and c != nums[s-1]:
        print(-1)
        sys.exit(0)
    nums[s-1] = c
nums = [0 if num == -1 else num for num in nums]
if n == 1:
    print(nums[0])
    sys.exit(0)
if nums[0] == 0:
    nums[0] = 1
print("".join(map(str,nums)))
s = list(input().split())
t = list(input().split())

n = len(s)
x = [0]*n
for i in range(n-1):
    if s[i] == s[i+1]: 
        x[i] += 1
    else:
        break

y = [0]*n
for i in range(n-1):
    if s[i] == s[i+1]: 
        x[i] += 1
    else:
        break

S =collections.Counter(s)
T =collections.Counter(t)

S1 = S.values()
T1 = S.values()

if x == y and sorted(S1) == sorted(T1):
    print('Yes')
else:
    print('No')

### FIXED CODE ###

import collections
s = input()
t = input()

S = sorted(list(collections.Counter(s).values()))
T = sorted(list(collections.Counter(t).values()))

if S == T:
    print('Yes')
else:
    print('No')
a=int(input())
c=list(input())
d=''
b=list('ABCDEFGHIJKLMNOPQRSTUVWXYZ')
for i in range(len(c)):
  if b.index(c[i])+a<=26:
    c[i]=b[b.index(c[i])+a]
  else:
    c[i]=b[27-(b.index(c[i])+a)]
for i in range(len(c)):
  d+=c[i]
print(d)


### FIXED CODE ###

N=int(input())
S=list(input())
a=list('ABCDEFGHIJKLMNOPQRSTUVWXYZ')
res=''

for s in S:
  code=a.index(s)+N
  if code>a.index('Z'):
    code-=26
  res+=a[code]
print(res)
N=int(input())

x=N%10
if X==3:
  print('bon')

elif x==0 or x==1 or x==6 or x==8:
  print('pon')

else:
  print('hon')

### FIXED CODE ###

N=int(input())

x=N%10
if x==3:
  print('bon')

elif x==0 or x==1 or x==6 or x==8:
  print('pon')

else:
  print('hon')
S = list(input())
K = int(input())
ans = 0

if len(S) == 1:
    ans = K//2
elif len(set(s)) == 1:
    ans = int(len(S)*K/2)
else:
    for i in range(len(S)-1):
        if S[i] == S[i+1]:
            ans += 1
            S[i+1] = "#"

    ans *= K

    if S[0] == S[-1]:
        ans += K-1
    # print(S)
print(ans)

### FIXED CODE ###

S = list(input())
K = int(input())

S1 = list(S)
cnt1 = 0
for i in range(1, len(S1)):
    if S1[i] == S1[i - 1]:
        S1[i] = '*'
        cnt1 += 1

S2 = list(S) * 2
cnt2 = 0
for i in range(1, len(S2)):
    if S2[i] == S2[i - 1]:
        S2[i] = '*'
        cnt2 += 1
        
S3 = list(S) * 3
cnt3 = 0
for i in range(1, len(S3)):
    if S3[i] == S3[i - 1]:
        S3[i] = '*'
        cnt3 += 1

# print("#", S1, S2, S3)
# print("#", cnt1, cnt2, cnt3)
ans = cnt1 + (cnt2 - cnt1) * (K // 2) + (cnt3 - cnt2) * ((K - 1) // 2)
print(ans)
X,Y = intput().split()
if X>Y:
  print(">")
elif X<Y:
  print("<")
else:
  print("=")

### FIXED CODE ###

X,Y = input().split() 
if X>Y:
  print(">")
elif X<Y:
  print("<")
else:
  print("=")
x=input()
print(x+'s' if x[len(x)-1]!=s else x[0:len(x)-1]+"es")

### FIXED CODE ###

x=input()
print(x+'s' if x[len(x)-1]!='s' else x+"es")
HP, n = map(int, input().split())
damege = list(input().split())
if sum(damege) >= HP:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

HP, n = map(int, input().split())
damege = list(map(int, input().split()))
if sum(damege) >= HP:
  print("Yes")
else:
  print("No")
A, B = input().split()
print(math.gcd(A,B))

### FIXED CODE ###

def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

#a,bの最小公倍数
def lcm(a, b):
    return a * b // gcd (a, b)
A, B = input().split()
print(lcm(int(A), int(B)))
def count(num):    
    l1=[]
    for a in range (10):
        for b in range(10):
            for c in range (10):
                for d in range (10):
                    l1.append([a,b,c,d])
    l1=list(filter(lambda x: sum(x)==num,l1))
    return(len(l1))
while 1==1:
    print(count(int(input())))

### FIXED CODE ###

def count(num):    
    l1=[]
    for a in range (10):
        for b in range(10):
            for c in range (10):
                for d in range (10):
                    l1.append([a,b,c,d])
    l1=list(filter(lambda x: sum(x)==num,l1))
    return(len(l1))

while True:
    try:
        print(count(int(input())))
    except:
        break
a = input()
b = input()
max1 = max(a,b)
max2 = max(min(a,b),max(a,b)-1)
 
print(max1 + max2)

### FIXED CODE ###

a,b=map(int, input().split()) 
max1 = max(a,b)
max2 = max(min(a,b), max(a,b)-1)
 
print(max1+max2)
# -*- coding: utf-8 -*-

import sys
import os

for s in sys.stdin:
    n = int(s)
    if n == 0:
        break

    m = int(input())

    # adjacency matrix
    M = [[float('inf') for i in range(n)] for j in range(n)]

    for i in range(m):
        a, b, d = map(int, input().split(','))
        M[a][b] = d
        M[b][a] = d

    for i in range(m):
        M[i][i] = 0

    X = []
    Y = [i for i in range(n)]

    X.append(0)
    Y.remove(0)

    light_num = 0
    while len(X) != n:
        lst = []
        for x in X:
            for y in Y:
                dist = M[x][y]
                lst.append((dist, x, y))
        lst.sort()

        # selected node
        dist, x, y = lst[0]
        light_num += (dist // 100) - 1

        if x not in X:
            X.append(x)
            Y.remove(x)
        else:
            X.append(y)
            Y.remove(y)
    print(light_num)

### FIXED CODE ###

# -*- coding: utf-8 -*-

import sys
import os

for s in sys.stdin:
    n = int(s) # node num
    if n == 0:
        break

    m = int(input()) # edge num

    # adjacency matrix
    M = [[float('inf') for i in range(n)] for j in range(n)]

    for i in range(m):
        a, b, d = map(int, input().split(','))
        M[a][b] = d
        M[b][a] = d

    for i in range(n):
        M[i][i] = 0

    X = [] # selected
    Y = [i for i in range(n)] # not selected

    X.append(0)
    Y.remove(0)

    light_num = 0
    while len(X) != n:
        lst = []
        for x in X:
            for y in Y:
                dist = M[x][y]
                lst.append((dist, x, y))
        lst.sort()

        # selected node
        dist, x, y = lst[0]
        light_num += (dist // 100) - 1

        if x not in X:
            X.append(x)
            Y.remove(x)
        else:
            X.append(y)
            Y.remove(y)
    print(light_num)
N = int(input())
P = [int(i) for i in input().split()]
min = min(P)

count = 1
for i in range(N-1):
    if P[i+1] == min:
        break
    if min(P[:i+1]) > P[i+1]:
        count+=1
    
print(count)

### FIXED CODE ###

# https://atcoder.jp/contests/abc152/submissions/9600286
N = int(input())
P = list(map(int, input().split()))
c = 10**9
count = 0
for i in P:
    #リストの始めから探索
    #minを保持していく
    if i < c:
        c=i
        count+=1
print(count)
one = []
ten = []

menu = [int(input()) for i in range(5)]

for i in range(5):
    one.append(menu[i] % 10)
    ten.append(menu[i] // 10)

for i in range(5):
    if one[i] == 0:
        one[i] = 10

one_min = min(one)

for i in range(5):
    if one[i] == 10:
        one[i] = 0

for i in range(5):
    if one_min == one[i]:
        one_min_idx = i

total = 0

for i in range(5):
    if one_min_idx != i:
        if one[i] == 0:
            total += ten[i] * 10
        else:
            total += ten[i] * 10 + 10

total += menu[one_min_idx]

print(total)


### FIXED CODE ###

one = []

menu = [int(input()) for i in range(5)]

for i in range(5):
    one.append(10 - menu[i] % 10)

for i in range(5):
    if one[i] == 10:
        one[i] = 0

total = 0
cnt = 0
for i in range(5):
    if cnt == 0 and one[i] == max(one):
        total += menu[i]
        cnt = 1
    else:
        total += menu[i]
        total += one[i]

print(total)
# AOJ 1105: Unable Count
# Python3 2018.7.14 bal4u

while True:
	n, a, b = map(int, input().split())
	if n == 0: break
	f = [0]*(n>>1)
	for x in range(0, n, a):
		for y in range(0, n+1, b): f[x+y] = 1
	print(n-sum(f[1:n+1]))


### FIXED CODE ###

# AOJ 1105: Unable Count
# Python3 2018.7.14 bal4u

while True:
	n, a, b = map(int, input().split())
	if n == 0: break
	f = [0]*(n+max(a,b)+1)
	f[0], f[a], f[b] = 1, 1, 1
	s = min(a, b)
	for k in range(s, n+1):
		if f[k]: f[a+k] = 1; f[b+k] = 1
	print(n-sum(f[s:n+1]))
#コピペコード
H, W = map(int, input().split())
a = [input() for _ in range(H)]
row = [False] * h
col = [False] * w
for i in range(h):
	for j in range(w):
		if a[i][j] == '#':
			row[i] = True
			col[j] = True
 
for i in range(h):
	if row[i]:
		for j in range(w):
			if col[j]:
				print(a[i][j], end = '')
		print()

### FIXED CODE ###

#コピペコード
H, W = map(int, input().split())
a = [input() for _ in range(H)]
row = [False] * H
col = [False] * W
for i in range(H):
	for j in range(W):
		if a[i][j] == '#':
			row[i] = True
			col[j] = True
 
for i in range(H):
	if row[i]:
		for j in range(W):
			if col[j]:
				print(a[i][j], end = '')
		print()