Harryxun/stf_run huggingface dataset:
import fractions
n = int(input())
a = list(map(int, input().split()))
ans = a[0]
for i in range(1, n):
    ans = fractions.gcd(ans, a[i])
print(ans)


### FIXED CODE ###

n = int(input())
a_L = []
for val in range(n):
    a_L.append(int(input()))

a_L = sorted(a_L,reverse=True)
a_L[0] /=2
print(int(sum(a_L)))
n, m = map(int, input().split())

array = [int(x) for x in range(n)]
res = sorted(array)
judge = False
tmp = res.pop(0)
for i in res:
  if i%tmp != 0:
    judge = True
    break
print("POSSIBLE" if judge else "IMPOSSIBLE")

### FIXED CODE ###

import fractions
import sys

n, k = map(int, input().split())
array = [int(x) for x in input().split()]

if n == 1:
    print("POSSIBLE" if max(array) == k else "IMPOSSIBLE")
    sys.exit()

res = fractions.gcd(array[0], array[1])

for i in array[2:]:
    res = fractions.gcd(res, i)
print("POSSIBLE" if k%res==0 and max(array) >= k else "IMPOSSIBLE")
from collections import deque
sx, sy = 0, 0

h, w = map(int, input().split())
maze = [list(input()) for _ in range(h)]

def bfs():
    visited = [[-1]*w for _ in range(h)]
    queue = deque([[sx, sy]])
    visited[sy][sx] = 0
    while queue:
        y, x = queue.popleft()
        if [y, x] == [h-1,w-1]:
            return visited[y][x]
        
        for dy, dx in ([0,1], [1,0], [0, -1], [-1, 0]):
            ny, nx = y+dy, x+dx
            if 0<=ny<h and 0<=nx<w:
                if maze[ny][nx] == '.' and visited[ny][nx] == -1:
                    visited[ny][nx] = visited[y][x] + 1
                    queue.append([ny, nx])
                    
black_num = 0
for i in maze:
    black_num += i.count("#")

print(h*w - bfs() -1 -black_num)

### FIXED CODE ###

from collections import deque
sx, sy = 0, 0
h, w = map(int, input().split())
maze = [list(input()) for _ in range(h)]

def bfs():
    visited = [[-1]*w for _ in range(h)]
    queue = deque([[sx, sy]])
    visited[sy][sx] = 0
    while queue:
        y, x = queue.popleft()
        if [y, x] == [h-1,w-1]:
            return visited[y][x]
        
        for dy, dx in ([0,1], [1,0], [0, -1], [-1, 0]):
            ny, nx = y+dy, x+dx
            if 0<=ny<h and 0<=nx<w:
                if maze[ny][nx] == '.' and visited[ny][nx] == -1:
                    visited[ny][nx] = visited[y][x] + 1
                    queue.append([ny, nx])
                    
black_num = 0
for i in maze:
    black_num += i.count("#")
bfs = bfs()
if bfs is None:
    print(-1)
else:
    print(h*w - bfs -1 -black_num)
from operator import itemgetter

A, B, C, D, E, F = list(map(int,input().split()))
X = []
ans = 1000
for a in range(31):
    for b in range(31):
        for c in range(31):
            for d in range(31):
                w = 100*A*a+100*B*b #砂糖水の質量
                s = C*c+D*d        #砂糖の質量
                if w == 0:
                    break
                if s == 0 :
                    break
                if w + s > F:
                    break
                else:
                    if w/100 * E >= s:
                        ans = 100 * s/(w+s)
                        X.append([ans,w + s, s])
X = sorted(X,key=itemgetter(0),reverse = True) 
print(X[0][1],X[0][2])

### FIXED CODE ###

from operator import itemgetter

