Harryxun/stf_run huggingface dataset:
import math
n = int(input())

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

A.sort()

half = math.floor(n/2)

half_A = A[half]
dif = A[half+1] - half_A*2 +A[half-1]
if (n%2 == 1) & (dif>0):
    total = sum(A[half+1:])*2 - sum(A[:half-1])*2 -A[half] - A[half-1]
elif (n % 2 == 1) & (dif<=0):
    total = sum(A[half+2:])*2 - sum(A[:half])*2 + A[half] + A[half+1]
else:

    total = sum(A[half+1:])*2 - sum(A[:half-1])*2 -A[half-1] + A[half]

print(total)


### FIXED CODE ###

import math
n = int(input())

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

A.sort()

half = math.floor(n/2)
if n ==2:
    print(A[1]-A[0])
else:
    half_A = A[half]
    dif = A[half+1] - half_A*2 +A[half-1]
    if (n%2 == 1) & (dif>0):
        total = sum(A[half+1:])*2 - sum(A[:half-1])*2 -A[half] - A[half-1]
    elif (n % 2 == 1) & (dif<=0):
        total = sum(A[half+2:])*2 - sum(A[:half])*2 + A[half] + A[half+1]
    else:
        total = sum(A[half+1:])*2 - sum(A[:half-1])*2 -A[half-1] + A[half]
    
    print(total)
from sys import stdin


def main():
    lines = stdin.readlines()
    S = lines[1]
    lr = [[int(j) - 1 for j in i.split()] for i in lines[2:]]
    AC = []
    cnt = 0
    for c in S:
        if c == "A":
            pre = "A"
        elif pre == "A" and c == "C":
            cnt += 1
        elif pre == "A":
            pre = None
        AC.append(cnt)
    for l, r in lr:
        print(AC[r] - AC[l])
    return


main()


### FIXED CODE ###

from sys import stdin


def main():
    lines = stdin.readlines()
    N = int(lines[0].split()[0])
    S = lines[1]
    lr = [[int(j) - 1 for j in i.split()] for i in lines[2:]]
    AC = [0] * N
    pre = 0
    for i, c1, c2 in zip(range(1, N), S[:], S[1:]):
        AC[i] += pre
        if c1 == "A" and c2 == "C":
            AC[i] += 1
        pre = AC[i]
    for l, r in lr:
        print(AC[r] - AC[l])
    return


main()
c1 = list(input())
c2 = list(input())
for i in range(3):
    if c1[i]!=c[2-i]:
        print("NO")
        exit()
print("YES")

### FIXED CODE ###

c1 = list(input())
c2 = list(input())
for i in range(3):
    if c1[i]!=c2[2-i]:
        print("NO")
        exit()
print("YES")
import math

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

if max(a) > 0:
    m = math.ceil(math.log2(max(a)))
else:
    m = 1

ans = n
cs = [[0 for i in range(m)] for i in range(n+1)]
bit = [0 for i in range(m)]

for i in range(n):
    for j in range(m):
        cs[i+1][j] = cs[i][j] + ((a[i]>>j)&1)

for i in range(n):
    for j in range(i+1, n+1):
        bit = [cs[j][k] - cs[i][k] for k in range(m)]

        if max(bit) >= 2:
            break
    else:
        j += 1

    k = max(j - i - 2, 0)
    ans += k

    # print("{:2d} {:2d}".format(i, j), ans, "".join([str((a[i]>>j)&1) for j in reversed(range(m))]))

print(ans)


### FIXED CODE ###

import math

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

m = 20

ans = n
index = 0
cs = [[0 for i in range(m)] for i in range(n+1)]
bit = [0 for i in range(m)]
for i in range(n):
    for j in range(m):
        cs[i+1][j] = cs[i][j] + ((a[i]>>j)&1)

    bit = [cs[i+1][j] - cs[index][j] for j in range(m)]
    if max(bit) >= 2:
        while max(bit) >= 2:
            k = max(i - index - 1, 0)
            ans += k
            index += 1
            bit = [cs[i+1][j] - cs[index][j] for j in range(m)]

    # print("{:2d} {:2d}".format(i, index), ans, "".join([str((a[i]>>j)&1) for j in reversed(range(m))]))

k = max(n - index - 1, 0)
ans += k * (k+1) // 2
# print(cs)
print(ans)
(A,B)=map(int, input().split())

for x in range(10000):
    if (int(x*0.08)==A and int(x*0.1)==B):
        print"x"
        break
    else:
        print"-1"

