Harryxun/stf_run huggingface dataset:
import math
import sys
from copy import copy
import numpy as np
from collections import defaultdict, deque, Counter
from itertools import accumulate, product, permutations,combinations, combinations_with_replacement
from operator import itemgetter
from bisect import bisect_left,bisect
from heapq import heappop,heappush
from fractions import gcd

max_value = 1000000000
min_value = -1000000000
sys.setrecursionlimit(max_value)

n = int(input())
s = list(input())

count = 0


if s[0] == 'W' or s[-1] == 'W':
    print(0)
    sys.exit()

LR_list = ['' for i in range(2*n)]
LR_list[0] = 'L'

for i in range(1,len(LR_list)):
    if s[i] == s[i-1]:
        if LR_list[i-1] == 'R':
            LR_list[i] = 'L'
        else:
            LR_list[i] = 'R'
    else:
        if LR_list[i-1] == 'R':
            LR_list[i] = 'R'
        else:
            LR_list[i] = 'L'

values = []

if LR_list.count('L') != LR_list.count('R'):
    print(0)
    sys.exit()


li = 0
ri = 0
for i in range(len(LR_list)):
    if i != 0:
        if LR_list[i-1] == 'L':
            li += 1
        elif LR_list[i-1] == 'R':
            ri += 1
    if LR_list[i] == 'R':
        values.append(li-ri)
value = 1
for i in range(len(values)):
    value = value * values[i] % (10**9+7)
for i in range(2,n+1):
    value = value * i %(10**9+7)
print(value)

### FIXED CODE ###

import math
n = int(input())
S = input()
 
RL = [None]*2*n
 
for i in range(2*n):
    if i % 2 == 0:
        if S[i] == 'B':
            RL[i] = 'L'
        else:
            RL[i] = 'R'
 
    else:
        if S[i] == 'B':
            RL[i] = 'R'
        else:
            RL[i] = 'L'
 
if S[0] == 'W' or S[-1] == 'W':
    print(0)
    exit()
 
left = 0
count = 1
mod = 10**9 + 7
 
for check in RL:
    if check == 'L':
        left += 1
    else:
        count = count * left % mod
        left -= 1
 
    if left < 0:
        print(0)
        exit()
 
count = count * math.factorial(n) % mod
 
if left != 0:
    print(0)
else:
    print(count)
class SegmentTree:
    def __init__(self, data, default=0, func=max):
        self._default = default
        self._func = func
        self._len = len(data)
        self._size = _size = 1 << (self._len - 1).bit_length()
        self.data = [default] * (2 * _size)
        self.data[_size:_size + self._len] = data
        for i in reversed(range(_size)):
            self.data[i] = func(self.data[i + i], self.data[i + i + 1])
    def __delitem__(self, idx):
        self[idx] = self._default
    def __getitem__(self, idx):
        return self.data[idx + self._size]
    def __setitem__(self, idx, value):
        idx += self._size
        self.data[idx] = value
        idx >>= 1
        while idx:
            self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
            idx >>= 1
    def __len__(self):
        return self._len
    def query(self, start, stop):
        start += self._size
        stop += self._size
        res_left = res_right = self._default
        while start < stop:
            if start & 1:
                res_left = self._func(res_left, self.data[start])
                start += 1
            if stop & 1:
                stop -= 1
                res_right = self._func(self.data[stop], res_right)
            start >>= 1
            stop >>= 1
        return self._func(res_left, res_right)
    def __repr__(self):
        return "SegmentTree({0})".format(self.data)

import sys
input=sys.stdin.readline
n,k=map(int,input().split())
M=1048576
s=SegmentTree([0]*M)
for i in range(n):
    a=int(input())
    s[a]=1+s.query(max(a-k,0),a+k+1)
print(s.query(0,M))

### FIXED CODE ###

print("ACL"*int(input()))
num = list(map(int, input().split()))

loop = [0]

for i in loop:
  if num[0] < num[1]:
    difference = abs(num[0] - num[1])
    if difference > num[0]:
      break
    else:
      num[0] = difference
      break
  elif num[1] == 1:
    num[0] = 0
    break
  elif num[1] == 0:
    break
  if i = 0:
    num[0] = num[0] % num[1]
  num[0] = abs(num[0] - num[1])
  loop.append(i+1)

print(num[0])

### FIXED CODE ###

num = list(map(int, input().split()))

loop = [0]

