Harryxun/stf_run huggingface dataset:
import sys
import numpy as np

# 黒: #
# 白: .

H, W = input().split()

H = int(H)
W = int(W)

A = np.zeros([H,W])

for i in range(H):
    chars = np.array(list(input()))
    A[i,:] = np.where(chars=='.', 0, 1)

cnt = 0
w_num = np.sum(A == 0)

while w_num != 0:
    cnt += 1
    B = np.zeros([H+2,W+2])
    B[1:H+1,1:W+1] = A
#    for i in range(1,W+1):
#        for j in range(1,H+1):
#            B[i+1,j+1] = B[i+1,j+1] + B[i,j+1] + B[i+2,j+1] \
        #                            + B[i+1,j] + B[i+1,j+2]
#   for i in range(1,W+1)
#       for j in range(1,H+1)
#           B[i,j] = B[i,j] + B[i+1,j] + B[i-1,j]
#                           + B[i,j+1] + B[i,j-1]

    B[1:W+1,1:H+1] = B[1:W+1,1:H+1] + B[2:W+2,1:H+1] + B[0:W,1:H+1] \
                                    + B[1:W+1,2:H+2] + B[1:W+1,0:H]

    B = np.where(B == 0, 0, 1)
    A = B[1:H+1,1:W+1]
    w_num = np.sum(A== 0)
#    print(B)

print(cnt)

### FIXED CODE ###

def main():
    H, W = map(int, input().split())
    field = [list(input()) for _ in range(H)]
    dd = ((1, 0), (-1, 0), (0, 1), (0, -1))

    q = []
    for i in range(H):
        for j in range(W):
            if field[i][j] == "#":
                q.append((i, j))
                field[i][j] = 0
    moves = 0

    while q:
        qn = []
        moves += 1
        for x, y in q:
            for dx, dy in dd:
                nx, ny = int(x + dx), int(y + dy)
                if 0 <= nx < H and 0 <= ny < W:
                    if field[nx][ny] == ".":
                        field[nx][ny] = moves
                        qn.append((nx, ny))

        q = qn

    m = []
    for i in range(H):
        m.append(max(field[i]))
    print(max(m))


main()
if S == "SUN":
  print("0")
  
elif S == "MON":
  print("1")
elif S == "TUE":
  print("2")
elif S == "WED":
  print("3")
elif S == "THE":
  print("4")
elif S == "FRI":
  print("5")
elif S == "SAT"
  print("6")

### FIXED CODE ###

S = ["SUN","MON","TUE","WED","THU","FRI","SAT"]

print(7-S.index(input()))
import numpy as np

if __name__=="__main__":
    inputs_number  = lambda : [int(x) for x in input().split()]
    N, Ma, Mb = inputs_number()
    drugs = np.array([inputs_number() for i in range(N)]).astype(np.int16)

    inf = 100*N + 1
    dp = np.ones((N+1,N*10+1,N*10+1)) * inf
    dp[0,0,0] = 0
    for i in range(N):
	for ca in range(N*10+1):
            for cb in range(N*10+1):
		if(dp[i,ca,cb]==inf):
                    continue
		dp[i+1,ca,cb]=np.min([dp[i+1,ca,cb],dp[i,ca,cb]]);
		dp[i+1,ca+drugs[i,0],cb+drugs[i,1]]=np.min([dp[i+1,ca+drugs[i,0],cb+drugs[i,1]],dp[i,ca,cb]+drugs[i,2]]);

    ans = inf
    for ca in range(1, N*10+1):
        for cb in range(1, N*10+1):
	    if(Ma*cb == Mb*ca and dp[N,ca,cb] < ans):
            	ans = dp[N,ca,cb]
    if(ans==inf):
	ans = -1
    print(int(ans))

### FIXED CODE ###

import numpy as np
import copy