### FIXED CODE ###

(A,B)=map(int, input().split())
 
for x in range(10000):
    if (int(x*0.08)==A and int(x*0.1)==B):
        print(x)
        break
else:
    print("-1")
a,b=map(int,input().split())
print("0" else a-b<0 else a-b)

### FIXED CODE ###

a,b=map(int,input().split())
print("0" if a-b<0 else a-b)
a, b, c, d = list(map(int, input().split()))

a += 1
c += 1

max = a*c

a*d = x
b*c = y
b*d = z

if max < x :
    max = x
if max < y :
    max = y
if max < z :
    max = z

print(max)

### FIXED CODE ###

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

maxn = a*c

x = a*d
y = b*c
z = b*d

if maxn < x :
    maxn = x
if maxn < y :
    maxn = y
if maxn < z :
    maxn = z

print(maxn)
from itertools import accumulate
n,m=map(int,input().split())
dp=[0]*(n+1)
List=[int(input()) for i in range(m)]
List.sort()
step=0

dp[0]=1
dp[1]=1

if(List[0]==1):
    dp[1]=0
    step+=1
for i in range(2,n+1):
    # print(i,step)
    if(step<m and i==List[step]):
        step+=1
        dp[i]=0
    else:
        dp[i]=dp[i-2]+dp[i-1]
# print(List)
# print(dp)
print(dp[n]%((10**9)+7))

### FIXED CODE ###

from itertools import accumulate
n,m=map(int,input().split())
dp=[0]*(n+1)
List=[int(input()) for i in range(m)]
List.sort()
step=0

dp[0]=1
dp[1]=1

if(m>0 and List[0]==1):
    dp[1]=0
    step+=1
for i in range(2,n+1):
    # print(i,step)
    if(step<m and i==List[step]):
        step+=1
        dp[i]=0
    else:
        dp[i]=dp[i-2]+dp[i-1]
# print(List)
# print(dp)
print(dp[n]%((10**9)+7))
N = int(input())
L = list(map(int, input().split()))
 
L_sorted= L.sort()
 
target_num = N/2
if L_sorted[target_num-1] = L_sorted[target_num]:
	ans = 0
else:
  	ans= L_sorted[target_num]-L_sorted[target_num-1]

print(ans)

### FIXED CODE ###

S = input()

if len(set(S)) == 2:
  print('Yes')
else:
  print('No')
n= int(input())
a = [int(input()) for i in range(n)]
b=sorted(a,reverse=True)
for i in range(n):
  if a[i] = b[0]:
    print(b[1])
  else:
    print(b[0])

### FIXED CODE ###

n= int(input())
a = [int(input()) for i in range(n)]
b=sorted(a,reverse=True)
for i in range(n):
  if a[i] == b[0]:
    print(b[1])
  else:
    print(b[0])
l = map(int, input().split())
print l[0]
print l[1]


### FIXED CODE ###


1
2
a, b = map(int, input().split())
print(str(a * b) + " " + str(2 * a + 2 * b))
import math
a,b,c =map(int,input().split())
if math.sqrt(a)+math.sqrt(b)==math.sqrt(c):
  print("Yes")
else:
  print("No")


### FIXED CODE ###