for i in loop:
  if num[0] < num[1]:
    difference = abs(num[0] - num[1])
    if difference > num[0]:
      break
    else:
      num[0] = difference
      break
  elif num[1] == 1:
    num[0] = 0
    break
  elif num[1] == 0:
    break
  if i == 0:
    num[0] = num[0] % num[1]
  num[0] = abs(num[0] - num[1])
  loop.append(i+1)

print(num[0])
N, K = list(map(int, input().split()))
A = list(map(int, input().split()))
MOD = 10 ** 9 + 7

P = []
M = []
for i in A:
  if i < 0:
    M.append(abs(i))
  if i > 0:
    P.append(i)

if len(M) + len(P) < K:
  print(0)
  exit()
elif len(M) + len(P) == K:
  ans = 1
  for i in M:
    ans = ans * i % MOD
  for i in P:
    ans = ans * i % MOD
  if len(M) % 2 == 1:
    ans *= -1
    ans += MOD
  print(ans)
  exit()

M.sort(reverse = True)
P.sort(reverse = True)

if len(P) == 0:
  ans = 1
  if K % 2 == 0:
    for i in range(K):
      ans = ans * M[i] % MOD
  else:
    for i in range(K):
      ans = ans * M[-1 -i] % MOD
    ans *= -1
    while ans < 0:
      ans += MOD
  print(ans)
