input: print(((eval(input().replace(*' *'))%3%2*'Imp'or'P')+'ossible'))


input:
n = int(input())

for i in range(n,0,-1):

    if i**0.5 == int(i**0.5):

        ans = i

        break

print(ans)


input:
N,W=list(map(int,input().split()))

I=[[*list(map(int,input().split()))]for _ in[0]*N]

C=[0]*-~W

for i in range(1,N+1):

 v,w=I[~-i]

 for j in range(W,w-1,-1):

  t=v+C[j-w]

  if t>C[j]:C[j]=t

print((C[W]))


input:
D,G = list(map(int,input().split()))

P = []

num_p = 0

for i in range(1,D+1):

    p,c = list(map(int,input().split()))

    num_p += p

    for j in range(1,p+1):

        P += [(j,i*100*j+c*(j==p))]

dp = [0]*(num_p+1)

for k,pt in P:

    if k==1:

        t_dp = dp[:]

    for cur in range(1,num_p+1):

        if cur>=k:

            dp[cur] = max(dp[cur], t_dp[cur-k]+pt)

for i in range(num_p+1):

    if dp[i]>=G:

        print(i)

        break


input:
import math

from functools import reduce

def gcd(*numbers):

    return reduce(math.gcd, numbers)

K=int(input())

ans=[]

for i in range(1,K+1):

    for j in range(1,K+1):

        for k in range(1,K+1):

            ans.append(gcd(i,j,k))

print((sum(ans)))


input:
N = int(input())

S = input()

r = 0

ans = 0

for i in range(N):

    while True:

        if S.rfind(S[i : r + 1]) >= r + 1:

            r += 1

            ans = max(ans, r - i)

        else:

            break

print(ans)


input:
S = input().strip()

T = input().strip()

k = len(T)

dmin = len(S)

for i in range(len(S)-k+1):

    cnt = 0

    for j in range(k):

        if S[i+j]!=T[j]:

            cnt += 1

    dmin = min(dmin,cnt)

print(dmin)


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

s = input()

A = 0

B = 0

for i in s:

    if A + B < a + b:

        if i == "a":

            A += 1

            print("Yes")

        elif i == "b" and B < b:

            B += 1

            print("Yes")

        else:

            print("No")

    else:

        print("No")


input:
N, K = list(map(int,input().split()))

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

dp = [float("inf")] * N

dp[0] = 0

dp[1] = abs(h[1] - h[0])

for i in range(2,N):

    for j in range(1,K+1):

        dp[i] = min(dp[i],dp[i-j] + abs(h[i] - h[i-j]))

print((dp[-1]))


input:
N=int(input())

n=1

while(2*n<=N):

    n*=2

print(n)


input:
MOD=10**9+7

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

a=(2*x-y)//3

b=(2*y-x)//3

if 2*a+b!=x:

    print((0))

    exit()

factorial = [1]

inverse = [1]

n=a+b

r=a

for i in range(1, n+2):

    factorial.append(factorial[-1] * i % MOD)

    inverse.append(pow(factorial[-1], MOD - 2, MOD))

def combi(n, r):

    if n < r or r < 0:

        return 0

    elif r == 0:

        return 1

    return factorial[n] * inverse[r] * inverse[n - r] % MOD

ans = combi(n,r)

print(ans)


input:
n=int(input())