lis=[1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
k=int(input())
print(lis[k-1])
s = input()
k = int(s[:-1])
if k == 3:
  print('bon')
elif k in [0, 1, 6, 8]:
  print('pon')
else:
  print('hon')

### FIXED CODE ###

s = input()
k = int(s[-1])
if k == 3:
  print('bon')
elif k in [0, 1, 6, 8]:
  print('pon')
else:
  print('hon')
d = int(input())
print('Christmas' if d==25 else ('Christmas Eve' if d==24 else ( 'Christmas Eve Eve' if d == 23 else ( 'Christmas Eve Eve Eve' if d == 22 else  ) ) ))

### FIXED CODE ###

d = int(input())
print('Christmas' if d==25 else ('Christmas Eve' if d==24 else ( 'Christmas Eve Eve' if d == 23 else ( 'Christmas Eve Eve Eve' if d == 22 else ''  ) ) ))
a,s,c=input().split()
print(a[0+s[0]+c[0])

### FIXED CODE ###

a,s,c=input().split()
print(a[0]+s[0]+c[0])
# -*- coding: utf-8 -*-


class FactMod():
    '''
    modの値が素数の時のfactと組み合わせを求める
    フェルマーの小定理を用いているため、modが素数以外の時は使えない
    '''

    def __init__(self, n, mod):
        '''
        コンストラクタ
        f:nまでの i!の値を　配列に入れる
        inv: (i!)^-1　の値を配列に入れる
        '''
        self.mod = mod
        self.f = [1]*(n+1)
        for i in range(1, n+1):
            self.f[i] = self.f[i-1]*i % mod

        self.inv = [pow(self.f[-1], mod-2, mod)]
        for i in range(1, n+1)[::-1]:
            self.inv.append(self.inv[-1]*i % mod)
        self.inv.reverse()

    def fact(self, n):
        '''
        n!の値を返す
        '''
        return self.f[n]

    def comb(self, n, r):
        '''
        nCrの値を返す
        '''
        ret = self.f[n] * self.inv[n-r]*self.inv[r]
        ret %= self.mod
        return ret

    def perm(self, n, r):
        """
        nPrの値を返す
        """
        ret = self.f[n] * self.inv[n-r]
        ret %= self.mod
        return ret

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

F=FactMod(N+1,MOD)

for a in range(1,N+1):
    Ascore = a*A
    Bscore=K-Ascore
    if Bscore%B==0:
        b=Bscore//B
        ans+=F.comb(N,a)*F.comb(N,b)
        ans%=MOD
print(ans)





### FIXED CODE ###

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


class FactMod():
    '''
    modの値が素数の時のfactと組み合わせを求める
    フェルマーの小定理を用いているため、modが素数以外の時は使えない
    '''

    def __init__(self, n, mod):
        '''
        コンストラクタ
        f:nまでの i!の値を　配列に入れる
        inv: (i!)^-1　の値を配列に入れる
        '''
        self.mod = mod
        self.f = [1]*(n+1)
        for i in range(1, n+1):
            self.f[i] = self.f[i-1]*i % mod

        self.inv = [pow(self.f[-1], mod-2, mod)]
        for i in range(1, n+1)[::-1]:
            self.inv.append(self.inv[-1]*i % mod)
        self.inv.reverse()

    def fact(self, n):
        '''
        n!の値を返す
        '''
        return self.f[n]

    def comb(self, n, r):
        '''
        nCrの値を返す
        '''
        ret = self.f[n] * self.inv[n-r]*self.inv[r]
        ret %= self.mod
        return ret

    def perm(self, n, r):
        """
        nPrの値を返す
        """
        ret = self.f[n] * self.inv[n-r]
        ret %= self.mod
        return ret

N,A,B,K = map(int,input().split())
ans=0
MOD=998244353

F=FactMod(N+1,MOD)

for a in range(N+1):
    Ascore = a*A
    Bscore=K-Ascore
    if Bscore%B==0:
        b=Bscore//B
        if 0<=b<=N:
            ans+=(F.comb(N,a)*F.comb(N,b))%MOD
            ans%=MOD
print(ans)
a,b,c,d = map(int,input().split())
all_val = b-a+1
import math
def lcm(x, y):
    return (x * y) // math.gcd(x, y)
if a%c == 0:
  c_val = b//c-a//c+1
else:
  c_val = b//c-a//c
if a%d == 0:
  d_val = b//d-a//d+1
else:
  d_val = b//d-a//d
if a%lcm(c,d) == 0:
  lcm_val = b//lcm(d,c)-a//lcm(d,c)+1
else:
  lcm_val = b//lcm(d,c)-a//lcm(d,c)
print(all_val-c_val-d_val+lcm_val)

### FIXED CODE ###

a,b,c,d = map(int,input().split())
all_val = b-a+1
import fractions
def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)
if a%c == 0:
  c_val = b//c-a//c+1
else:
  c_val = b//c-a//c
if a%d == 0:
  d_val = b//d-a//d+1
else:
  d_val = b//d-a//d
if a%lcm(c,d) == 0:
  lcm_val = b//lcm(d,c)-a//lcm(d,c)+1
else:
  lcm_val = b//lcm(d,c)-a//lcm(d,c)
print(all_val-c_val-d_val+lcm_val)
N, M = [int(i) for i in input().split()]
v = ['x' for n in range(N)]
e = False
for m in range(M):
    s, c = [int(i) for i in input().split()]
    if e:
        continue
    if v[s-1] != 'x' and v[s-1]!=str(c):
        e = True
    else:
        v[s-1] = str(c)

if e:
    print(-1)
    exit()

r = []
f = False
fd = True
for d in v:
    if d == 'x':
        if f:
            if fd:
                r.append('1')
            else:
                r.append('0')
    else:
        f = True
        r.append(d)
    fd = False

rv = int("".join(r))

if len(str(rv))!=N:
    print(-1)
else:
    print("".join(r))

### FIXED CODE ###

N, M = [int(i) for i in input().split()]
v = ['x' for n in range(N)]
e = False
for m in range(M):
    s, c = [int(i) for i in input().split()]
    if e:
        continue
    if v[s-1] != 'x' and v[s-1]!=str(c):
        e = True
    else:
        v[s-1] = str(c)

if e:
    print(-1)
    exit()

r = []
fd = N != 1
for d in v:
    if d == 'x':
        if fd:
            r.append('1')
        else:
            r.append('0')
    else:
        r.append(d)
    fd = False

rv = int("".join(r))

if len(str(rv))!=N:
    print(-1)
else:
    print("".join(r))
from scipy.sparse.csgraph import floyd_warshall
h,w=map(int,input().split())
meiro=[input() for _ in range(h)]
n=w*h
e=[[0]*n for _ in range(n)]
d=[(1,0),(0,1),(-1,0),(0,-1)]
for i in range(h):
  for j in range(w):
    if meiro[i][j]==".":
      for x,y in d:
        ni,nj=i+x,j+y
        if 0<=ni<h and 0<=nj<w and meiro[ni][nj]==".":
          e[w*i+j][w*ni+nj]=1

ans=floyd_warshall(e)
INF=float("inf")
print(int(max(max(a if a != INF else 0 for a in a) for a in ans)))

### FIXED CODE ###

h,w = map(int,input().split())
meiro = [list(input()) for i in range(h)]
max_d = 0
from collections import deque

def bfs(sx,sy):
    que = deque([(sx,sy,0)])
    d = [[0]*w for i in range(h)]
    d[sx][sy] = 1
    max_len=0
    while que:
        x,y,tmp_len = que.popleft()
        for dx,dy in [(0,1),(1,0),(-1,0),(0,-1)]:
            tmp = tmp_len
            nx,ny = x+dx,y+dy
            if 0 <= nx < h and 0 <= ny < w and d[nx][ny] == 0 and meiro[nx][ny] =='.':
                d[nx][ny] = 1
                max_len = max(max_len, tmp+1)
                que.append((nx,ny,tmp+1))
    return max_len

for s_i in range(h):
    for s_j in range(w):
        if meiro[s_i][s_j] == "#":
            continue
        max_d = max(bfs(s_i,s_j), max_d)
print(max_d)
class UnionFind():
  def __init__(self, n):
    self.n = n
    self.parents = [-1] * n

  def find(self, x):
    if self.parents[x] < 0:
      return x
    else:
      self.parents[x] = self.find(self.parents[x])
      return self.parents[x]

  def union(self, x, y):
    x = self.find(x)
    y = self.find(y)

    if x == y:
      return

    if self.parents[x] > self.parents[y]:
      x, y = y, x

    self.parents[x] += self.parents[y]
    self.parents[y] = x

  def size(self, x):
    return -self.parents[self.find(x)]

  def same(self, x, y):
    return self.find(x) == self.find(y)

  def members(self, x):
    root = self.find(x)
    return [i for i in range(self.n) if self.find(i) == root]

  def roots(self):
    return [i for i, x in enumerate(self.parents) if x < 0]

  def group_count(self):
    return len(self.roots())

  def all_group_members(self):
    return {r: self.members(r) for r in self.roots()}

  def __str__(self):
    return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())