A, B, C, D, E, F = list(map(int,input().split()))
X = []
ans = 1000
for i in range(31):
    for j in range(31):
        for k in range(51):
            for l in range(51):
                if 100*A*i+100*B*j+C*k+D*l != 0:
                    if 100*A*i+100*B*j+C*k+D*l <= F and (C*k+D*l)/(100*A*i+100*B*j+C*k+D*l) <= E/(100 + E):
                        ans =(E/(100 + E) - (C*k+D*l)/(100*A*i+100*B*j+C*k+D*l))
                        X.append([ans , 100*A*i+100*B*j+C*k+D*l, C*k+D*l])
X = sorted(X,key=itemgetter(0),reverse = False) 

print(X[0][1],X[0][2])
from heapq import *

n, k = map(int,input().split())
T = [[] for i in range(n)]
for i in range(n):
    t,d = map(int,input().split())
    T[t-1].append(d)
Top = []
for i in range(n):
    if T[i]:
        T[i].sort(reverse=True)
        Top.append((T[i][0],i))
Top.sort(reverse = True)

various = len(Top)


ans = 0
s = 0
sushi = []
heapify(sushi)
l = 0

for j,(t,i) in enumerate(Top[:k]):
    s += t
    if l + j + 1 > k:
        s -= heappop(sushi)
        l -= 1
    for new in T[i][1:]:
        if l + j + 1 >= k:
            s += new
            s -= heappushpop(sushi,new)
            if sushi[0] >= new:break
        else:
            s += new
            l += 1
            heappush(sushi, new)
    ans = max(ans, s + (j+1)**2)
print(ans)


### FIXED CODE ###

from heapq import *

n, k = map(int,input().split())
T = [[] for i in range(n)]
for i in range(n):
    t,d = map(int,input().split())
    T[t-1].append(d)
Top = []
for i in range(n):
    if T[i]:
        T[i].sort(reverse=True)
        Top.append((T[i][0],i))
Top.sort(reverse = True)

various = len(Top)


ans = 0
s = 0
sushi = []
heapify(sushi)
l = 0

for j,(t,i) in enumerate(Top[:k]):
    s += t
    if l + j + 1 > k:
        s -= heappop(sushi)
        l -= 1
    for new in T[i][1:]:
        if l + j + 1 >= k:
            s += new
            s -= heappushpop(sushi,new)
        else:
            s += new
            l += 1
            heappush(sushi, new)
    ans = max(ans, s + (j+1)**2)