else:
  x = 1 / 0
  ans = 1
  pn = 0
  mn = 0
  if K % 2 == 1:
    K -= 1
    ans *= P[0]
    pn = 1
  for i in range(K // 2):
    if pn + 2 > len(P):
      ans = ans * M[mn] * M[mn + 1] % MOD
      mn += 2
    elif mn + 2 > len(M):
      ans = ans * P[pn] * P[pn + 1] % MOD
      pn += 2
    else:
      p = P[pn] * P[pn + 1]
      m = M[mn] * M[mn + 1]
      if p > m:
        ans = ans * p % MOD
        pn += 2
      else:
        ans = ans * m % MOD
        mn += 2
  print(ans)


### FIXED CODE ###

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

P = []
M = []
Z = 0
for i in A:
  if i < 0:
    M.append(abs(i))
  if i > 0:
    P.append(i)
  if i == 0:
    Z += 1

if len(M) + len(P) < K:
  print(0)
  exit()
elif len(M) + len(P) == K:
  ans = 1
  for i in M:
    ans = ans * i % MOD
  for i in P:
    ans = ans * i % MOD
  if len(M) % 2 == 1:
    ans *= -1
    ans += MOD
  print(ans)
  exit()

M.sort(reverse = True)
P.sort(reverse = True)

if len(P) == 0:
  ans = 1
  if K % 2 == 0:
    for i in range(K):
      ans = ans * M[i] % MOD
  else:
    if Z != 0:
      print(0)
      exit()
    for i in range(K):
      ans = ans * -M[-1 -i] % MOD
    while ans < 0:
      ans += MOD
  print(ans)
else:
  ans = 1
  pn = 0
  mn = 0
  if K % 2 == 1:
    K -= 1
    ans *= P[0]
    pn = 1
  for i in range(K // 2):
    if pn + 2 > len(P):
      ans = ans * M[mn] * M[mn + 1] % MOD
      mn += 2
    elif mn + 2 > len(M):
      ans = ans * P[pn] * P[pn + 1] % MOD
      pn += 2
    else:
      p = P[pn] * P[pn + 1]
      m = M[mn] * M[mn + 1]
      if p > m:
        ans = ans * p % MOD
        pn += 2
      else:
        ans = ans * m % MOD
        mn += 2
  print(ans)
max = 9
for x in xrange(max):
	for y in xrange(max):
		print %dx%d=%d % (x, y, x * y)

### FIXED CODE ###

max = 10
for x in xrange(1, max):
	for y in xrange(1, max):
		print "%dx%d=%d" % (x, y, x * y)
N_X = list(map(int,input().split()))
data = list(map(int,input().split()))
k = 0

def gcd(a,b):
    if b == 0:
        return a
    return gcd(b,a%b)

def mulgcd(list):
    if len(list)==2:
        return gcd(list[0],list[1])
    return gcd(mulgcd(list[1:]),list[0])


for i in data:
    data[k] = abs(i - N_X[1])
    k += 1


if N_X[0] == 1:
    print(abs(data[0]))
else:
    print(mulgcd(data))


### FIXED CODE ###

N_X = list(map(int,input().split()))
data = list(map(int,input().split()))
k = 0

for i in data:
    data[k] = abs(i - N_X[1])
    k += 1

m = min(data)
a = []
for i in range(1,m+1):
    if m % i == 0:
        a.append(i)
        a.append(int(m/i))
    if i**2 > m:
        break

a.sort()
a.reverse()

for i in a:
    if all(c%i == 0 for c in data):
        print(i)
        break
a, b = int(input().split(" "))

quotinent = a // b

res = max(a - b * quotinent, abs( a- b * (quotinent + 1)))
print(res)

### FIXED CODE ###

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

quotinent = a // b

res = min(a - b * quotinent,  abs(a- b * (quotinent + 1)))
print(res)
import math
n=int(input())
a=list(map(int,input().split()))

for i in range(n):
    a[i] -= i+1

# ave = sum(a)/n
# ave1= math.ceil(ave)
# ave2= math.floor(ave)


# print(min(sum([abs(a[i]-ave1) for i in range(n)]),sum([abs(a[i]-ave2) for i in range(n)])))

a.sort()
med1=a[n//2-1]
med2=a[n//2-2]
med3=a[n//2]

print(min(sum([abs(a[i]-med1) for i in range(n)]),sum([abs(a[i]-med2) for i in range(n)]),sum([abs(a[i]-med3) for i in range(n)])))

### FIXED CODE ###

import math
n=int(input())
a=list(map(int,input().split()))

for i in range(n):
    a[i] -= i+1

# ave = sum(a)/n
# ave1= math.ceil(ave)
# ave2= math.floor(ave)


# print(min(sum([abs(a[i]-ave1) for i in range(n)]),sum([abs(a[i]-ave2) for i in range(n)])))

a.sort()
med1=a[n//2-1]
med3=a[n//2]

print(min(sum([abs(a[i]-med1) for i in range(n)]),sum([abs(a[i]-med3) for i in range(n)])))
x == int(input())
if x = 1 :
   print(0)
else :
   print(1)

### FIXED CODE ###

x = int(input())
if x == 1 :
   print(0)
else :
   print(1)
c  = input()
if c in "aeiou":
  print("vowel")
 else:
  print("consonant")

### FIXED CODE ###

c = input()
if c in "aeiou":
  print("vowel")
else:
  print("consonant")
x = int(input())
for a in range(-118,119):
    for b in range(-119,118):
        if a**5 - b**5 == x:
            print(a,b)
            exit()


### FIXED CODE ###

S = input()

if S[1] == "B":
    print("ARC")
else:
    print("ABC")
H,W,K=map(int,input().split())
if W==1:
    print(1)
    quit()

INF=1e9+7
dp=[[0]*W for i in range(H+1)]
dp[0][0]=1
d=W-1
a=max(0,d-1)
b=max(0,d-2)
dic={0:0,1:1,2:2,3:4,4:7,5:12,6:20}
a=dic[a]+1
b=dic[b]+1
def func(w):
    c=dic[w-1]+1
    e=dic[d-w-1]+1
    return c*e
def func1(w):
    c=dic[w-1-1]+1
    e=dic[d-w-1]+1
    return c*e
def func2(w):
    c=dic[w-1]+1
    e=dic[d-w-1-1]+1
    return c*e
for i in range(H):
    for w in range(W):
        if w==0:
            dp[i+1][w]=(dp[i][w]*a)+(dp[i][w+1]*b)
            dp[i+1][w]%=INF
        elif w==W-1:
            dp[i+1][w]=(dp[i][w]*a)+(dp[i][w-1]*b)
            dp[i+1][w]%=INF
        elif w==1 :
            dp[i+1][w]=(dp[i][w]*b)+(dp[i][w-1]*b)+(dp[i][w+1]*func2(w))
            dp[i+1][w]%=INF
        elif w==W-2:
            dp[i+1][w]=(dp[i][w]*b)+(dp[i][w-1]*func1(w))+(dp[i][w+1]*b)
            dp[i+1][w]%=INF
        else:
            dp[i+1][w]=(dp[i][w]*func(w))+(dp[i][w-1]*func1(w))+(dp[i][w+1]*func2(w))
            dp[i+1][w]%=INF

print(int(dp[H][K-1]%INF))


### FIXED CODE ###

H,W,K=map(int,input().split())
if W==1:
    print(1)
    quit()

INF=1e9+7
dp=[[0]*W for i in range(H+1)]
dp[0][0]=1
d=W-1
a=max(0,d-1)
b=max(0,d-2)
f=max(0,d-3)
dic={0:0,1:1,2:2,3:4,4:7,5:12,6:20}
a=dic[a]+1
b=dic[b]+1
f=dic[f]+1
def func(w):
    c=dic[w-1]+1
    e=dic[d-w-1]+1
    return c*e
def func1(w):
    c=dic[w-1-1]+1
    e=dic[d-w-1]+1
    return c*e
def func2(w):
    c=dic[w-1]+1
    e=dic[d-w-1-1]+1
    return c*e
for i in range(H):
    for w in range(W):
        if w==0:
            dp[i+1][w]=(dp[i][w]*a)+(dp[i][w+1]*b)
            dp[i+1][w]%=INF
        elif w==W-1:
            dp[i+1][w]=(dp[i][w]*a)+(dp[i][w-1]*b)
            dp[i+1][w]%=INF
        elif w==1 :
            dp[i+1][w]=(dp[i][w]*b)+(dp[i][w-1]*b)+(dp[i][w+1]*f)
            dp[i+1][w]%=INF
        elif w==W-2:
            dp[i+1][w]=(dp[i][w]*b)+(dp[i][w-1]*f)+(dp[i][w+1]*b)
            dp[i+1][w]%=INF
        else:
            dp[i+1][w]=(dp[i][w]*func(w))+(dp[i][w-1]*func1(w))+(dp[i][w+1]*func2(w))
            dp[i+1][w]%=INF

print(int(dp[H][K-1]%INF))
N,X = map(int,input().split())
num = 0
count = 0
listA=list(map(int,input().split()))
    #listA<-[1,2,2,3,1]
    #ここに逐次処理を書けばいいと思う。

for i in range(N+1):
    if num<=X:
        num = num+listA[i]
        count=count+1
    else:
        break
print(count)


### FIXED CODE ###

N,X = map(int,input().split())
num = 0
count = 0
listA=list(map(int,input().split()))
    #listA<-[1,2,2,3,1]
    #ここに逐次処理を書けばいいと思う。

for i in range(N+1):
    if num<=X and i==N:
        count=i+1
        break
    elif num<=X:
        num = num+listA[i]
        count=count+1
    else:
        break
print(count)
def ex2019a():
     # 入力を受け取る
    n = raw_input().split(" ")
    a = int(n[0])
    b = int(n[1])
    c = int(n[2])

    if a == b and b == c:
        print "Yes"
    else:
        print "No"

def main():
    ex2019a()
	
if __name__ == '__main__':
    main()

### FIXED CODE ###

# -*- coding: utf-8 -*-
def ex2019a():
     # 入力を受け取る
    n = raw_input().split(" ")
    a = int(n[0])
    b = int(n[1])
    c = int(n[2])

    if a == b and b == c:
        print "Yes"
    else:
        print "No"

def main():
    ex2019a()
	
if __name__ == '__main__':
    main()
x = int(input())

a = x//500
b = x-(a*500)
c = b//5
print(sum((a*1000)+(c*5)))


### FIXED CODE ###

x = int(input())

a = x//500
b = x-(a*500)
c = b//5
d = (a*1000)+(c*5)
print(d)
s = input()

if s[1]=='7':
    print('Yes')
elif s[2]=='7':
    print('Yes')
elif s[3]=='7':
    print('Yes')
else:
    print('No')

### FIXED CODE ###

s = input()

if s[0]=='7':
    print('Yes')
elif s[1]=='7':
    print('Yes')
elif s[2]=='7':
    print('Yes')
else:
    print('No')
N = int(input())
print(len(set(list(N))))

### FIXED CODE ###

N = int(input())
S = [int(input()) for _ in range(N)]

set_S = set(S)

print(len(set_S))
item = input().split()
fumidai_sum = 0

for i in range(int(item[0])):
  b = int(item[i])
  t = int(item[i + 1])
  
  if b > t:
    fumidai_sum += (b - t)
      
print(fumidai_sum)

### FIXED CODE ###

num = int(input())
item = input().split()
res = 0

for i in range(num):
  if i == 0:
    continue
  b = int(item[i - 1])
  t = int(item[i])
  
  if b > t:
    res += (b - t)
    item[i] = b
    
      
print(res)
N = int(input())
points = [tuple(map(int, input().split())) for i in range(N)]
points = [(0,0,0)] + points
for idx in range(1,N):
  time_diff = points[idx][0] - points[idx-1][0]
  x_diff = abs(points[idx][1] - points[idx-1][1])
  y_diff = abs(points[idx][2] - points[idx-1][2])
  
  if time_diff < x_diff + y_diff or (time_diff - x_diff - y_diff) % 2 == 1:
    print('No')
    exit()
    
print('Yes')

### FIXED CODE ###

A,B = map(int, input().split())
if A * B % 2 == 0:
  print('Even')
else:
  print('Odd')
A=int(input())
B=int(input())
C=int(input())
D=int(input())
E=int(input())
X=[A%10,B%10,C%10,D%10,E%10]
minimum=100
for i in range(5):
  if X[i]!=0:
    minimum=min(minimum,X[i])
Y=[A,B,C,D,E]
last=X.index(minimum)
time=0
import math
for i in range(5):
  if i!=last:
    time =time+10*math.ceil(Y[i]/10)
if X==[0,0,0,0,0]:
  print(sum(Y))
else:
  print(time+Y[last])


### FIXED CODE ###

A=int(input())
B=int(input())
C=int(input())
D=int(input())
E=int(input())
X=[A%10,B%10,C%10,D%10,E%10]
minimum=100
for i in range(5):
  if X[i]!=0:
    minimum=min(minimum,X[i])
Y=[A,B,C,D,E]
if minimum==100:
  minimum=0
last=X.index(minimum)
time=0
import math
for i in range(5):
  if i!=last:
    time =time+10*math.ceil(Y[i]/10)
if X==[0,0,0,0,0]:
  print(sum(Y))
else:
  print(time+Y[last])
from collections import deque
import copy

n = int(input())
p = list(map(int, input()))
for i in range(len(p)):
    p[i] -= 1

to_outsides = [[0 for _ in range(n)] for _ in range(n)]
not_exist = [["■" for _ in range(n)] for _ in range(n)]


for i in range(n):
    for j in range(n):
        to_outside = [i,n-1-i,j,n-1-j]
        to_outsides[i][j] = min(to_outside)

directions = [[-1,0],[1,0],[0,-1],[0,1]]

all_loss = 0
answer = 0
for i, person in enumerate(p):
    exited = [person//n, person%n]
    answer += to_outsides[exited[0]][exited[1]]
    not_exist[exited[0]][exited[1]] = "□"
    seen = []
    seen.append([exited[0],exited[1]])
    todo = deque([exited])
    renews = []
    while len(todo)>0:
        now = todo.pop()
        renews.append(now)
        for direction in directions:
            try:
                checking = [now[0]+direction[0],now[1]+direction[1]]
                to_outsides[checking[0]][checking[1]]
            except:
                continue
            if [checking[0],checking[1]] not in seen and\
            ((not_exist[checking[0]][checking[1]] == "□" and  to_outsides[checking[0]][checking[1]]==to_outsides[now[0]][now[1]])or\
            to_outsides[checking[0]][checking[1]]>to_outsides[now[0]][now[1]]):
                todo.append([checking[0],checking[1]])
                seen.append([checking[0],checking[1]])
    
    for renew in renews:
        if to_outsides[renew[0]][renew[1]] != 0:
            to_outsides[renew[0]][renew[1]]-=1
print(answer)

### FIXED CODE ###

N = int(input())
P = list(map(int, input().split()))

dp = [[min(i, N - i - 1, j, N - j - 1) for j in range(N)] for i in range(N)]

presence = [[1 for j in range(N)] for i in range(N)]

ans = 0
for i in range(len(P)):
    P[i] -= 1
    x, y = divmod(P[i], N)
    ans += dp[x][y]
    presence[x][y] = 0

    Q = [(x, y)]
    #%%
    while Q:
        x, y = Q.pop()
        new_value = dp[x][y] + presence[x][y]
        if 1 <= x and dp[x - 1][y] > new_value:
            dp[x - 1][y] = new_value
            Q.append((x - 1, y))
        if x < N - 1 and dp[x + 1][y] > new_value:
            dp[x + 1][y] = new_value
            Q.append((x + 1, y))
        if 1 <= y and dp[x][y - 1] > new_value:
            dp[x][y - 1] = new_value
            Q.append((x, y - 1))
        if y < N - 1 and dp[x][y + 1] > new_value:
            dp[x][y + 1] = new_value
            Q.append((x, y + 1))

print(ans)
s=input()
print(chr(i)) for i in range(ord("a"),ord("z")+1) if chr(i) not in s

### FIXED CODE ###

s=input()
for i in range(ord("a"),ord("z")+1):
  if chr(i) not in s:
    print(chr(i)) 
    exit()
print("None")
S=str(input())
formula=[""]*(len(S)*2-1)
ans=0
for i in range(len(S)*2-1):
    if i%2==0:
        formula[i]=S[i//2]
place=pow(2,len(S)-1)-1
for i in range(place+1):
    for j in range(len(bin(i))-2):
        #strしたbinには0bのprefixが付く。
        if int(str(bin(i))[-j-1])==1:
            formula[2*j+1]="+"
    ans+=eval(''.join(formula))
    for k in range(len(bin(i))-2):
        formula[2*j+1]=""
print(ans)

### FIXED CODE ###

S=str(input())
formula=[""]*(len(S)*2-1)
ans=0
for i in range(len(S)*2-1):
    if i%2==0:
        formula[i]=S[i//2]
place=pow(2,len(S)-1)-1
for i in range(place+1):
    for j in range(len(bin(i))-2):
        #strしたbinには0bのprefixが付く。
        if int(str(bin(i))[-j-1])==1:
            formula[2*j+1]="+"
    ans+=eval(''.join(formula))
    for k in range((len(formula)-1)//2):
        formula[2*k+1]=""
print(ans)
MOD = 10**9 + 7
N = int(input())
C = []
last_idx = [0 for i in range(N+1)]
bef = [0 for i in range(N+1)]
for i in range(1,N+1):
	c = int(input())
	C.append(c)
	bef[i] = last_idx[c]
	last_idx[c] = i
dp = [0 for i in range(N+1)]
dp[1] = 1
if N == 1 or N == 2:
	print(1)
	exit()

for i in range(2, N+1):
	if bef[i] < i-1:
		dp[i] = (dp[i-1] + dp[bef[i]]) % MOD
	else:
		dp[i] = dp[i-1]
print(dp[N])

### FIXED CODE ###

MOD = 10**9 + 7
N = int(input())
C = []
last_idx = [0 for i in range(200001)]
bef = [0 for i in range(N+1)]
for i in range(1,N+1):
	c = int(input())
	C.append(c)
	bef[i] = last_idx[c]
	last_idx[c] = i
dp = [0 for i in range(N+1)]
dp[1] = 1
if N == 1 or N == 2:
	print(1)
	exit()

for i in range(2, N+1):
	if bef[i] < i-1:
		dp[i] = (dp[i-1] + dp[bef[i]]) % MOD
	else:
		dp[i] = dp[i-1]
print(dp[N])
# A - Getting Difference
from fractions import gcd

n,k=map(int,input().split())
a=list(map(int,input().split()))
for i in range(n-1):
    if i==0:
        t=gcd(a[i],a[i+1])
        continue
    t=gcd(t,a[i+1])
if k%t!=0:
    print('IMPOSSIBLE')
    exit()

a_max=max(a)
b=a_max-k

if b<0:
    print('IMPOSSIBLE')
    exit()
elif b==0:
    print('POSSIBLE')
    exit()

even_count=0
odd_count=0

for aa in a:
    if aa%2==0:
        even_count+=1
    else:
        odd_count+=1
a.sort()
sa=[]
for i in range(n-1):
    sa.append(abs(a[i+1]-a[i]))
sa.sort()


is_even=False
is_odd=False
for ssaa in sa:
    if ssaa%2==0:
        if ssaa<=b:
            is_even=True
    else:
        if ssaa<=b:
            is_odd=True

if is_even==True and is_odd==True:
    print('POSSIBLE')
elif is_even==True and is_odd==False:
    if odd_count>0:
        print('POSSIBLE')
    else:
        print('IMPOSSIBLE')
elif is_even==False and is_odd==True:
    if even_count>0:
        print('POSSIBLE')
    else:
        print('IMPOSSIBLE')
else:
    print('IMPOSSIBLE')

### FIXED CODE ###

n,k=map(int,input().split())
a=list(map(int,input().split()))
if k>max(a):
  print("IMPOSSIBLE")
  exit(0)

from fractions import gcd
gcd_v=a[0]
for i in range(1,n):
  gcd_v=gcd(a[i],gcd_v)
for aa in a:
  if (aa-k)%gcd_v==0:
    print("POSSIBLE")
    exit(0)
print("IMPOSSIBLE")
a,*List,b=input()
print(a+len(List)+b)

### FIXED CODE ###

a,*List,b=input()
print(a+str(len(List))+b)
H,W,M=map(int, input().split())
sumh=[[_,0] for _ in range(H)]
sumw=[[_,0] for _ in range(W)]
s=[[0]*W for _ in range(H)]
for i in range(M):
  h,w=map(int, input().split())
  sumh[h-1][1]+=1
  sumw[w-1][1]+=1
  s[h-1][w-1]=1

sumh.sort(reverse=True, key=lambda x:x[1])
sumw.sort(reverse=True, key=lambda x:x[1])

maxh=sumh[0][1]
maxw=sumw[0][1]

flg=s[sumh[0][0]][sumw[0][0]]
for i in range(H):
  if sumh[i][1]<maxh:
    print(maxh+maxw-flg)
    exit()
  for j in range(W):
    if sumw[j][1]<maxw:
      j=W-1
    else:
      flg=min(flg,s[sumh[i][0]][sumw[j][0]])
#      print("###",i,j,sumh[i],sumw[j])


print(maxh+maxw-flg)

### FIXED CODE ###

H,W,M=map(int, input().split())
sumh=[0]*H
sumw=[0]*W
bomb=[]
for i in range(M):
  h,w=map(int, input().split())
  sumh[h-1]+=1
  sumw[w-1]+=1
  bomb.append((h,w))

maxh=max(sumh)
maxw=max(sumw)
ch=sumh.count(maxh)
cw=sumw.count(maxw)

cnt=0
for h,w in bomb:
  if sumh[h-1]==maxh and sumw[w-1]==maxw:
    cnt+=1

if cnt==ch*cw:
  print(maxh+maxw-1)
else:
  print(maxh+maxw)
from collections import deque
n, q = map(int, input().split())
edges = [[] for _ in range(n)]
for i in range(n-1):
    a, b = map(int, input().split())
    edges[a-1].append(b-1)
    edges[b-1].append(a-1)

counter = [0]*n
for i in range(q):
    p, x = map(int, input().split())
    counter[p-1] = x

visited = [0]*n


def dfs(parent):
    visited[parent] = 1
    for child in edges[parent]:
        if visited[child] == 1:
            continue
        else:
            counter[child] += counter[parent]
            dfs(child)


dfs(0)
print(*counter)

### FIXED CODE ###

import sys
input = sys.stdin.readline
sys.setrecursionlimit(100000000)
n, q = map(int, input().split())
edges = [[] for _ in range(n)]
for i in range(n-1):
    a, b = map(int, input().split())
    edges[a-1].append(b-1)
    edges[b-1].append(a-1)

counter = [0]*n
for i in range(q):
    p, x = map(int, input().split())
    counter[p-1] += x
visited = [0]*n


def dfs(parent):
    visited[parent] = 1
    for c in edges[parent]:
        if visited[c] == 1:
            continue
        else:
            counter[c] += counter[parent]
            dfs(c)


dfs(0)
print(*counter)
a,b,c=map(int,input().split())
d=0
for i in range(a,b+1):
    if c%i==0:
        d+=1

### FIXED CODE ###

a,b,c=map(int,raw_input().split())
d=0
for i in range(a,b+1):
    if c%i==0:
        d+=1
print(str(d))
N = input(int())
ans = 1
i = []

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

for a in range(N-1):
  ans = ans * i[a]

  if ans > 10**18:
    ans = -1

print(ans)

### FIXED CODE ###

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

ans = 1

if 0 in a:
    print("0")
    exit()

for i in a:
    ans *= i

    if ans > 10**18:
        print("-1")
        exit()
        
print(ans)
n,k = map(int,input().split())
nn = [0]*n
for _ in range(k):
    d = int(input())
    a = [int(i) for i in input().split()]
    for	j in a:
	nn[j-1]	+= 1
c=0
for i in nn:
   if i==0:
       c+=1
print(c)

### FIXED CODE ###

n,k = map(int,input().split())
nn = [0]*n
for _ in range(k):
    d = int(input())
    a = [int(i) for i in input().split()]
    for j in a:
        nn[j-1] += 1
c=0
for i in nn:
   if i==0:
       c+=1
print(c)