if __name__=="__main__":
    inputs_number  = lambda : [int(x) for x in input().split()]
    N, Ma, Mb = inputs_number()
    drugs = [inputs_number() for i in range(N)]
    inf = 100*N + 1
    dp = np.ones((2,N*10+1,N*10+1)).astype(np.int32) * inf
    dp = dp.tolist()
    dp[0][0][0] = 0.0

    for i in range(N):
        for ca in range(10*i+1):
            for cb in range(10*i+1):
                if(dp[0][ca][cb]==inf):
                    continue
                dp[1][ca][cb]=min([dp[1][ca][cb], dp[0][ca][cb]])
                dp[1][ca+drugs[i][0]][cb+drugs[i][1]]=min([dp[1][ca+drugs[i][0]][cb+drugs[i][1]], dp[0][ca][cb]+drugs[i][2]])
        dp[0] = copy.copy(dp[1])
        dp[1] = (np.ones((N*10+1,N*10+1)).astype(np.int32) * inf).tolist()
    ans = inf
    for ca in range(1, N*10+1):
        for cb in range(1, N*10+1):
            if(Ma*cb==Mb*ca and dp[0][ca][cb]<ans):
                ans = dp[0][ca][cb]
    if(ans==inf):
        ans = -1
    print(int(ans))
a = input()
s = input()
if a >= 3200:
  print(s)
else:
  print('red')

### FIXED CODE ###

a = int(input())
s = input()
if a >= 3200:
  print(s)
else:
  print('red')
n=int(input())
m=int(input())
c=0
d=0
if n>1:
    c=int((n*(n-1))/2)
if m>1:
    d=int((m*(m-1))/2)
print(c+d)


### FIXED CODE ###