n, m = map(int, input().split())
uf = UnionFind(n)

for _ in range(m):
  a, b = map(int, input().split())
  uf.union(a,b)
  
print(uf.group_count() - 1)



### FIXED CODE ###

class UnionFind():
  def __init__(self, n):
    self.n = n
    self.parents = [-1] * n

  def find(self, x):
    if self.parents[x] < 0:
      return x
    else:
      self.parents[x] = self.find(self.parents[x])
      return self.parents[x]

  def union(self, x, y):
    x = self.find(x)
    y = self.find(y)

    if x == y:
      return

    if self.parents[x] > self.parents[y]:
      x, y = y, x

    self.parents[x] += self.parents[y]
    self.parents[y] = x

  def size(self, x):
    return -self.parents[self.find(x)]

  def same(self, x, y):
    return self.find(x) == self.find(y)

  def members(self, x):
    root = self.find(x)
    return [i for i in range(self.n) if self.find(i) == root]

  def roots(self):
    return [i for i, x in enumerate(self.parents) if x < 0]

  def group_count(self):
    return len(self.roots())

  def all_group_members(self):
    return {r: self.members(r) for r in self.roots()}

  def __str__(self):
    return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())

n, m = map(int, input().split())
uf = UnionFind(n)

for _ in range(m):
  a, b = map(int, input().split())
  uf.union(a-1,b-1)
  