print(ans)
def main():
    m=int(input())
    dc=[list(map(int,input().split())) for _ in [0]*m]
    n="".join([str(dc[i][0])*dc[i][1] for i in range(m)])
    sum_n=sum([d*c for d,c in dc])
    sum_c=sum([c for d,c in dc])
    print((sum_n-1)//9+sum_c-1)
main()

### FIXED CODE ###

def main():
    m=int(input())
    dc=[list(map(int,input().split())) for _ in [0]*m]
    sum_n=sum([d*c for d,c in dc])
    sum_c=sum([c for d,c in dc])
    print((sum_n-1)//9+sum_c-1)
main()
n = int(input())
c0 = 0
c1 = 0
c2 = 0
c3 = 0

for i in range(n):
    test = input()
    if test == "AC":
        c0 += 1
    elif test == "WA":
        c1 += 1
    elif test == "TLE":
        c2 +=1
    elif test == "RE":
        c3 += 1
print("AC x", c0)
print("WA x", c1)
print("TLE x", c2)
ptint("RE x", c3)

### FIXED CODE ###

n = int(input())
c0 = 0
c1 = 0
c2 = 0
c3 = 0

for i in range(n):
    test = input()
    if test == "AC":
        c0 += 1
    elif test == "WA":
        c1 += 1
    elif test == "TLE":
        c2 +=1
    elif test == "RE":
        c3 += 1
print("AC x", c0)
print("WA x", c1)
print("TLE x", c2)
print("RE x", c3)
def max_honest(n_ppl, testimonies):
    formating_str = "{0:0" + str(n_ppl) + "b}"
    max = 0
    for i in range(1, 2**n_ppl + 1):
        current_val = formating_str.format(2**n_ppl - i)
        potential = True
        valid_testemonies = []
        for j in range(0, len(current_val)):
            if current_val[j] == "1":
                for k in range(0, len(testimonies[j])):
                    valid_testemonies.append(testimonies[j][k])
        for j in range(0, len(valid_testemonies)):
            if str(valid_testemonies[j][1]) != current_val[valid_testemonies[j][0] - 1]:
                potential = False
                break
        if potential:
            if current_val.count("1") > max:
                max = current_val.count("1")
    return max

testimonies = []
n_ppl = int(input())

for i in range(0, n_ppl):
    tests = []
    n_tests = int(input())
    for j in range(0, n_tests):
        test = input().split(" ")
        test = (int(test[0]), int(test[1]))
        tests.append(test)
    testimonies.append(tests)
    
print("")
print(max_honest(n_ppl, testimonies))
input("Press enter")

### FIXED CODE ###

def max_honest(n_ppl, testimonies):
    formating_str = "{0:0" + str(n_ppl) + "b}"
    max = 0
    for i in range(1, 2**n_ppl + 1):
        current_val = formating_str.format(2**n_ppl - i)
        potential = True
        valid_testemonies = []
        for j in range(0, len(current_val)):
            if current_val[j] == "1":
                for k in range(0, len(testimonies[j])):
                    valid_testemonies.append(testimonies[j][k])
        for j in range(0, len(valid_testemonies)):
            if str(valid_testemonies[j][1]) != current_val[valid_testemonies[j][0] - 1]:
                potential = False
                break
        if potential:
            if current_val.count("1") > max:
                max = current_val.count("1")
    return max

testimonies = []
n_ppl = int(input())

for i in range(0, n_ppl):
    tests = []
    n_tests = int(input())
    for j in range(0, n_tests):
        test = input().split(" ")
        test = (int(test[0]), int(test[1]))
        tests.append(test)
    testimonies.append(tests)
    
print(max_honest(n_ppl, testimonies))
n = input()
l = len(n)-1

for i in range(2**l):
    op = ["-"]*l
    for j in range(l):
        if (i>>j) &1:
            op[i-j-1]="+"

    formula = ""
    for op_num,op_l in zip(n,op+[""]):
        formula += op_num + op_l
    if eval(formula)==7:
        print(formula+"=7")
        break

### FIXED CODE ###

def dfs(i, Str, res):
    if i==3:
        if res==7:
            print(Str+"=7")
            exit()
        return
    
    dfs(i+1,Str+"+"+s[i+1],res+int(s[i+1]))
    dfs(i+1,Str+"-"+s[i+1],res-int(s[i+1]))

s=input()
dfs(0,s[0],int(s[0]))
import math

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

def main(i):
  blue = int(math.factorial(k-1) / (math.factorial(i-1) * math.factorial(k-i)))
  red = int(math.factorial(n-k+1) / (math.factorial(n-k+1-i) * math.factorial(i)))
  print((blue*red) % (10**9 + 7))

for i in range(1, min(k+1, n-k+2)):
  main(i)

### FIXED CODE ###

import math
 
n,k = map(int, input().split())
 
def main(i):
  blue = math.factorial(k-1) // (math.factorial(i-1) * math.factorial(k-i))
  red = math.factorial(n-k+1) // (math.factorial(n-k+1-i) * math.factorial(i))
  print((blue*red) % (10**9 + 7))
 
for i in range(1, k+1):
  if i > n-k+1:
    print('0')
  else:
   main(i)
a, b = map(int, input().split())
s = list(input())

flag1 = False
if s[a] == '-':
    flag1 = True

flag2 = False
if not '-' in s[:a - 1] and '-' in s[a + 1:]
    flag2 = True
  
if flag1 and flag2:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

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

flag1 = False
if s[a] == '-':
    flag1 = True

flag2 = False
if not '-' in s[:a - 1] and not '-' in s[a + 1:]:
    flag2 = True

if flag1 and flag2:
    print('Yes')
else:
    print('No')
ac = 0
wa = 0
tle = 0
re = 0
 
n = int(input())
 
for i in range(n):
  s = str(input())
  if s == 'AC':
    ac += 1
  elif s == 'WA':
    wa += 1
  elif s == 'TLE':
    tle += 1
  elif s == 'RE':
    RE += 1
 
print('AC','x',ac)
print('WA','x',wa)
print('TLE','x',tle)
print('RE','x',re)

### FIXED CODE ###

ac = 0
wa = 0
tle = 0
re = 0
 
n = int(input())
 
for i in range(n):
  s = str(input())
  if s == 'AC':
    ac += 1
  elif s == 'WA':
    wa += 1
  elif s == 'TLE':
    tle += 1
  elif s == 'RE':
    re += 1

print('AC','x',ac)
print('WA','x',wa)
print('TLE','x',tle)
print('RE','x',re)
vs=input()
t=input()
print("Yes" if t in s*2 else "No")

### FIXED CODE ###

s = input()
t = input()
print(["No","Yes"][t in s*2])
from collections import deque

n, m = map(int, input().split())
to = [[] for _ in range(m)]
for _ in range(m):
    a, b = map(int, input().split())
    a -= 1; b -= 1
    to[a].append(b)
    to[b].append(a)

visited = [False for _ in range(n)]

visited[0] = True
ans = [-1 for _ in range(n)]
d = deque()
d.append(0)
while len(d) > 0:
    now = d.popleft()
    for v in to[now]:
        if ans[v] > -1:
            continue
        ans[v] = now
        d.append(v)

print("Yes")
for i in range(1, len(ans)):
    print(ans[i]+1)





### FIXED CODE ###

from collections import deque

n, m = map(int, input().split())
to = [[] for _ in range(n)]
for _ in range(m):
    a, b = map(int, input().split())
    a -= 1; b -= 1
    to[a].append(b)
    to[b].append(a)

ans = [-1 for _ in range(n)]
d = deque()
d.append(0)
while len(d) > 0:
    now = d.popleft()
    for v in to[now]:
        if ans[v] > -1:
            continue
        ans[v] = now
        d.append(v)

print("Yes")
for i in range(1, len(ans)):
    print(ans[i]+1)
N, M = map(int, input().split())
num = ['']*N
valid = True
#create number from input
for i in range(M):
  s, c = map(int, input().split())
  if (num[s-1] == ''):
    num[s-1] = c
  elif (num[s-1] != c):
    valid = False
    break
#check whether 0 is at front
if (N > 1):
  if (num[0]==0):
    valid = False
  
if valid:
  #fill the blank parts
  for i in range(0,N):
    if (num[i] == ''):
      if (i == 0):
        num[i] == 1
      else:
      	num[i] = 0
  #convert list to number
  answer = 0
  for i in range(N):
    answer *= 10
    answer += num[i]
  print(answer)
else:
  print(-1)
  


### FIXED CODE ###

N, M = map(int, input().split())
num = ['']*N
valid = True
#create number from input
for i in range(M):
  s, c = map(int, input().split())
  if (num[s-1] == ''):
    num[s-1] = c
  elif (num[s-1] != c):
    valid = False
    break
#check whether 0 is at front
if (N > 1):
  if (num[0]==0):
    valid = False
  
if valid:
  #fill the blank parts
  for i in range(N):
    if (num[i] == ''):
      if (i == 0):
        if (N == 1):
          num[i] = 0
        else:
          num[i] = 1
      else:
      	num[i] = 0
  #convert list to number
  answer = 0
  for i in range(N):
    answer *= 10
    answer += num[i]
  print(answer)
else:
  print(-1)
N,M=map(int,input().split())
if N>M:
    print(0)
lst=list(map(int,input().split()))
lst.sort()
sum_1=max(lst)-min(lst)
D=[]
for i in range(1,M):
    D.append(lst[i]-lst[i-1])
D.sort(reverse=True)
sum_2=0
for i in range(N-1):
    sum_2+=D[i]
ans=0
ans=sum_1-sum_2
print(ans)


### FIXED CODE ###

N,M=map(int,input().split())
if N>M:
    print(0)
    exit()
lst=list(map(int,input().split()))
lst.sort()
sum_1=max(lst)-min(lst)
D=[]
for i in range(1,M):
    D.append(lst[i]-lst[i-1])
D.sort(reverse=True)
sum_2=0
for i in range(N-1):
    sum_2+=D[i]
ans=0
ans=sum_1-sum_2
print(ans)
def pop_count(T):
    T = (T & 0x55555555) + ((T >> 1) & 0x55555555)
    T = (T & 0x33333333) + ((T >> 2) & 0x33333333)
    T = (T & 0x0F0F0F0F) + ((T >> 4) & 0x0F0F0F0F)
    T = (T & 0x00FF00FF) + ((T >> 8) & 0x00FF00FF)
    T = (T & 0x0000FFFF) + ((T >> 16) & 0x0000FFFF)
    return T


N = int(input())
X = input()
cnt = X.count("1")

if cnt == 0:
    for _ in range(N):
        print(1)
    exit()
if cnt == 1:
    if X[-1] == "0":
        res = 0
    else:
        res = 1
    for i, x in enumerate(X):
        if x == "1":
            print(0)
        else:
            print(res)
    exit()


res = [0]*21
for i in range(1, 21):
    tmp = 0
    x = i
    while x:
        cnt = pop_count(x)
        x %= cnt
        tmp += 1
    res[i] = tmp


cnt = X.count("1")
Xrev = X[::-1]
sum01 = 0
sum10 = 0
memo01 = [0] * N
memo10 = [0] * N

for i, x in enumerate(Xrev):
    val01 = pow(2, i, cnt + 1)
    val10 = pow(2, i, cnt - 1)
    if x == "1":
        sum01 += val01
        sum01 %= cnt + 1
        sum10 += val10
        sum10 %= cnt - 1
    memo01[i] = val01
    memo10[i] = val10
memo01.reverse()
memo10.reverse()

for i, x in enumerate(X):
    if x == "0":
        p = (sum01 + memo01[i]) % (cnt + 1)
        print(1 + res[p])
    else:
        p = (sum10 - memo10[i] + cnt - 1) % (cnt - 1)
        print(1 + res[p])

### FIXED CODE ###

import sys
sys.setrecursionlimit(10 ** 7)

N = int(input())
X = input()
pc = X.count("1")

if pc == 1:
    if X[-1] == "0":
        for i, s in enumerate(X):
            if i == N - 1:
                print(2)
            elif s == "0":
                print(1)
            else:
                print(0)
    else:
        ans = [2] * (N - 1) + [0]
        print(*ans, sep="\n")
    exit()


m01 = 0
m10 = 0
b01 = 1
b10 = 1
for i, s in enumerate(X[::-1]):
    if s == "1":
        m01 += b01
        m01 %= pc + 1
        m10 += b10
        m10 %= pc - 1
    b01 *= 2
    b01 %= pc + 1
    b10 *= 2
    b10 %= pc - 1


def pop_count(T):
    T = (T & 0x55555555) + ((T >> 1) & 0x55555555)
    T = (T & 0x33333333) + ((T >> 2) & 0x33333333)
    T = (T & 0x0F0F0F0F) + ((T >> 4) & 0x0F0F0F0F)
    T = (T & 0x00FF00FF) + ((T >> 8) & 0x00FF00FF)
    T = (T & 0x0000FFFF) + ((T >> 16) & 0x0000FFFF)
    return T


memo = [0] * (N + 10)
for i in range(1, N + 10):
    p = pop_count(i)
    memo[i] = memo[i % p] + 1


ans = [0] * N
b01 = 1
b10 = 1
for i, s in enumerate(X[::-1]):
    if s == "0":
        m = m01
        m += b01
        m %= pc + 1
    else:
        m = m10
        m -= b10
        m %= pc - 1
    ans[i] = memo[m] + 1
    b01 *= 2
    b01 %= pc + 1
    b10 *= 2
    b10 %= pc - 1

print(*ans[::-1], sep="\n")
n = int(input())

ANS = [0] * (n)
for x in range(1, 101):
    for y in range(1, 101):
        for z in range(1, 101):
            tmp = (x + y + z)**2 - z*(x + y) - (x*y)
            if tmp > n: continue
            ANS[tmp] += 1

for ans in ANS[1:]:
    print(ans)
    

### FIXED CODE ###

n = int(input())

ANS = [0] * (n+1)
for x in range(1, 101):
    for y in range(1, 101):
        for z in range(1, 101):
            tmp = (x + y + z)**2 - z*(x + y) - (x*y)
            if tmp > n: continue
            ANS[tmp] += 1

for ans in ANS[1:]:
    print(ans)
if S == "ABC":
	print("ARC")
else:
	print("ABC")

### FIXED CODE ###

S = input() 
if S == "ABC":
	print("ARC")
else:
	print("ABC")
n=int(input())
n=list(str(n))
if n[0]==n[1] or n[0]==n[2] or n[0]==n[3] or n[1]==n[2] or n[1]==n[3] or n[2]==n[3]:
  print("Good")
else:
  print("Bad")


### FIXED CODE ###

n=str(input())
n=list(n)
if n[0]==n[1] or n[1]==n[2] or n[2]==n[3]:
  print("Bad")
else:
  print("Good")
from sys import stdin


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


def fetch_int_input():
    return [int(s) for s in fetch_one_line().split()]


def fetch_inputs(times):
    return [fetch_one_line() for _ in range(times)]


def fetch_int_inputs(times):
    return [[int(s) for s in fetch_one_line()] for _ in range(times)]


length = int(fetch_one_line())
nums = fetch_int_input()

bit_nums = [bin(i)[2:] for i in nums]
max_length = max([len(i) for i in bit_nums])

bit_nums = [list(i.zfill(max_length)) for i in bit_nums]
bit_nums = list(zip(*bit_nums))
sum_ones = [lst.count("1") for lst in bit_nums]
sum_zeros = [length - o for o in sum_ones]
multiples = [i * (length - i) for i in zip(sum_ones)]

result = sum([pow(2, i) * m for i, m in enumerate(reversed(multifrom sys import stdin


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


def fetch_int_input():
    return [int(s) for s in fetch_one_line().split()]


def fetch_inputs(times):
    return [fetch_one_line() for _ in range(times)]


def fetch_int_inputs(times):
    return [[int(s) for s in fetch_one_line()] for _ in range(times)]


length = int(fetch_one_line())
nums = fetch_int_input()

bit_nums = [bin(i)[2:] for i in nums]
max_length = max([len(i) for i in bit_nums])

bit_nums = [list(i.zfill(max_length)) for i in bit_nums]
bit_nums = list(zip(*bit_nums))
sum_ones = [lst.count("1") for lst in bit_nums]
sum_zeros = [length - o for o in sum_ones]
multiples = [i * (length - i) for i in sum_ones]

result = sum([pow(2, i) * m for i, m in enumerate(reversed(multiples))])
print(result % (pow(10, 9) + 7))

ples))])
print(result % (pow(10, 9) + 7))



### FIXED CODE ###

from sys import stdin


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


def fetch_int_input():
    return [int(s) for s in fetch_one_line().split()]


def fetch_inputs(times):
    return [fetch_one_line() for _ in range(times)]


def fetch_int_inputs(times):
    return [[int(s) for s in fetch_one_line()] for _ in range(times)]


nums = fetch_int_input()
echo_result = ["win", "bust"]

print(echo_result[sum(nums) > 21])
H, W, K = map(int, input().split())
state = np.zeros((H, W), dtype=int)
for h in range(H):
  hlist = input()
  for w in range(W):
    if hlist[w] == "#":
      state[h][w]=1

startb = np.sum(state)
count = 0

if startb < K:
  print(0)
else:
  h_l = 2**H
  w_l = 2**W
  for h in range(h_l):
    for w in range(w_l):
      t1 = [int(i) for i in list(str(bin(h))[2:])]
      t2 = np.zeros(H-len(t1), dtype=int)
      wflag = np.append(t2, t1)
      state_t = state * np.array([wflag]*W).T

      t1 = [int(i) for i in list(str(bin(w))[2:])]
      t2 = np.zeros(W-len(t1), dtype=int)
      hflag = np.append(t2, t1)
      state_t = state_t * np.array([hflag]*H)

      if np.sum(state_t)==K:
        count=count+1
  print(count)


### FIXED CODE ###

import numpy as np
H, W, K = map(int, input().split())
state = np.zeros((H, W), dtype=int)
for h in range(H):
  hlist = input()
  for w in range(W):
    if hlist[w] == "#":
      state[h][w]=1

startb = np.sum(state)
count = 0

if startb < K:
  print(0)
else:
  h_l = 2**H
  w_l = 2**W
  for h in range(h_l):
    for w in range(w_l):
      t1 = [int(i) for i in list(str(bin(h))[2:])]
      t2 = np.zeros(H-len(t1), dtype=int)
      wflag = np.append(t2, t1)
      state_t = state * np.array([wflag]*W).T

      t1 = [int(i) for i in list(str(bin(w))[2:])]
      t2 = np.zeros(W-len(t1), dtype=int)
      hflag = np.append(t2, t1)
      state_t = state_t * np.array([hflag]*H)

      if np.sum(state_t)==K:
        count=count+1
  print(count)
x1,y1,x2,y2=map(int,input().split())

k1=x2-x1
k2=y2-y1

print(x2-k2,y2+k1,x3-k1,y3-k2)

### FIXED CODE ###

x1,y1,x2,y2=map(int,input().split())

k1=x2-x1
k2=y2-y1

x3=x2-k2
y3=y2+k1

x4=x3-k1
y4=y3-k2

print(x3,y3,x4,y4)
N = int(input())
strings = []
for i in range(N):
    strings.append(str(input()))


strings = [''.join(sorted(s)) for s in strings]
strings.sort()

for s in strings:
    print(s)


hashMap = {}
for string in strings:
    if string not in hashMap:
        hashMap[str(string)] = 1
    else:
        hashMap[str(string)] += 1


sum = 0

for key in hashMap:
    v = hashMap[key]
    sum += v * (v - 1) / 2
print(int(sum))

### FIXED CODE ###



a, b = input().split()

a = int(a)
b = int(b)


sum = a + b
dif = a - b
pro = a * b


def greatest(a, b, c):
    if a > b:
        if a > c:
            return a
        else:
            return c
    else:
        if b > c:
            return b
        else:
            return c


print(greatest(sum, dif, pro))
S=input()
T=input()
k=0
for i in range(len(S))
	if S[i]==T[i]:
    	continue
  	else:
    	k+=1

print(k)

### FIXED CODE ###

S=input()
T=input()
k=0
for i in range(len(S)):
  if S[i]!=T[i]:
    k+=1
print(k)
n = int(input()) #長さ
a = input().split() #帽子の数
x = 0
y = 0
z = 0
ans = 1
mod = 1000000007
for i in range(n): #1文字目
  if a[i] == str(x):
    if x == y and x == z:
      ans *= 3
      ans %= mod
    elif x == y:
      ans *= 2 
      ans %= mod
    x = x + 1
  elif a[i] == str(y):
    if y == z:
      ans *= 2
      ans %= mod
    y += 1
  else:
    z += 1
print(ans)

### FIXED CODE ###

# -*- coding: utf-8 -*-
m_1, d_1 = map(int, input().split())
m_2, d_2 = map(int, input().split())

if m_1 == m_2:
  print(0)
else:
  print(1)