n,m=map(int,input().split())
print((n*(n-1)+m*(m-1))//2)
import itertools
N,M=map(int,input().split())
edges={tuplec(sorted(map(int,input().split()))) for i in range(M)}
ans=0
for i in itertools.permutations(range(2,N+1)):
    l=[1]+list(i)
    ans+=sum(1 for edge in zip(l,l[1:]) if tuple(sorted(edge)) in edges)==N-1
print(ans)

### FIXED CODE ###

import itertools
N,M=map(int,input().split())
edges={tuple(sorted(map(int,input().split()))) for i in range(M)}
ans=0
for i in itertools.permutations(range(2,N+1),N-1):
    l=[1]+list(i)
    ans+=sum(1 for edge in zip(l,l[1:]) if tuple(sorted(edge)) in edges)==N-1
print(ans)
n=int(input())
b = list(map(int,input().split()))
b.append(1000000)
li = []
for i in range(n-1):
    if((b[i]>0) and b[i] <= b[i+1] ):
        li.append(b[i])

print(sum(li)+min(li))

### FIXED CODE ###

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

a = [0]*n
b.append(1000000)

a[0] = b[0]
for i in range(1,n):
    a[i] = min(b[i],b[i-1])

print(sum(a))
N = int(input())
A = input().split()
answer = 1
flag = 0
x = 10**18

if '0' in A:
  print(0)
  flag = 1
  
for i in range(N):
  answer *= int(A[i])
  if answer > x:
    print(-1)
    flag = 1
    break

if flag == 0:
  print(answer)



### FIXED CODE ###

A,B =map(int,input().split())
print(A*B)
a=input()
k=int(input())
x=5*pow(10,15)
i=0
while k>0:
    k-=int(str(a)[i])*x
    i+=1
print(str(a)[i-1])

### FIXED CODE ###

a=input()
k=int(input())
if int(a)<10:
    a=str(int(a)*11)
i=0
x=0
while k>=0:
    if a[i]=='1':
        k-=1
        i+=1
        if k==0:
            x=1
            k=-1
    else: 
        k=-1
print(a[i-x])
n,k=map(int,input().split())
a=list(map(lambda x:int(x)-1,input().split()))
lst=[0]
now=0
memo=0
for i in range(k):
	now=a[now]
	if now in lst:
		memo=now
		break
	lst.append(now)
i=a.index(memo)
l=len(lst)
if memo!=0:
	lst=lst[i:]
print(lst[(k-l)%len(lst)]+1)

### FIXED CODE ###

n,k=map(int,input().split())
a=list(map(lambda x:int(x)-1,input().split()))
lst=[0]
now=0
memo=0
town=[0]*n
town[0]=1
b=0
for i in range(k):
	now=a[now]
	if town[now]==1:
		memo=now
		b=1
		break
	lst.append(now)
	town[now]=1
if b==1:
	i=lst.index(memo)
	l=len(lst)
	if memo!=0:
		lst=lst[i:]
		l-=len(lst)
		print(lst[(k-l)%len(lst)]+1)
	else:
		print(lst[k%l]+1)
else:
	print(now+1)
n=int(input())
a=list(map(int,input().split()))
a.sort(reverse=True)

b = list(set(a))
b.sort(reverse=True)

for i in range(len(b)):
    if a.count(b[i])==4:
        print(b[i]**2)
        exit()
    elif a.count(b[i])==3 or a.count(b[i])==2:
        while True:
            j=i+1
            if j<n and a.count(b[j])>=2:
                print(b[i]*b[j])
                break
                exit()
            else:
                j+=1
print(0)

### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
a.sort(reverse=True)

tmp1=a[0]
for i in range(n-1):
    l,s= 0,0
    if tmp1 == a[i+1]:
        idx = i+1
        l = tmp1 #lを確定させる
        #break
        tmp2=a[idx+1]
        for j in range(idx+1,n-1):
            if tmp2==a[j+1]:
                s = tmp2
                print(l*s)
                exit()
            else:
                tmp2 = a[j+1]
    else:
        idx=i
        tmp1=a[i+1]
        
print(0)
from bisect import bisect
from itertools import accumulate

MOD = 998244353

def solve(robots):
    N = len(robots)
    robots.sort()

    origins = [x for x,d in robots]
    dests = [x+d for x,d in robots]

    parent = [None]*(N+1)

    stack = [(float('inf'),0)]
    for i,(o,d) in enumerate(zip(origins,dests),start=1):
        while stack[-1][0] <= o:
            stack.pop()
        parent[i] = stack[-1][1]
        while stack[-1][0] <= d:
            stack.pop()
        stack.append((d,i))

    adj = [list() for _ in range(N+1)]
    for i,p in enumerate(parent):
        if p is not None:
            adj[p].append(i)

    def rec(i):
        if not adj[i]:
            return 1
        a = 1
        for j in adj[i]:
            a *= rec(j)+1
            a %= MOD
        return a

    return rec(0)

if __name__ == '__main__':
    N = int(input())
    robots = [tuple(map(int,input().split())) for _ in range(N)]
    print(solve(robots))

### FIXED CODE ###

from bisect import bisect
from itertools import accumulate
from functools import reduce
from sys import setrecursionlimit

setrecursionlimit(10000000)

MOD = 998244353

def solve(robots):
    N = len(robots)
    robots.sort()

    parent = [None]*(N+1)

    stack = [(float('inf'),0)]
    for i,(x,d) in enumerate(robots,start=1):
        d += x
        while stack[-1][0] <= x:
            stack.pop()
        parent[i] = stack[-1][1]
        while stack[-1][0] <= d:
            stack.pop()
        stack.append((d,i))

    dp = [1]*(N+1)
    for i in reversed(range(1,N+1)):
        p = parent[i]
        dp[p] *= dp[i]+1
        dp[p] %= MOD
    return dp[0]

if __name__ == '__main__':
    N = int(input())
    robots = [tuple(map(int,input().split())) for _ in range(N)]
    print(solve(robots))
s=input()
if len(s)<26:
    al=[chr(ord('a') + i) for i in range(26)]
    for i in al:
        if not(i in s):
            print(s+i)
            exit()
if s=="zyxwvutsrqponmlkjihgfedcba":
    print(-1)
    exit()
for i in range(25):
    if s[i]>s[i+1]:
        k=i-1

a="z"
for i in range(k+2,26):
    if s[k]<s[i]:
        a=min(a,s[i])
print(s[:k]+a)

### FIXED CODE ###

s=input()
if len(s)<26:
    al=[chr(ord('a') + i) for i in range(26)]
    for i in al:
        if not(i in s):
            print(s+i)
            exit()
if s=="zyxwvutsrqponmlkjihgfedcba":
    print(-1)
    exit()
a=[]
for i in range(25,-1,-1):
    for j in range(24-(25-i),-1,-1):
        if s[j]<s[i]:
            a.append(s[:j]+s[i])
print(min(a))
def d_preparing_boxes(N, A):
    balls = [0] * N

    for i in range(N, 0, -1):
        t = i
        while t <= N:
            if balls[i - 1] % 2 != A[i - 1]:
                balls[i - 1] += 1
            t += i
    ans = [k for k, b in enumerate(balls, 1) if b != 0]
    return '\n'.join(map(str, (len(ans), *ans))) if len(ans) != 0 else 0

N = int(input())
A = [int(i) for i in input().split()]
print(d_preparing_boxes(N, A))

### FIXED CODE ###

def d_preparing_boxes(N, A):
    boxes = [0] * (N + 1)
    result = []

    for i in range(N, 0, -1):
        # N以下のiの倍数(i自身を除く)の箱に入っているボールの数を求める
        total = 0
        for j in range(1, N // i):
            total += boxes[(j + 1) * i]
        # 求めたボール数と条件の偶奇が一致しないなら、i番の箱にボールを入れる
        if total % 2 != A[i - 1]:
            boxes[i] = 1
            result.append(i)
    return '\n'.join(map(str, [len(result)] + result)) if len(result) != 0 else 0

N = int(input())
A = [int(i) for i in input().split()]
print(d_preparing_boxes(N, A))
t,l=open(0);print(sum(sorted(map(int,l.split()))[-int(t[2:])]))

### FIXED CODE ###

_,k,*l=map(int,open(0).read().split());print(sum(sorted(l)[-k:]))
def min_disc(points):
    from random import sample
    N = len(points)
    if N == 1:
        return points[0], 0
    points = sample(points, N)
    def cross(a, b):
        return a.real * b.imag - a.imag * b.real
    def make_circle_3(a, b, c):
        A, B, C = abs(b-c), abs(c-a), abs(a-b)
        S = cross(b-a, c-a)
        p = (A*(B+C-A)*a + B*(C+A-B)*b + C*(A+B-C)*c) / (4*S*S)
        r2 = abs(p-a)
        return p, r2
    def make_circle_2(a, b):
        c = (a+b) / 2
        r2 = abs(a-c)
        return c, r2
    def in_circle(point, circle):
        return abs(point-circle[0]) <= circle[1]+1e-7
    p0 = points[0]
    circle = make_circle_2(p0, points[1])
    for i, p_i in enumerate(points[2:], 2):
        if not in_circle(p_i, circle):
            circle = make_circle_2(p0, p_i)
            for j, p_j in enumerate(points[1:i], 1):
                if not in_circle(p_j, circle):
                    circle = make_circle_2(p_i, p_j)
                    for p_k in points[:j]:
                        if not in_circle(p_k, circle):
                            circle = make_circle_3(p_i, p_j, p_k)
    return circle

N = int(input())
XY = []
for _ in range(N):
    x, y = map(int, input().split())
    XY.append(x + y*1j)
center, rad = min_disc(XY)
print(rad)


### FIXED CODE ###

def min_disc(points):
    from random import sample
    N = len(points)
    if N == 1:
        return points[0], 0
    points = sample(points, N)
    def cross(a, b):
        return a.real * b.imag - a.imag * b.real
    def norm2(a):
        return a.real * a.real + a.imag * a.imag
    def make_circle_3(a, b, c):
        A, B, C = norm2(b-c), norm2(c-a), norm2(a-b)
        S = cross(b-a, c-a)
        p = (A*(B+C-A)*a + B*(C+A-B)*b + C*(A+B-C)*c) / (4*S*S)
        radius = abs(p-a)
        return p, radius
    def make_circle_2(a, b):
        c = (a+b) / 2
        radius = abs(a-c)
        return c, radius
    def in_circle(point, circle):
        return abs(point-circle[0]) <= circle[1]+1e-7
    p0 = points[0]
    circle = make_circle_2(p0, points[1])
    for i, p_i in enumerate(points[2:], 2):
        if not in_circle(p_i, circle):
            circle = make_circle_2(p0, p_i)
            for j, p_j in enumerate(points[1:i], 1):
                if not in_circle(p_j, circle):
                    circle = make_circle_2(p_i, p_j)
                    for p_k in points[:j]:
                        if not in_circle(p_k, circle):
                            circle = make_circle_3(p_i, p_j, p_k)
    return circle

N = int(input())
XY = []
for _ in range(N):
    x, y = map(int, input().split())
    XY.append(x + y*1j)
center, rad = min_disc(XY)
print(rad)
l=[]
c=0
s=input().split()
for i in s:
	if i=="+":
		l[c-2]=l[c-2]+l[c-1]
		c=c-1
	elif i=="-":
		l[c-2]=l[c-2]-l[c-1]
		c=c-1
	elif i=="*":
		l[c-2]=l[c-2]*l[c-1]
		c=c-1
	else:
		l[c]=int(i)
		c=c+1
printl[0]


### FIXED CODE ###

l=[0]*1000
c=0
s=input().split()
for i in s:
	if i=="+":
		l[c-2]=l[c-2]+l[c-1]
		c=c-1
	elif i=="-":
		l[c-2]=l[c-2]-l[c-1]
		c=c-1
	elif i=="*":
		l[c-2]=l[c-2]*l[c-1]
		c=c-1
	else:
		l[c]=int(i)
		c=c+1
print(l[0])
def solve():
  val = str(input())
  return val[2] == val[3] && val[4] == val[5]
solve();

### FIXED CODE ###

def solve():
  val = str(input())
  if val[2] == val[3] and val[4] == val[5]:
    print('Yes')
  else:
    print('No')
solve();
x,y=map(int,input().split())
for i in range(1,1000):
  x*=2
  if x>y:
    print(i)
    break

### FIXED CODE ###

a,b,c,d=map(int,input().split())
if a+b>c+d:
  print("Left")
elif a+b==c+d:
  print("Balanced")
else:
  print("Right")
N,M = map(int,input().split())
a = 0
w = 0
lis = [[] for i in range(N)]
for i in range(M):
  p,s = map(int,input().split())
  p = int(p)
  lis[p - 1].append(s)
for j in range(N):
  if lis[j].count("AC") > 0:
    a += 1
    w += lis[j].index("AC")

    
print(a,w)



### FIXED CODE ###

N,M = map(int,input().split())
a = 0
w = 0
lis = [[] for _ in range(N)]
for i in range(M):
  p,s = map(str,input().split())
  p = int(p)
  lis[p - 1].append(s)
for j in range(N):
  if lis[j].count("AC") > 0:
    a += 1
    w += lis[j].index("AC")

    
print(a,w)
n, m = (int(i) for i in input().split())  
a = [[int(i) for i in input().split()] for i in range(n)] 
dic = {}
lis = []

for x in a:
  if x[0] not in dic:
  	dic[x[0]] = x[1]
  else:
    dic[x[0]] += x[1]

sorted_dict = sorted(dic.items(), key=lambda x:x[0])

count = 0
for x in sorted_dict:
  if count < m:
    lis += [x[0]] * x[1]
    count += x[1]
  else:
    break
  
#print(lis)
print(sum(lis[:m]))

### FIXED CODE ###

n, m = (int(i) for i in input().split())  
a = [[int(i) for i in input().split()] for i in range(n)] 
dic = {}
lis = []

a.sort()
ans = 0
for x in a:
  if x[1] >= m:
    ans += x[0] * m
    break
  else:
    ans += x[0] * x[1]
    m -= x[1]

print(ans)
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))