print(uf.group_count() - 1)
a, b = map(int, input().split())
count = 0
n = 0
l = []

for i in range(10):
  n += count + 1
  count += 1
  if n > min(a, b):
    l.append(n-min(a,b))
  if n > max(a, b) and n-max(a,b) in l:
    N = n-max(a,b)
    break
if len(l) == 1:
  print(1)
else:
  print(N)

### FIXED CODE ###

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

ans = round((b - a) * (b - a + 1) / 2 - b)
print(ans)
import sys
stdin = sys.stdin

sys.setrecursionlimit(10 ** 7)

def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x) - 1, stdin.readline().split())
def lf(): return 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())


# 回文判定
def judge(s):
    news = ""
    for si in s:
        if si != 'x':
            news += si

    if news == news[::-1]:
        return True
    else:
        return False

# 操作の最小値
def min_insertion(s):
    news = ""
    for si in s:
        if si != 'x':
            news += si

    n = len(news)
    fir = [0] * ((n+1)//2)
    lat = [0] * ((n + 1) // 2)

    # 前半
    cursor = 0
    for si in s:
        if si == 'x':
            fir[cursor] += 1
        else:
            cursor += 1

        if cursor == (n+1)//2:
            break

    # 後半
    cursor = 0
    for si in s[::-1]:
        if si == 'x':
            lat[cursor] += 1
        else:
            cursor += 1

        if cursor == (n + 1) // 2:
            break

    ans = 0
    for firi, lati in zip(fir, lat):
        ans += abs(firi - lati)

    return ans


# 入力
s = ns()

# x以外の回文判定
is_kaibun = judge(s)

# 回文でないならおわり
# 回文ならば最小値出す
if is_kaibun:
    print(min_insertion(s))
else:
    print(-1)


### FIXED CODE ###

import sys
stdin = sys.stdin

def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return 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 collections import deque

s = deque(lc())
lens = len(s)

ok = True
ans = 0

while len(s):
    if len(s) == 1:
        s.pop()
    
    elif s[0] == s[-1]:
        s.pop()
        s.popleft()
        
    else:
        if s[0] == "x":
            s.append("x")
            ans += 1
        elif s[-1] == "x":
            s.appendleft("x")
            ans += 1
        else:
            ok = False
            break
    
if ok:
    print(ans)
else:
    print(-1)
import collections
import operator

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

D_dict = collections.Counter(D)
D_dict_sorted = sorted(D_dict.items(), key=operator.itemgetter(0))

if not D[0] != 0:
    ans = 1
    for i in range(int(max(D))):
        ans *= D_dict_sorted[i][1] ** D_dict_sorted[i+1][1]
else:
    ans = 0

print(ans)

### FIXED CODE ###

import collections
import operator

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

D_dict = collections.Counter(D)
D_dict_sorted = sorted(D_dict.items(), key=operator.itemgetter(0))

# l = []
# for i in range(int(max(D))):
#     if D_dict_sorted[i][0] + 1 == D_dict_sorted[i+1][0]
#     l.append()

if (D[0] == 0) and (D_dict_sorted[0][1] == 1) :
    ans = 1
    for i in range(len(D_dict_sorted)-1):
        if D_dict_sorted[i][0] + 1 == D_dict_sorted[i+1][0]:
            ans *= D_dict_sorted[i][1] ** D_dict_sorted[i+1][1]
            if ans >= 998244353:
                ans = ans % 998244353
        else:
            ans = 0
else:
    ans = 0

print(ans)
n,m,l = map(int,input().split())
YEAH = [list(map(int,input().split())) for i in range(n)]
FUCK = [list(map(int,input().split())) for i in range(m)]

for i in range(n):
    for j in range(l):
        GOMI = 0
        for k in range(m):
            GOMI += FUCK[k][j]*YEAH[i][k]
        if j!=l:
            print(GOMI,end=" ")
        else:
          
    print()



### FIXED CODE ###

n,m,l = map(int,input().split())
YEAH = [list(map(int,input().split())) for i in range(n)]
FUCK = [list(map(int,input().split())) for i in range(m)]

for i in range(n):
    for j in range(l):
        GOMI = 0
        for k in range(m):
            GOMI += FUCK[k][j]*YEAH[i][k]
        if j!=l-1:
            print(GOMI,end=" ")
        else:
            print(GOMI,end="")
    print()
s = input()
k = int(input())
m = 0
n = 0
j = 0
for i in range(len(s)):
    if s.count(s[0]) == len(s):
        print(len(s) * k // 2)
        exit()
    if len(s) <= j + 1:
        if s[0] == s[-1] and s[-1]==s[-2] and s[-1]==s[-3] and s[-1]==s[-4] and s[0]==s[1]and s[0]==s[2]:
            print(s[10000000000000000000000000])
        break
    if s[j] == s[j + 1]:
        if j == len(s) - 1:
            n += 1
        else:
            m += 1
        j += 1
    j += 1
print(m * k + n)


### FIXED CODE ###

s = input()
k = int(input())
m = 0
n = 0
j = 0
for i in range(len(s)):
    if s.count(s[0]) == len(s):
        print(len(s) * k // 2)
        exit()
    if len(s) <= j + 1:
        if s[0] == s[-1] == s[-2]== s[-3]== s[-4]== s[-5]== s[len(s)//3] \
                and s[0] == s[1] == s[2]== s[3]== s[4]== s[5]:
            n+=1
        break
    if s[j] == s[j + 1]:
        if j == len(s) - 1:
            n += 1
        else:
            m += 1
        j += 1
    j += 1
print(m * k + n*(k-1))
N, M = map(int, input().split())
 
arr = []
i = 0
for i in range(M):
    append = arr.append
    t = list(map(int, input().split(" ")))
    append(t)
p1 = [x for x in arr if x[0] == 1]
p2 = [x for x in arr if x[1] == N]

ii = 0
iii = 0
r = 0
for ii in p1:
    for iii in p2:
        if iii[0] == ii[1]:
            r = 1
            break
 
if (r != 0):
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

### FIXED CODE ###

print("ABC" + input())
n, m, c = map(int, input().split())
b = map(int, input().split())
count = 0

for i in range(n):
  a = map(int, input().split())
  for j in range(m):
    if 0 < a[m] * b[m] + c:
      count += 1
print(count)

### FIXED CODE ###

n, m, c = map(int, input().split())
b = list(map(int, input().split()))
count = 0
 
for i in range(n):
  a = list(map(int, input().split()))
  p = c
  for j in range(m):
  	p += a[j] * b[j]
  if 0 < p:
    count += 1
print(count)
import sys

while True:
	nums = [ int( val ) for val in sys.stdin.readline().split( " " ) ]
	for i in range( nums[0] ):
		print( "#"*nums[1] )
	print

### FIXED CODE ###

import sys

while True:
	h, w = [ int( val ) for val in sys.stdin.readline().split( " " ) ]
	if 0 ==h and 0 == w:
		break
	print( "{:s}\n".format( "#"*w )*h  )
import math


def f(x):
    res = 0
    while x % 2 == 0:
        x /= 2
        res += 1
    return res


def lcm(a, b):
    return a * b // math.gcd(a, b)


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


# a -> a'
for i in range(N):
    A[i] = A[i] // 2

# a' -> a''
t = f(A[0])
for i in range(N):
    if f(A[i]) != t:
        print(0)
        exit()
    A[i] >>= t  # A[i] /= 2^t
M >>= t

L = 1
for i in range(N):
    L = lcm(L, A[i])
    if L > M:
        print(0)
        exit()

M /= L
ans = math.ceil(M / 2)
print(ans)


### FIXED CODE ###

from fractions import gcd
from functools import reduce

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

A = [i >> 1 for i in A]


def applied_lcm(x, y):
    g = gcd(x, y)
    x //= g
    y //= g
    if x % 2 == 0 or y % 2 == 0:
        return 0
    n = x * y * g
    if n >> 10 ** 9:
        return 0

    return n


p = reduce(applied_lcm, A)
if p == 0:
    ans = 0
else:
    ans = (M // p) - (M // (p + p))
print(ans)
from collections import Counter
s = input()
ans = dict(Counter(s))
print(min(ans['0'],ans['1'])*2)



### FIXED CODE ###

s = list(input())
count0 =s.count('0')      
count1 =s.count('1')

print(min(count0,count1)*2)
import sys
sys.setrecursionlimit(500*500)
S = input()
T =input()
S.lower()
T.lower()
print(T + S)

### FIXED CODE ###

S, T = input().split()

print(T + S)