for i in range(int((n**0.5+1)//1),0,-1):

  if n/i%1==0:

    f=max(len(str(i)),len(str(n//i)))

    break

print(f)


input:
def gcd(a,b):

  if b==0:

    return a

  else:

    return gcd(b,a%b)

N=int(input())

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

g=A[0]

for i in range(1,N):

  g=gcd(g,A[i])

print(g)


input:
def nbasesum(value,n):

    nbasevalue = 0

    while value > 0:

        nbasevalue += value%n

        value //= n

    return nbasevalue

N = int(input())

ans = nbasesum(N,9)

for i in range(N+1):

    c6 = i

    c9 = N-i

    ans = min(ans, nbasesum(c9,9)+nbasesum(c6,6))

print(ans)


input:
from collections import Counter

n=int(input())

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

if d[0]!=0:

    print((0))

    exit()

c=Counter(d)

c=sorted(list(c.items()),key=lambda x:x[0])

if c[0]!=(0,1):

    print((0))

    exit()

ans=1

check=1

for i in range(1,len(c)):

    if c[i][0]!=check:

        print((0))

        exit()

    check+=1

    ans*=c[i-1][1]**c[i][1]

    ans%=998244353

print((ans%998244353))


input:
ab,bc,ca = (int(i) for i in input().split())

print((ab*bc//2))


input:
X = int(input())

for i in range(1,X+1):

  if((i*(i+1))/2 >= X):

    print(i)

    break


input:
n = int(input())

print(((n+1) &- (n+1)))


input:
import sys

from math import log, floor

n = int(sys.stdin.readline().rstrip())

def main():

    cand = set()

    for i in range(floor(log(n, 6)) + 1):

        if 6 ** i <= n:

            cand.add(6 ** i)

        if 9 ** i <= n:

            cand.add(9 ** i)

    cand = sorted(cand)

    res = set([0])

    cnt = 0

    while True:

        nex = set()

        for val in res:

            for c in cand:

                if val + c <= n:

                    nex.add(val + c)

                else:

                    break

        cnt += 1

        if n in nex:

            return cnt

        res = nex

if __name__ == '__main__':

    ans = main()

    print(ans)


input:
x=int(input())

a=set()

for i in range(1,1001):

  for j in range(2,34):

    t=i**j

    if t<=x:

      a.add(i**j)

a=list(a)

a.sort()

print((a[-1]))


input:
# ABC073D - joisino's travel (218ms)

from heapq import heapify, heappop, heappush

from itertools import permutations

def dijkstra(G: "Array[Array[int]]", size: int, start: int) -> list:

    dist = [float("inf")] * size

    queue = [(0, start)]

    heapify(queue)

    while queue:

        cost, v = heappop(queue)

        if cost > dist[v]:

            continue

        dist[v] = cost

        for next_cost, u in G[v]:

            if cost + next_cost < dist[u]:

                heappush(queue, (cost + next_cost, u))

    return dist

def main():

    global G, N

    N, M, R, *RABC = list(map(int, open(0).read().split()))

    visit, ABC = RABC[:R], RABC[R:]

    G = [[] for _ in range(N + 1)]

    for v, u, cost in zip(*[iter(ABC)] * 3):

        G[v].append((cost, u)), G[u].append((cost, v))

    dist = {v: dijkstra(G, N + 1, v) for v in visit}

    ans = float("inf")

    for perm in permutations(visit):

        cur = sum(dist[v][u] for v, u in zip(perm, perm[1:]))

        ans = min(ans, cur)

    print(ans)

if __name__ == "__main__":

    main()


input:
import math

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

P = []

for k in range(1,math.floor(math.sqrt(M))+1):

    if M % k == 0:

        P.append(k)

        P.append(M//k)

ans = 1

for e in P:

    if e*N <= M:

        ans = max(ans,e)

print(ans)


input:
N = int(input())

sub = 0

count = 1

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

if N > 1:

	pre_num = A[1]

	pre_sub = A[1] - A[0]

for num in A[2:]:

    if not pre_num == num:

        if pre_sub * (num - pre_num) < 0:

            count += 1

            pre_sub = 0

        else:

          	pre_sub = num - pre_num

        pre_num = num

print(count)


input:
def main():

    a, b, c, x, y = (int(i) for i in input().split())

    ans = a*x + b*y

    ans = min(ans, 2*c*max(x, y))

    if x < y:

        d = y - x

        d *= b

    else:

        d = x - y

        d *= a

    ans = min(ans, 2*c*min(x, y)+d)

    print(ans)

if __name__ == '__main__':

    main()


input:
import sys

import math

import time

sys.setrecursionlimit(int(1e6))

if False:

    dprint = print

else:

    def dprint(*args):

        pass

k = list(map(int, input().split()))[0]

am = 7 % k

i = 1

for i in range(k):

    if am==0:

        print(i+1)

        exit()

    else:

        i+=1

        am=(am*10+7)%k

print('-1')


input:
N=int(input())

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

a2list=[0]+alist+[0]

#print(a2list)

alldist=0

for i in range(1,N+2):

  alldist+=abs(a2list[i]-a2list[i-1])

#print(alldist)

for i in range(N):

  if a2list[i+1]-a2list[i]>=0 and a2list[i+2]-a2list[i+1]>=0:

    print(alldist)

  elif a2list[i+1]-a2list[i]<=0 and a2list[i+2]-a2list[i+1]<=0:

    print(alldist)

  else:

    dist=alldist-abs(a2list[i+1]-a2list[i])-abs(a2list[i+2]-a2list[i+1])+abs(a2list[i+2]-a2list[i])

    print(dist)


input:
n = int(input())

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

ans = 0

if n%2==1:

    dummy = [0]

    for i in range(1, 1+(len(a)-1)//2):

        dummy.append(2*i)

        dummy.append(2*i)

    if sorted(a) == dummy:

        ans = 2**((len(a)-1)//2)

else:

    dummy = []

    for i in range(1,  1+(len(a))//2):

        dummy.append(2*i - 1)

        dummy.append(2*i - 1)

    if sorted(a) == dummy:

        ans = 2**((len(a))//2)

print((ans%(10**9 + 7)))


input:
from itertools import combinations

n = int(input())

s = [input() for _ in range(n)]

s.sort()

march = [0, 0, 0, 0, 0]

st = ['M', 'A', 'R', 'C', 'H']

for i in range(n):

    for j in range(5):

        if s[i][0] == st[j]:

            march[j] += 1

#print(march)

if sum(march) == 0:

    print((0))

    exit()

ans = 0

a = list(combinations(list(range(5)), 3))

for i in range(len(a)):

    tmp = 1

    for j in a[i]:

        tmp *= march[j]

    ans += tmp

print(ans)


input:
n, k = list(map(int, input().split()))

mod = 10 ** 9 + 7

ans = 0

for t in range(k, n+2):

    mini = t * (t-1) // 2 % mod

    residue = n - t + 1

    maxim = mini + t * residue

    maxim %= mod

    count = maxim - mini + 1

    count %= mod

    ans += count

    ans %= mod

print(ans)


input:
N = int(input())

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

A.insert(0, 0)

A.append(0)

a = 0

cost = 0

for i in A:

    b = i

    cost += abs(a-b)

    a = b

cost += abs(A[-1])

ori = cost

for i in range(1, len(A)-1):

    cost += abs(A[i-1]-A[i+1])

    cost -= abs(A[i-1]-A[i])+abs(A[i+1]-A[i])

    print(cost)

    cost  = ori


input:
N = int(input())

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

ans = 0

for i in range(N):

  ans += A[i] - 1

print(ans)


input:
import sys

cand = [7, 5, 3]

x = int(sys.stdin.readline().rstrip())

def main():

    return 'YES' if x in cand else 'NO'

if __name__ == '__main__':

    ans = main()

    print(ans)


input:
# ABC073D - joisino's travel (210ms)

from heapq import heapify, heappop, heappush

from itertools import permutations

def dijkstra(source: int) -> list:

    dist = [float("inf")] * (N + 1)

    undetermined = N  # vertex_0 won't appear in 1-idx graph

    queue = [(0, source)]

    heapify(queue)

    while queue:

        cost, v = heappop(queue)

        if cost > dist[v]:

            continue

        dist[v] = cost

        for next_cost, u in G[v]:

            if cost + next_cost < dist[u]:

                heappush(queue, (cost + next_cost, u))

        undetermined -= 1

        if not undetermined:

            return dist

def main():

    global G, N

    N, M, R, *RABC = list(map(int, open(0).read().split()))

    visit, ABC = RABC[:R], RABC[R:]

    G = [[] for _ in range(N + 1)]

    for v, u, cost in zip(*[iter(ABC)] * 3):

        G[v].append((cost, u)), G[u].append((cost, v))

    dist = {v: dijkstra(v) for v in visit}

    ans = float("inf")

    for perm in permutations(visit):

        cur = sum(dist[v][u] for v, u in zip(perm, perm[1:]))

        ans = min(ans, cur)

    print(ans)

if __name__ == "__main__":

    main()


input:
n=int(input())

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

c_list=[]

for i in list:

    count=0

    while True:

        if i%2==0:

            i=i/2

            count+=1

        else:

            break

    c_list.append(count)

print((min(c_list)))


input:
n=int(input())

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

print(((n+min(l)-1)//min(l)+4))


input:
N = int(input())

li = []

for _ in range(N):

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

    li.append([b,a,b])

flag = True

now = 0

li = sorted(li)

for a, b, c in li:

    now += b

    if now > c:

        print("No")

        flag = False

        break

if flag:

    print("Yes")


input:
s = input()

t = input()

for _ in range(len(s)):

    s = s[-1]+s[:-1]

    #print(s)

    if s == t:

        print("Yes")

        exit()

print("No")


input:
from collections import defaultdict

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

s = []

for _ in range(n):

    k, *a = list(map(int, input().split()))

    s.append(a)

dd = defaultdict(int)

for l in s:

    for k in l:

        dd[k] += 1

print((sum(1 if v == n else 0 for k, v in list(dd.items()))))


input:
h, n = list(map(int, input().split()))

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

sum = 0

for i in range(n):

	sum += a[i]

print(("Yes" if h <= sum else "No"))


input:
a=int(input())

s=input()

if a>=3200:

  print(s)

else:

  print('red')


input:
N = int(input())

print(((N - 1) // 2))


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

s = input()

tuka = 0

br = 0

for i in range(n):

    if s[i] == 'a':

        if tuka < a+b:

            print('Yes')

            tuka += 1

        else:

            print('No')

    elif s[i] == 'b':

        if tuka < a+b and br < b:

            print('Yes')

            tuka += 1

            br += 1

        else:

            print('No')

            br += 1

    else:

        print('No')


input:
from itertools import accumulate

from collections import Counter

n = int(input())

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

L = [0] + list(accumulate(A))

C = Counter(L)

ans = 0

for i in list(C.values()):

  ans += i*(i-1)//2

print(ans)


input:
S = input()

A = []

ans = 0

for i in range(len(S)):

    if i % 2 == 0:

        A.append(1)

    else:

        A.append(0)

for i in range(len(S)):

    if int(S[i]) != int(A[i]):

        ans += 1

print((min(ans, len(S) - ans)))


input:
import sys

stdin = sys.stdin

sys.setrecursionlimit(10**5)

def li(): return list(map(int, stdin.readline().split()))

def li_(): return [int(x)-1 for x in stdin.readline().split()]

def lf(): return list(map(float, stdin.readline().split()))

def ls(): return stdin.readline().split()

def ns(): return stdin.readline().rstrip()

def lc(): return list(ns())

def ni(): return int(stdin.readline())

def nf(): return float(stdin.readline())

from itertools import accumulate

n,k = li()

a = list(li())

a_cum = [0] + list(accumulate(a))

sm_lst = []

for i in range(n+1):

    for j in range(i+1,n+1):

        sm_lst.append(a_cum[j] - a_cum[i])

pop = sm_lst

ans = 0

for bit in range(40,-1,-1):

    yes=[]

    no=[]

    for s in pop:

        if s & (1<<bit):

            yes.append(s)

        else:

            no.append(s)

    if len(yes) >= k:

        ans += (1<<bit)

        pop = yes

print(ans)


input:
class SWAG():

    __slots__=('unit','f','fold_r','fold_l','data_r','data_l')

    def __init__(self,unit,f,data):

        self.unit=unit

        self.f=f

        self.fold_r=[unit]

        self.fold_l=[unit]

        self.data_r=[]

        self.data_l=[]

        sep=len(data)//2

        for t in data[sep:]:

            self.append(t)

        for t in data[sep-1::-1]:

            self.appendleft(t)

    def append(self,x):

        self.fold_r.append(self.f(self.fold_r[-1],x))

        self.data_r.append(x)

    def appendleft(self,x):

        self.fold_l.append(self.f(self.fold_l[-1],x))

        self.data_l.append(x)

    def pop(self):

        if not self.data_r:

            self.__init__(self.unit,self.f,self.data_l[::-1])

        self.fold_r.pop()

        return self.data_r.pop()

    def popleft(self):

        if not self.data_l:

            self.__init__(self.unit,self.f,self.data_r)

        self.fold_l.pop()

        return self.data_l.pop()

    def fold_all(self):

        return self.f(self.fold_r[-1],self.fold_l[-1])

n,k,*p=list(map(int,open(0).read().split()))

c=[0]

for a,b in zip(p,p[1:]):c+=c[-1]+(a<b),

*c,f=[b-a==k-1for a,b in zip(c,c[k-1:])]

x=not f

s_min=SWAG(10**18,min,p[:k-1])

s_max=SWAG(0,max,p[1:k])

for i,(a,b,c)in enumerate(zip(p,p[k:],c)):

    f|=c

    s_min.append(p[i+k-1])

    s_max.append(b)

    if not c and(a!=s_min.fold_all()or b!=s_max.fold_all()):x+=1

    s_min.popleft()

    s_max.popleft()

print((x+f))


input:
import sys

read = sys.stdin.read

readline = sys.stdin.readline

readlines = sys.stdin.readlines

def main():

    N = int(readline())

    S = readline().strip()

    ans = 0

    for p in range(1000):

        pattern = str(p).zfill(3)

        key = 0

        cnt = 0

        for n in pattern:

            for i in range(key,N):

                if S[i] == n:

                    key = i+1

                    cnt += 1

                    break

        if cnt == 3:

            ans += 1

    print(ans)

if __name__ == "__main__":

    main()


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

A=sorted(list(map(int,input().split())))

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

C=sorted(list(map(int,input().split())))

def countA(target,L):

  ok=-1

  ng=len(L)

  while abs(ok-ng)>1:

    mid=(ok+ng)//2

    if L[mid]<target:

      ok=mid

    else:

      ng=mid

  return (ok+1)

def countC(target,L):

  ok=len(L)

  ng=-1

  while abs(ok-ng)>1:

    mid=(ok+ng)//2

    if L[mid]>target:

      ok=mid

    else:

      ng=mid

  return len(L)-ok

ans=0

for i in range(len(B)):

  data=B[i]

  ans+=(countA(data,A)*countC(data,C))

print(ans)


input:
n, *a = list(map(int, open(0).read().split()))

print(("YNEOS"[len(set(a))!=len(a)::2]))


input:
import sys

sys.setrecursionlimit(10 ** 7)

f_inf = float('inf')

mod = 10 ** 9 + 7

def resolve():

    k, a, b = list(map(int, input().split()))

    if b - a < 2:

        print((k + 1))

    else:

        n = k - a + 1

        res = a + n // 2 * (b - a)

        res += 1 if n % 2 != 0 else 0

        print(res)

if __name__ == '__main__':

    resolve()


input:
from sys import stdin

import sys

A, B, N = [int(x) for x in stdin.readline().rstrip().split()]

# N, M = [int(x) for x in stdin.readline().rstrip().split()]

# U = input().split()

ans = int((A*N)/B)-A*int(N/B)

ans2=0

if B-1<N:

	ans = int((A*(B-1))/B)-A*int((B-1)/B)

else:

  	ans2=0

print(ans)


input:
import sys

import math

input = sys.stdin.readline

K = int(input())

ans = 0

for i in range(1, K + 1):

    for j in range(i, K + 1):

        n = math.gcd(i, j)

        for l in range(j, K + 1):

            if len(set([i, j, l])) == 1:

                ans += math.gcd(n, l)

            elif len(set([i, j, l])) == 2:

                ans += (math.gcd(n, l) * 3)

            else:

                ans += (math.gcd(n, l) * 6)

print(ans)


input:
import sys

def main():

    input = sys.stdin.readline

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

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

    T=[int(input()) for _ in range(B)]

    X=[int(input()) for _ in range(Q)]

    from bisect import bisect_left

    INF=10**11

    S=[-INF] + S + [INF]

    T=[-INF] + T + [INF]

    for x in X:

        sr = bisect_left(S, x)

        tr = bisect_left(T, x)

        sl,tl=sr-1,tr-1

        ans=INF

        ans = min(ans, abs(S[sl]-T[tl]) + min(abs(S[sl]-x), abs(T[tl]-x)))

        ans = min(ans, abs(S[sl]-T[tr]) + min(abs(S[sl]-x), abs(T[tr]-x)))

        ans = min(ans, abs(S[sr]-T[tl]) + min(abs(S[sr]-x), abs(T[tl]-x)))

        ans = min(ans, abs(S[sr]-T[tr]) + min(abs(S[sr]-x), abs(T[tr]-x)))

        print(ans)

if __name__ == '__main__':

    main()


input:
from heapq import heappush, heappop, heapify

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

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

# N jewels in dequeue D

# at most K operations

# 1 <= N <= 50

# 1 <= K <= 100

# -10000000 <= Vi <= 10000000

# Operation A, B: Remove left or right

# Operation C, D: Add to left or right

S = 0

for take in range(min(N, K) + 1):

    for takeL in range(take + 1):

        for takeR in range(take - takeL + 1):

            hand = []

            for i in range(takeL):

                heappush(hand, V[i])

            for i in range(takeR):

                if N - i - 1 < takeL:

                    break

                heappush(hand, V[N- i - 1])

            S = max(sum(hand), S)

            for _ in range(K - take):

                if not hand or hand[0] >= 0:

                    break

                heappop(hand)

                S = max(sum(hand), S)

print(S)


input:
N = int(input())

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

A.sort()

ans = 1

max_limit = 10 ** 18

for i in range(N):

  ans *= A[i]

  if ans > max_limit:

    ans = -1

    break

if ans > max_limit:

  print((str(-1)))

else:

  print((str(ans)))


input:
import itertools

s = input()

n = len(s)

ans=0

for op in itertools.product(["+",""],repeat=n-1):

  tmp=""

  for i in range(n-1):

    tmp+=s[i]+op[i]

  ans+=eval(tmp+s[-1])

print(ans)


input:
List = []

N, M = (int(x) for x in input().split())

for i in range(N):

    a, b = (int(x) for x in input().split())

    List.append([a, b])

num_of_drink, total_fee = 0, 0

List = sorted(List, key=lambda x:x[0])

temp_M = M

list_of_num = []

for i in range(N):

    if temp_M <= List[i][1]:

        list_of_num.append(temp_M)

        break

    else:

        list_of_num.append(List[i][1])

        temp_M += -List[i][1]

index = 0

for x in list_of_num:

    total_fee += List[index][0] * x

    index += 1

print(total_fee)


input:
s = str(input())

l = []

for i in range(0,len(s),2):

    l.append(s[i])

print(("".join(l)))


input:
# AGC112 D - Partition

from math import floor

def divisor(n):

    i = 1

    table = []

    while i * i <= n:

        if n%i == 0:

            table.append(i)

            table.append(n//i)

        i += 1

    table = list(set(table))

    return table

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

n_max=floor(m/n)

div_m=divisor(m)

div_m.sort(reverse=True)

ans=0

for i in div_m:

    if i<=n_max:

        print(i)

        exit()


input:
def main():

    import sys

    A,B,C=list(map(int,sys.stdin.readline().split()))

    K=int(sys.stdin.readline())

    for i in range(K+1):

        if B<=A:

            B*=2

        elif C<=B:

            C*=2

        else:

            print('Yes')

            return

    print('No')

main()


input:
from collections import Counter

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

dic = Counter(list(map(int,input().split())))

x = len(dic) - k

lis = sorted(list(dic.items()), key = lambda z:z[1])

ans = 0

for i in range(x):

    ans += lis[i][1]

print(ans)


input:
import heapq

n,m = list(map(int, input().split(' ')))

# I am given n pieces

if n >= m:

	print(0)

else:

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

	xis.sort()

	distances = [v- u for u,v in zip(xis,xis[1:])]

	distances.sort(key = lambda x:-x)

	print(sum(distances[n-1:] or [0]))


input:
from math import gcd

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

print((gcd(x, y)))


input:
input = open(0).read

S, T = input().split()

def main():

    C1 = [None] * (ord('z') - ord('a') + 1)

    C2 = [None] * (ord('z') - ord('a') + 1)

    flg = True

    for i in range(len(S)):

        c1 = ord(S[i]) - ord('a')

        c2 = ord(T[i]) - ord('a')

        if C1[c1] or C2[c2]:

            if c1 != C2[c2] or c2 != C1[c1]:

                flg = False

                break

        C1[c1] = c2

        C2[c2] = c1

    print(("Yes" if flg else "No"))

    return

main()


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

A = [list(map(int, input().split())) for _ in range(N)]

K = []

for i in range(N):

    K.append(A[i][0])

    del A[i][0]

ans = A[0]

for i in range(N-1):

    ans = set(ans) & set(A[i+1])

print((len(ans)))


input:
s = list(input())

ans = 0

for i in range(1, len(s)):

    if s[i-1] == s[i]:

        ans += 1

        s[i] = "1" if s[i-1] == "0" else "0"

print(ans)


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

print((sum(i for i in range(1, N+1) if A <= sum(int(c) for c in str(i)) <= B)))


input:
n, m = list(map(int,input().split()))

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

x.sort()

dis = []

if n >= m:

    print((0))

else:

    for i in range(m-1):

        dis.append(abs(x[i+1]-x[i]))

    dis.sort(reverse=True)

    for i in range(n-1):

        dis.pop(0)

    ans = sum(dis)

    print(ans)


input:
K = int(input())

V = [1, 2, 3, 4, 5, 6, 7, 8, 9]

for i in range (0, 100000):

	if V[i]%10 == 0:

		V.append(10*V[i]+0)

		V.append(10*V[i]+1)

	elif V[i]%10 == 9:

		V.append(10*V[i]+8)

		V.append(10*V[i]+9)

	else:

		V.append(10*V[i]+V[i]%10-1)

		V.append(10*V[i]+V[i]%10)

		V.append(10*V[i]+V[i]%10+1)

print((V[K-1]))


input:
#!/usr/bin/env python3

import sys, math, itertools, collections, bisect

input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')

inf = float('inf') ;mod = 10**9+7

mans = inf ;ans = 0 ;count = 0 ;pro = 1

s=input()

C=collections.Counter(s)

if ((C["N"] or C["S"]) and C["N"]*C["S"] == 0):

  print("No")

elif ((C["W"] or C["E"]) and C["W"]*C["E"] == 0):

  print("No")

else:

  print("Yes")


input:
n, k = list(map(int, input().split()))

mod = 10 ** 9 + 7

cnt = [0] * (k + 1)

for i in range(k, 0, -1):

    c = pow(k // i, n, mod)

    for j in range(2, k + 1):

        if i * j > k:

            break

        c -= cnt[i * j]

        c %= mod

    cnt[i] = c

ans = 0

for i in range(1, k + 1):

    ans += i * cnt[i]

    ans %= mod

print(ans)


input:
# coding: utf-8

n=int(input())

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

B=[0]*n

l=n//2

if n%2==0:

    for i in range(n):

        if i%2==0:

            B[l+i]=str(A[i])

            l=l+i

        else:

            B[l-i]=str(A[i])

            l=l-i

else:

    for i in range(n):

        if i%2==0:

            B[l-i]=str(A[i])

            l=l-i

        else:

            B[l+i]=str(A[i])

            l=l+i

print((' '.join(B)))


input:
import itertools

n = int(input())

data = {}

for x in range(n):

    data[x] = []

    for y in range(int(input())):

        k, l = list(map(int, input().split()))

        data[x].append((k - 1, l))

ans = 0

for i in itertools.product([1,0], repeat=n):

    h = True

    for x in range(n):

        if i[x] == 1:

            for g in data[x]:

                if i[g[0]] != g[1]:

                    h = False

        if h == False:

            break

    if h == True:

        ans = max(ans, sum(list(i)))

print(ans)


input:
from operator import itemgetter

def main():

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

  ab = [tuple(map(int, input().split())) for _ in range(M)]

  ab.sort(key=itemgetter(1))

  east_island = ab[0][1]

  answer = 1

  for i, j in ab:

      if i >= east_island:

          answer += 1

          east_island = j

  print(answer)

if __name__ == '__main__':

    main()


input:
ab,bc,ca=input().split()

ab,bc,ca=int(ab),int(bc),int(ca)

print((ab*bc//2))


input:
N = int(input())

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

dp = [0]*N

for i, x in enumerate(H):

  if i == 0:

    continue

  elif i == 1:

    dp[i] = abs(H[i]-H[i-1])

  else:

    dp[i] = min( dp[i-2] + abs(H[i] - H[i-2]) , dp[i-1] + abs( H[i] - H[i-1] ))

print((dp[-1]))


input:
N, W = list(map(int, input().split()))

Bs = []

for i in range(N):

    Bs.append(tuple(map(int, input().split())))

dp = [[0 for _ in range(W + 1)] for _ in range(N + 1)]

for i in range(N - 1, -1, -1):

    for j in range(W + 1):

        dp[i][j] = max(dp[i + 1][j], (dp[i + 1][j - Bs[i][0]] + Bs[i][1]) if j >= Bs[i][0] else 0)

print((dp[0][W]))


input:
import sys

sys.setrecursionlimit(10**6)

n = int(input())

d = {(i-97+1):chr(i) for i in range(97,97+26)}

d[0] = 'z'

l = []

while n > 0:

    tmp = n%26

    l.append(tmp)

    if tmp == 0:

        n = n//26-1

    else:

        n //= 26

ans = ''

for i in l[::-1]:

    ans += d[i]

print(ans)


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

List=[]

for i in range(b):

  p,q=list(map(int,input().split()))

  List.append([p,q])

List=sorted(List,key=lambda x:x[1])

ans=0

l=1

for i in range(b):

  if List[i][0]>=l:

    ans+=1

    l=List[i][1]

print(ans)


input:
import sys

readline = sys.stdin.readline

N = int(readline())

X = list(map(int, readline().split()))

X.sort()

INF = 10**9+7

ans = INF

for p in range(0, 102):

    res = 0

    for x in X:

        res += (p-x)**2

    ans = min(ans, res)

print(ans)


input:
import math

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

for n in range(1, 20000):

  if math.floor(n*0.08) == a and math.floor(n*0.1) == b:

    break

if n != 19999:

  print(n)

else:

  print((-1))


input:
n=int(input())

idx=[]

c=0

for i in range(n):

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

	if x==y:

		idx.append(c)

	c+=1

if len(idx)<3:

	print('No')

else:

	flag=False

	#print(idx)

	for i in range(len(idx)-2):

		if idx[i]-idx[i+1]==-1 and idx[i+1]-idx[i+2]==-1:

			flag=True

			break

	dd={False:'No',True:'Yes'}

	print((dd[flag]))


input:
X, Y, Z, K = list(map(int, input().split()))

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

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

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

AB = []

for i in range(X):

    for j in range(Y):

        AB.append(A[i] + B[j])

AB.sort(reverse=True)

ABC = []

for i in range(min(K, len(AB))):

    for j in range(Z):

        ABC.append(AB[i] + C[j])

ABC.sort(reverse=True)

for i in range(K):

    print((ABC[i]))


input:
def resolve():

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

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

    bot = sorted(vote)

    print(("Yes" if bot[M*-1] >= sum(vote)/(4*M) else "No"))

resolve()


input:
from copy import deepcopy

N = int(input())

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

for i in range(N, 0, -1):

    if a0[i - 1] < 0:

        tmp = 0

        b = []

        for j in range(1, 101):

            if i * j - 1 >= N:

                break

            tmp += a0[i * j - 1]

            b.append(i * j - 1)

        if tmp < 0:

            for j in b:

                a0[j] = 0

for k1 in range(N, 0, -1):

    for k2 in range(k1-1, 0, -1):

        a = deepcopy(a0)

        for j in range(1, 101):

            if k1*j-1 >= N:

                break

            a[k1*j-1] = 0

        for j in range(1, 101):

            if k2*j-1 >= N:

                break

            a[k2*j-1] = 0

        for i in range(N, 0, -1):

            if a[i - 1] < 0:

                tmp = 0

                b = []

                for j in range(1, 101):

                    if i * j - 1 >= N:

                        break

                    tmp += a[i * j - 1]

                    b.append(i * j - 1)

                if tmp < 0:

                    for j in b:

                        a[j] = 0

        for i in range(N, 0, -1):

            if a0[i - 1] < 0:

                tmp = 0

                b = []

                for j in range(1, 101):

                    if i * j - 1 >= N:

                        break

                    tmp += a0[i * j - 1]

                    b.append(i * j - 1)

                if tmp < 0:

                    for j in b:

                        a0[j] = 0

        if sum(a) > sum(a0):

            a0 = a

print((sum(a0)))


input:
s = str(input())

q = int(input())

front_s = ''

back_s = ''

rev_flg = False

for i in range(q):

    query = list(map(str, input().split()))

    if query[0] == '1':

        rev_flg = not rev_flg

    else:

        if not rev_flg:

            if query[1] == '1':

                front_s += query[2]

            else:

                back_s += query[2]

        else:

            if query[1] == '1':

                back_s += query[2]

            else:

                front_s += query[2]

res = front_s[::-1] + s + back_s

if rev_flg: res = res[::-1]

print(res)


input:
x = int(input())

print((x ** 3))


input:
import sys

import bisect

inf = float('inf')

def solve():

    n = int(input())

    A = [int(input()) for i in range(n)]

    dp = [inf] * n

    max_ = 1

    for a in A:

        j = bisect.bisect_left(dp, a, lo=0, hi=max_)

        max_ = max(max_, j + 1)

        dp[j] = a

    # print(dp)

    ans = max_

    print(ans)

def debug(x, table):

    for name, val in table.items():

        if x is val:

            print('DEBUG:{} -> {}'.format(name, val), file=sys.stderr)

            return None

if __name__ == '__main__':

    solve()


input:
n=int(input())

if n%9==0:

    print("Yes")

else:

    print("No")


input:
N, *H = list(map(int, open(0).read().split()))

diff = [H[i + 1] - H[i] <= 0 for i in range(N - 1)]

ans = 0

tmp = 0

for v in diff:

    if v:

        tmp += 1

    else:

        ans = max(ans, tmp)

        tmp = 0

print((max(ans, tmp)))


input:
def main():

    N = int(input())

    S = input()

    ec = S.count('E')

    tec = ec

    for k in S:

        if k == 'E':

            tec -= 1

        else:

            tec += 1

        ec = min(ec, tec)

    print(ec)

if __name__ == '__main__':

    main()


input:
Sunuke, A ,B = list(map(int,input().split()))

if abs(Sunuke-A) < abs(Sunuke-B):

    print("A")

else:

    print("B")


input:
# @author

import sys

class PIndependentSet:

    def solve(self):

        from collections import defaultdict

        import sys

        sys.setrecursionlimit(10 ** 5 + 5)

        MOD = 10 ** 9 + 7

        def dfs(s):

            done[s] = 1

            dp[s][0] = 1

            dp[s][1] = 1

            for x in adj[s]:

                if done[x]:

                    continue

                dfs(x)

                dp[s][0] = (dp[s][0] * dp[x][1]) % MOD

                dp[s][1] = (dp[s][1] * (dp[x][0] + dp[x][1])) % MOD

        n = int(input())

        adj = defaultdict(list)

        for i in range(n - 1):

            x, y = [int(_) for _ in input().split()]

            x -= 1

            y -= 1

            adj[x].append(y)

            adj[y].append(x)

        dp = [[0, 0] for _ in range(n)]

        done = [0] * n

        dfs(0)

        print(((dp[0][0] + dp[0][1]) % MOD))

solver = PIndependentSet()

input = sys.stdin.readline

solver.solve()


input:
def main():

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

    v = 0

    if K <= A:

        return K

    elif K <= A+B:

        return A

    else:

        return A - (K-A-B)

if __name__ == '__main__':

    print((main()))


input:
def add_list(buf, new_lists, removals):

    l = len(buf)

    if l >= k:

        sbf = sorted(buf)

        removals.extend(sbf[:l - k + 1])

        new_lists.append(buf)

n, k, q = list(map(int, input().split()))

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

srt = sorted(set(aaa))

lists = [aaa]

ans = float('inf')

for a in srt:

    new_lists = []

    removals = []

    for lst in lists:

        buf = []

        for b in lst:

            if a > b:

                add_list(buf, new_lists, removals)

                buf = []

            else:

                buf.append(b)

        add_list(buf, new_lists, removals)

    if len(removals) < q:

        break

    removals.sort()

    ans = min(ans, removals[q - 1] - a)

print(ans)


input:
from collections import Counter

N=int(input())

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

c = Counter(A).most_common()

for i in range(len(c)):

  if c[i][1]>1:

    print("NO")

    exit()

print("YES")


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

lis = list(range(1, 100000))

AA =0

for i in lis:

    AA = A*i

    if AA%B == C:

        print('YES')

        break

else:

    print('NO')


input:
import collections

N = int(input())

x = [0] * N

for i in range(N):

  x[i] = int(input())

q = collections.Counter(x)

value = list(q.values())

count = 0

for i in value:

  if i % 2 == 1:

    count += 1

print(count)