# 定義してないリストを参照するとエラーがでるからダミー置いといた。
A.append(100)
C.append(0)

total = 0

total = sum(B)

for i in range(1, N):
    if (A[i] - A[i - 1] == 1):
        total += C[A[i] - 1 - 1]

print(total)

A = list(map(int, input().split()))
print(A)
print(sum(A))


### FIXED CODE ###

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

A.append(100)
C.append(0)

total = 0

for i in range(0,N):
    if(A[i + 1] - A[i] == 1):
        total += C[A[i] - 1]
    total += B[A[i] - 1]

print(total)
S = list(input())
flag = False
if S[0] == S[1]:
    flag = True
N = len(S)
K = int(input())
cnt = 0

for i in range(N-1):
    if S[i] == S[i+1]:
        cnt += 1
        S[i+1] = '!'

if S[N-1] == S[0]:
    if flag:
        print(cnt*K)
    else:
        print(cnt*K+(K-1))
else:
    print(cnt*K)

### FIXED CODE ###

S = list(input())
N = len(S)
K = int(input())
  
if len(set(S)) == 1:
  print((N*K)//2)
  exit()

ans = 0
i = 0
while i < N-1:
  if S[i] == S[i+1]:
    ans += 1
    i += 1
  i += 1

if S[0] != S[N-1]:
  print(ans*K)
  exit()

a = 1
while S[0] == S[a]:
  a += 1

b = 1
while S[N-1] == S[N-1-b]:
  b += 1
print(ans*K - (K-1)*(a//2 + b//2 - (a+b)//2))
for i in range(3, int(input() + 1):
    if i % 3 == 0 or '3' in str(i):
        print('', i, end='')
print()

### FIXED CODE ###

for i in range(3, int(input()) + 1):
    if i % 3 == 0 or '3' in str(i):
        print('', i, end='')
print()
list=[int(i) for i in input().split()]

a=list[0]
b=list[1]

while a%b!=0:
   c=a%b
   a=b
   b=c

print(c)


### FIXED CODE ###

list=[int(i) for i in input().split()]

if list[0]>list[1]:
    a=list[0]
    b=list[1]
else:
    b=list[0]
    a=list[1]    


if a%b==0:
    print(b)
else:
    while b>0:
        c=a%b
        a=b
        b=c
    print(a)
import numpy as np


def calc(n):
    lim = int((n - 2) ** 0.5 - 1) + 1
#     lim = 130

    result = np.zeros(n + 1, dtype=int)
    for x in range(1, lim):
        for y in range(x, lim):
            for z in range(y, lim):
                index = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
                if index > n:
                    continue
                s = set([x, y, z])
                if len(s) == 1:
                    result[index] += 1
                elif len(s) == 2:
                    result[index] += 3
                else:
                    result[index] += 6

    return result[1:]


for i in calc(int(input())):
    print(i)

### FIXED CODE ###

import numpy as np


def calc(n):
    #     lim = int((n - 2) ** 0.5 - 1) + 1
    lim = 130

    result = np.zeros(n + 1, dtype=int)
    for x in range(1, lim):
        for y in range(1, lim):
            if x > y:
                continue
            for z in range(1, lim):
                if y > z:
                    continue
                index = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
                if index > n:
                    continue
                s = set([x, y, z])
                if len(s) == 1:
                    result[index] += 1
                elif len(s) == 2:
                    result[index] += 3
                else:
                    result[index] += 6

    return result[1:]


for i in calc(int(input())):
    print(i)
s,t = map(str, input().split())
a,b = map(str, input().split())
u = input()
if s == u:
  print("{} {}".format(a-1, b))
else:
  print("{} {}".format(a, b-1))

### FIXED CODE ###

s,t = map(str, input().split())
a,b = map(int, input().split())
u = input()
if s == u:
  print("{} {}".format(a-1, b))
else:
  print("{} {}".format(a, b-1))
n=int(input())
dat = list(map(int, input().split()))
dan = []
for e in dat:
    e = list(str(bin(e)))
    e.reverse()

min=0
 for e in dat:
       i=0
       while i < len(e):
             #if e[i]=='1':
                # if i > min:
                #     min = i
                #     break
           #  else:
                  i=i+1
print(min)

    
    
     
                

         
           




### FIXED CODE ###

import sys

def main():
    N = int(input())
    A = [int(_) for _ in input().split()]

    t = 0
    while True:
        for i in range(N):
            if A[i] % 2 == 0:
                A[i] //= 2
            else:
                print(t)
                sys.exit()
        t += 1

main()
A = int(input())
print(%h:%m:%s %(A/3600,A%3600/60,A%60))


### FIXED CODE ###

A = int(input())
print("%d:%d:%d"%(A/3600,(A%3600)/60,A%60))
# import math
import fractions
n, k = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
a = sorted(a)
div = fractions.gcd(a[0], a[1])
for i in range(2, n):
    div = fractions.gcd(a[i], a[i-1])
if k % div == 0 and k <= a[-1]:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")
"""
b = []
for i in range(len(a)):
    if a[i] == k:
        print("POSSIBLE")
        exit()
    elif a[i] > k:
      b.append(a[i] - k)
      del(a[i])
print(a)
print(b)
"""

### FIXED CODE ###

# import math
# import fractions
def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)


n, k = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
a = sorted(a)

div = a[0]
for i in range(1, n):
    div = gcd(div, a[i])

if k % div == 0 and k <= a[-1]:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")
n = int(input())
x = list(map(int,input().split())

for i in range(n/2):
    print(x[n/2])

for i in range(n/2):
    print(x[(n-1)//2])


### FIXED CODE ###

from numpy import median
from copy import deepcopy

n = int(input())
x = list(map(int,input().split()))

sx = sorted(x)
newl = deepcopy(sx)
del newl[0]
maxm = median(newl)
newl = deepcopy(sx)
del newl[-1]
minm = median(newl)

med = median(x)

for i in x:
    if i > med:
        print(int(minm))
    else:
        print(int(maxm))
while True:
    (m, f, r) = [int(i) for i in input().split()]
    if m == f == r == -1:
        break

    total = m + f
    if m == -1 or f == -1  or total < 30:
        print('F')
    elif total < 50 and r < 50:
        print('D')
    elif total < 65:
        print('C')
    elif total < 80:
        print('B'):
    else:
        print('A')

### FIXED CODE ###

while True:
    (m, f, r) = [int(i) for i in input().split()]
    if m == f == r == -1:
        break
 
    total = m + f
    if m == -1 or f == -1 or total < 30:
        print('F')
    elif total < 50 and r < 50:
        print('D')
    elif total < 65:
        print('C')
    elif total < 80:
        print('B')
    else:
        print('A')
r=int(input())
aera=r**2
print(area)


### FIXED CODE ###

r=int(input())
print(r**2)
import numpy as np

H, W, M = map(int, input().split())
h = np.zeros((H))
w = np.zeros((W))
m = np.zeros((H, W))
ans = 0
for _ in range(M):
    tmp_h, tmp_w = map(int, input().split())
    h[tmp_h-1] += 1
    w[tmp_w-1] += 1
    m[tmp_h-1, tmp_w-1] = 1.

h_max = np.max(h)
h_max_index = list(zip(*np.where(h == h_max)))
w_max = np.max(w)
w_max_index = list(zip(*np.where(w == w_max)))

'''
for i in h_max_index:
    for j in w_max_index:
        if m[i[0]][j[0]] == 1.:
            tmp = h_max + w_max -1
        else:
            tmp = h_max + w_max
        if ans < tmp:
            ans = tmp
'''
print(int(ans))


### FIXED CODE ###

import numpy as np

H, W, M = map(int, input().split())
h = np.zeros(H)
w = np.zeros(W)
m = {}
flag = 0

for _ in range(M):
    tmp_h, tmp_w = map(int, input().split())
    h[tmp_h-1] += 1
    w[tmp_w-1] += 1
    m[(tmp_h-1, tmp_w-1)] = 1.

h_max = np.max(h)
h_max_index = list(zip(*np.where(h == h_max)))
w_max = np.max(w)
w_max_index = list(zip(*np.where(w == w_max)))

for i in h_max_index:
    for j in w_max_index:
        if (i[0], j[0]) not in m.keys():
            flag = 1
            break

if flag == 1:
    print(int(h_max + w_max))
else:
    print(int(h_max + w_max - 1))
N = int(input())
p = list(map(int, input().split()))
ans = 0
for i in range(N):
  if p[i] != i+1:
    ans += 1

if ans <= 2:
  print("YES")
else:
  prin("NO")

### FIXED CODE ###

N = int(input())
p = list(map(int, input().split()))
ans = 0
for i in range(N):
  if p[i] != i+1:
    ans += 1

if ans <= 2:
  print("YES")
else:
  print("NO")
s = input()
print (s.count("+") - s.count("-"))


### FIXED CODE ###

s = raw_input()
print (s.count("+") - s.count("-"))