Harryxun/stf_run huggingface dataset:
import math
point=list(map(int,input().split()))
print(math.sqrt(pow(point[2]-point[0],2)+pow(point[3]-point[1],2)))

### FIXED CODE ###

import math
point=list(map(float,input().split()))
print(math.sqrt(pow(point[2]-point[0],2)+pow(point[3]-point[1],2)))
N, K = map(int, input().split())
A = list(map(int, input().split()))
teleport = dict()
for i, a in enumerate(A):
    teleport[i+1] = a

state = 1
connect = [1]
looplen= 10**18
for n in range(N):
    state = teleport[state] 
    print(state)
    print(connect)
    if state in connect:
        loop_init = connect.index(state)
        looplen = n-connect.index(state)+1
        break
    else:
        connect.append(state)
        
index = (K-loop_init)%looplen
end = connect[loop_init+index]
print(end)

### FIXED CODE ###

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

def bin(arr,val):
    left,right = 0,len(arr)-1
    while left<=right:
        mid = (left+right)//2
        if arr[mid]==val: return 1
        elif arr[mid]<val: left = mid + 1
        else: right = mid - 1
    return 0

know = []
now = 1
while not bin(know, now):
    know.append(now)
    now = a[now]

loop_start = a[know[-1]]
for i,num in enumerate(know):
    if num == loop_start:
        loop_init = i
        loop = know[i:]
        break

#print(know,start,loop)

cnt = len(loop)
if k < len(know):
    ans = know[k]
else:
    ans = loop[(k-loop_init)%cnt]
# ans = loop[k%cnt]


print(ans)
import sys

import numpy as np

readline = sys.stdin.buffer.readline


# 同じ数値が複数あるとおかしくなる
def binary_search(A, n):
    n -= 1
    left = 0
    right = len(A)-1

    if n < A[0]:
        return -1
    else:
        while left < right:
            # if right - left == 1:
            #     break

            mid = (left + right) // 2
            if A[mid] < n:
                left = mid + 1
            elif n < A[mid]:
                right = mid - 1
            else:
                left = len(A) - mid//2
                break
        if A[left] > n:
            left -= 1

        return left


def main():
    N = int(readline())
    A = np.array(list(map(int, readline().split())))
    B = np.array(list(map(int, readline().split())))
    C = np.array(list(map(int, readline().split())))

    A, B, C = np.sort(A), np.sort(B), np.sort(C)

    aa = np.zeros([N], dtype=np.int32)
    for i, b in enumerate(B):
        aa[i] = binary_search(A, b) + 1

    bb = np.cumsum(aa)

    cnt = 0
    for i, c in enumerate(C):
        m = binary_search(B, c)
        if m != -1:
            cnt += bb[m]

    print(cnt)


main()


### FIXED CODE ###

import sys

readline = sys.stdin.buffer.readline


def binary_search(A, n, p):
    if p == "+":
        n += 0.5
    else:
        n -= 0.5

    left = 0
    right = len(A) - 1

    if n < A[0]:
        return 0
    else:
        while left <= right:
            mid = (left + right) // 2
            if A[mid] < n:
                left = mid + 1
            else:
                right = mid - 1

        return left


def main():
    N = int(readline())
    A = list(map(int, readline().split()))
    B = list(map(int, readline().split()))
    C = list(map(int, readline().split()))

    A, B, C = sorted(A), sorted(B), sorted(C)

    cnt = 0
    for i, b in enumerate(B):
        ab = binary_search(A, b, "-")
        bc = N - binary_search(C, b, "+")
        cnt += ab * bc

    print(cnt)


main()
a,b,c,x =[int(input()) for _ in range(4)]

count=0

for a_num in range(a+1):
  for b_num in range(b+1):
    for c_num in range(c+1):
      if a*500+b*100+c*50==x:
        count+=1

print(str(count))


### FIXED CODE ###

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

if a > b:
print(">".join(map(str,[a,b])))
elif a < b:
print("<".join(map(str,[a,b])))
else:
print("=".join(map(str,[a,b]))) 


### FIXED CODE ###

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

if a > b:
 print("a > b")
elif a < b:
 print("a < b")
else:
 print("a == b")
n=int(input())
p=[0]*(10**6+1)
for i in range(1,int(n**0.5)+1):
    cnt=0
    while n%(i+1)==0:
        n//=i+1
        cnt+=1
    p[i+1]+=cnt
if n>1:
    p[n]+=1
ans=0
for i in p:
    for j in range(1,44):
        if j*(j+1)//2>i:
            ans+=j-1
            break
print(ans)

### FIXED CODE ###

n=int(input())
d=dict()
for i in range(1,int(n**0.5)+1):
    cnt=0
    while n%(i+1)==0:
        n//=i+1
        cnt+=1
    d[i+1]=cnt
if n>1:
    if n in d:
        d[n]+=1
    else:
        d[n]=1
ans=0
d=list(d.items())
for i,r in d:
    for j in range(1,44):
        if j*(j+1)//2>r:
            ans+=j-1
            break
print(ans)
s = input()
n = len(s)
k = 0
tmp = set()
while len(tmp) < 2:
    tmp.add(s[n // 2 + k])
    tmp.add(s[(n - 1) // 2 - k])
    k += 1
print(n // 2 + k - 1)

### FIXED CODE ###

s = input()

n = len(s)
ans = n
for i, (c1, c2) in enumerate(zip(s[:-1], s[1:])):
    if c1 == c2:
        continue
    ans = min(ans, max(i + 1, n - i - 1))

print(ans)
import numpy as np
n = int(input())
a = np.array([int(i) for i in input().split()] , dtype=np.int64)
a_ = list(map(int, input().split()))
m = 10**9+7
ans = 0
for k in range(60):
    b = (a>>k) & 1
    res = np.count_nonzero(b)
    ans += res*(n-res)*2**k
print(ans%m)

### FIXED CODE ###

import numpy as np
n = int(input())
a = np.array([int(i) for i in input().split()] , dtype=np.int64)
m = 10**9+7
ans = 0
for k in range(60):
    b = (a>>k) & 1
    res = np.count_nonzero(b)
    ans += res*(n-res)*2**k
print(ans%m)
# !/usr/bin/python3

"""
https://atcoder.jp/contests/abc151/tasks/abc151_c
Welcome at atcoder
"""


if __name__ == "__main__":
    n, m = list(map(int, input().split()))

    accepted = [False for _ in range(n+5)]
    wrong = [0 for _ in range(n+5)]
    ac = wa = 0

    for _ in range(m):
        p, s = input().split()
        p = int(p)

        if accepted[p]: continue
        elif s == "WA": wrong[p] += 1
        elif s == "AC":
            ac += 1
            wa += wrong[p]
            accepted[p] = True

    print(ac, wa)



### FIXED CODE ###

# !/use/bin/python3

"""
https://atcoder.jp/contests/abc151/tasks/abc151_a
Next Alphabate
"""

def solve(c):
    ans = ord(c)
    return chr(ans+1)

if __name__ == "__main__":
    c = input()
    print(solve(c))
S=input()
N=len(S)
print(min([max(i,N-i) for i in range(1,N) if S[i-1]!=S[i]]))

### FIXED CODE ###

S=input()
N=K=len(S)
for i in range(1,N):
    if S[i-1]!=S[i]:
        K=min(K,max(i,N-i))
print(K)
print len({map(int, raw_input().split())})

### FIXED CODE ###

print len(set(map(int, raw_input().split())))
INF = 10 ** 9 + 7

S = input()
# dp[i][j]はうしろからi桁を13で割った余りがjであるものの個数
dp = [[0] * 13 for _ in range(len(S) + 1)]
dp[0][0] = 1
mul = 1

for i in range(len(S)):
    x = S[-(i + 1)]
    if x == "?":
        for j in range(13):
            for k in range(10):
                dp[i + 1][(mul * k + j) % 13] += dp[i][j]
                dp[i + 1][(mul * k + j) % 13] %= INF
    else:
        for j in range(13):
            dp[i + 1][(mul * k + j) % 13] += dp[i][j]
            dp[i + 1][(mul * k + j) % 13] %= INF
    mul *= 10

print(dp[len(S)][5])


### FIXED CODE ###

INF = 10 ** 9 + 7

S = input()
# dp[i][j]はうしろからi桁を13で割った余りがjであるものの個数
dp = [[0] * 13 for _ in range(len(S) + 1)]
dp[0][0] = 1
mul = 1

for i in range(len(S)):
    x = S[-(i + 1)]
    if x == "?":
        for k in range(10):
            for j in range(13):
                dp[i + 1][(mul * k + j) % 13] += dp[i][j]
                dp[i + 1][(mul * k + j) % 13] %= INF
    else:
        k = int(x)
        for j in range(13):
            dp[i + 1][(mul * k + j) % 13] += dp[i][j]
            dp[i + 1][(mul * k + j) % 13] %= INF
    mul = mul * 10 % 13

print(dp[len(S)][5])
FirstLine = input()
myList  = list([int(i) for i in input().split()])
print(min(A),max(A),sum(A))


### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
print(min(a),max(a),sum(a))
import math
N = int(input())
List = [int(i) for i in input().split()]

M = []
L = [0]*(N+1)
R = [0]*(N+1)
for i in range(1,N):
    L[i]=math.gcd(L[i-1],List[i])
    R[-i]=math.gcd(R[-i+1],List[-i])
for i in range(N):
    M.append(math.gcd(L[i],R[i+1]))
print(max(M))

### FIXED CODE ###

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

def gcd(x,y):
    while y!=0:
        tmp = x
        x = y
        y = tmp%y
    return x

M = []
L = [0]*(N+1)
R = [0]*(N+1)
for i in range(1,N):
    L[i]=gcd(L[i-1],List[i])
    R[-i-1]=gcd(R[-i],List[-i+1])
for i in range(N):
    M.append(gcd(L[i],R[i+1]))
print(max(M))
S, W = map(int, input().split())
if W >= S:
    print("unsafe")
else:
    print("safe")S, W = map(int, input().split())
if W >= S:
    print("unsafe")
else:
    print("safe")

### FIXED CODE ###

S, W = map(int, input().split())
if W >= S:
    print("unsafe")
else:
    print("safe")
c = 0
while true:
    x = int(input())
    c += 1
    if x == 0:
        break
    print("Case {}: {}".format(c,x))


### FIXED CODE ###

c = 0
while True:
    x = int(input())
    c += 1
    if x == 0:
        break
    print("Case {}: {}".format(c,x))
from collections import deque
def good(x,y):
    if (x>=0 and x<h) and (y>=0 and y<w):
        return (mat[x][y] != "#")
h, w = map(int,input().split())
sh, sw = map(int,input().split())
eh, ew = map(int,input().split())
mat = []
for _ in range(h):
    s = input()
    mat.append(s)
x = [1,-1,0,0]
y = [0,0,-1,1]
dist = [[float('inf') for i in range(w)]for j in range(h)]
sh -= 1
sw -= 1
eh -= 1
ew -= 1
dist[sh][sw] = 0
queue = deque()
queue.appendleft((sh,sw))
while queue:
    m = queue.popleft()
    for d in range(4):
        nx = m[0] + x[d]
        ny = m[1] + y[d]
        if not good(nx,ny):
            continue
        if dist[nx][ny] > dist[m[0]][m[1]]:
            dist[nx][ny] =  dist[m[0]][m[1]]
            queue.appendleft((nx,ny))
    for i in range(m[0]-2,m[1]+3):
        for j in range(m[1]-2,m[1]+3):
            if not good(nx,ny):
                continue
            if dist[i][j] > dist[m[0]][m[1]] + 1:
                dist[i][j] = dist[m[0]][m[1]] + 1
                queue.append((i,j))
if dist[eh][ew] == float('inf'):
    print(-1)
else:
    print(dist[eh][ew])


### FIXED CODE ###

from collections import deque
def good(x,y):
    if (x>=0 and x<h) and (y>=0 and y<w):
        return (mat[x][y] != "#")
h, w = map(int,input().split())
sh, sw = map(int,input().split())
eh, ew = map(int,input().split())
mat = []
for _ in range(h):
    s = input()
    mat.append(s)
x = [1,-1,0,0]
y = [0,0,-1,1]
dist = [[float('inf') for i in range(w)]for j in range(h)]
sh -= 1
sw -= 1
eh -= 1
ew -= 1
dist[sh][sw] = 0
queue = deque()
queue.appendleft((sh,sw))
while queue:
    m = queue.popleft()
    for d in range(4):
        nx = m[0] + x[d]
        ny = m[1] + y[d]
        if good(nx,ny):
            if dist[nx][ny] > dist[m[0]][m[1]]:
                dist[nx][ny] =  dist[m[0]][m[1]]
                queue.appendleft((nx,ny))
    for i in range(m[0]-2,m[0]+3):
        for j in range(m[1]-2,m[1]+3):
            if good(i,j):
                if dist[i][j] > dist[m[0]][m[1]] + 1:
                    dist[i][j] = dist[m[0]][m[1]] + 1
                    queue.append((i,j))
if dist[eh][ew] == float('inf'):
    print(-1)
else:
    print(dist[eh][ew])
# ABC076C
S = input()
T = input()

for i in range(len(S) - len(T) + 1):
    if S[i] == "?" or S[i] == T[0]:
        k = 1
        flag = True
        while k < len(T):
            if S[i+k] == "?":
                k += 1
            else:
                if S[i + k] == T[k]:
                    k += 1
                else:
                    flag = False
                    break
        if k == len(T) and flag == True:
            check = i

if check != -1:
    S = list(S)
    for i in range(len(T)):
        S[check + i] = T[i]
    S = "".join(S)
    ans = S.replace("?", "a")
    print(ans)
else:
    print("UNRESTORABLE")

### FIXED CODE ###

# ABC076C
S = input()
T = input()
check = -1
for i in range(len(S) - len(T) + 1):
    if S[i] == "?" or S[i] == T[0]:
        k = 1
        flag = True
        while k < len(T):
            if S[i+k] == "?":
                k += 1
            else:
                if S[i + k] == T[k]:
                    k += 1
                else:
                    flag = False
                    break
        if k == len(T) and flag == True:
            check = i

if check != -1:
    S = list(S)
    for i in range(len(T)):
        S[check + i] = T[i]
    S = "".join(S)
    ans = S.replace("?", "a")
    print(ans)
else:
    print("UNRESTORABLE")
# -*- coding: utf-8 -*-
 
import numpy as np
import copy
from collections import deque
 
n, m = map(int, input().split())
 
# マス目と距離保存のための箱を作成
d = []
mas = []
for i in range(n):
    mas.extend(list(map(list, input().split())))
    d.append([float("nan")] * m)
 
 
def tansaku(sx, sy, d):
    local_d = copy.deepcopy(d)
    dx = [1, 0, -1, 0]
    dy = [0, 1, 0, -1]
 
    que = deque([])
    que.append((sx, sy))
    local_d[sx][sy] = 0
    while que:
        # キューの先頭を取り出す
        p = que.popleft()
        for i in range(4):
            # 移動4方向をループ
            nx = p[0] + dx[i]
            ny = p[1] + dy[i]
            if (
                0 <= nx < n
                and 0 <= ny < m
                and mas[nx][ny] != "#"
                and not local_d[nx][ny] == local_d[nx][ny]
            ):
                # 移動できるならキューに入れ，その点の距離を p からの距離 +1 で確定する．最後Nan判定
                que.append((nx, ny))
                local_d[nx][ny] = local_d[p[0]][p[1]] + 1
    d_max = max(local_d)
    return d_max
 
 
dis = 0
for i in range(n):
  	for j in range(m):
	    dis_i = tansaku(i, j, d)
    	if dis_i > dis:
        	dis = copy.copy(dis_i) 
 
print(dis)

### FIXED CODE ###

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

import numpy as np
import copy
from collections import deque

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

# マス目と距離保存のための箱を作成
d = []
mas = []
for i in range(n):
    mas.extend(list(map(list, input().split())))
    d.append([float("nan")] * m)


def tansaku(sx, sy, d):
    local_d = copy.deepcopy(d)
    dx = [1, 0, -1, 0]
    dy = [0, 1, 0, -1]

    que = deque([])
    que.append((sx, sy))
    local_d[sx][sy] = 0
    while que:
        # キューの先頭を取り出す
        p = que.popleft()
        for i in range(4):
            # 移動4方向をループ
            nx = p[0] + dx[i]
            ny = p[1] + dy[i]
            if (
                0 <= nx < n
                and 0 <= ny < m
                and mas[nx][ny] != "#"
                and not local_d[nx][ny] == local_d[nx][ny]
            ):
                # 移動できるならキューに入れ，その点の距離を p からの距離 +1 で確定する．最後Nan判定
                que.append((nx, ny))
                local_d[nx][ny] = local_d[p[0]][p[1]] + 1
    d_max = int(np.nanmax(np.array(local_d)))
    return d_max


dis = 0
for i in range(n):
    for j in range(m):
        if mas[i][j] != "#":
            dis_i = tansaku(i, j, d)
            if dis_i > dis:
                dis = copy.copy(dis_i)

print(dis)
from collections import defaultdict
from copy import deepcopy
n, m = list(map(int, input().split()))

if m%2==1:
  print(-1)
  exit()

graph = defaultdict(set)
for i in range(m):
  a, b = list(map(int, input().split()))
  a -= 1
  b -= 1
  graph[a].add(b)
  graph[b].add(a)

grapht = deepcopy(graph)
graph2 = defaultdict(set)
visited = set()
num = [1 for i in range(n)]

def dfs(x):
  visited.add(x)

  for nx in graph[x]:
    if nx not in visited:
      dfs(nx)

  t = set()
  if num[x]==1 and len(grapht[x])%2==0:
    for e in grapht[x]:
      graph2[x].add(e)
      t.add(e)
  elif num[x]==-1 and len(grapht[x])%2==0:
    for j, e in enumerate(grapht[x]):
      if j==len(grapht[x])-1:
        graph2[e].add(x)
        num[e] *= -1
      else:
        graph2[x].add(e)
      t.add(e)
  elif num[x]==1 and len(grapht[x])%2==1:
    for j, e in enumerate(grapht[x]):
      if j==len(grapht[x])-1:
        graph2[e].add(x)
        num[e] *= -1
      else:
        graph2[x].add(e)
      t.add(e)
  elif num[x]==-1 and len(grapht[x])%2==1:
    for e in grapht[x]:
      graph2[x].add(e)
      t.add(e)
  for e in t:
    grapht[x].remove(e)
    grapht[e].remove(x)

dfs(0)

for i in range(n):
  if len(graph2[i])%2==1:
    print(-1)
    exit()

for i in range(n):
  for e in graph2[i]:
    print(i+1, e+1)

### FIXED CODE ###

from collections import defaultdict
import sys

def dfs(visited, graph, grapht, graph2, num, x):
  visited[x] = 1

  for nx in graph[x]:
    if not visited[nx]:
      dfs(visited, graph, grapht, graph2, num, nx)

  t = set()
  if num[x]==1 and len(grapht[x])%2==0:
    for e in grapht[x]:
      graph2[x].add(e)
      t.add(e)
  elif num[x]==-1 and len(grapht[x]) and len(grapht[x])%2==0:
    for e in grapht[x]:
      graph2[x].add(e)
      t.add(e)
    tt = grapht[x].pop()
    graph2[tt].add(x)
    graph2[x].remove(tt)
    num[tt] *= -1
  elif num[x]==1 and len(grapht[x])%2==1:
    for e in grapht[x]:
      graph2[x].add(e)
      t.add(e)
    tt = grapht[x].pop()
    graph2[tt].add(x)
    graph2[x].remove(tt)
    num[tt] *= -1
  else:
    for e in grapht[x]:
      graph2[x].add(e)
      t.add(e)
  for e in t:
    if e in grapht[x]:
      grapht[x].remove(e)
    if x in grapht[e]:
      grapht[e].remove(x)

if __name__ == "__main__":
  sys.setrecursionlimit(1000000)
  input = sys.stdin.readline
  n, m = map(int, input().split())

  if m%2==1:
    print(-1)
    exit()

  graph = defaultdict(set)
  grapht = defaultdict(set)
  for i in range(m):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    graph[a].add(b)
    graph[b].add(a)
    grapht[a].add(b)
    grapht[b].add(a)

  graph2 = defaultdict(set)
  visited = [0]*n
  num = [1]*n

  dfs(visited, graph, grapht, graph2, num, 0)

  for i in range(n):
    if len(graph2[i])%2==1:
      print(-1)
      exit()

  for i in range(n):
    for e in graph2[i]:
      print(i+1, e+1)
import numpy as np
n = int(input())
a = 0
m = int(n**0.5)
for i in range(np.ceil(m)):
    if i**2 > n:
        break
    a += 1
print(a**2)

### FIXED CODE ###

print(int(int(input())**.5)**2)
a,b=map(int,input())
print(sum(i=i[::-1] for i in map(str,range(a,b+1))))

### FIXED CODE ###

a,b=map(int,input().split())
print(sum(i==i[::-1] for i in map(str,range(a,b+1))))
S = raw_input()
(S == '1').sum()

### FIXED CODE ###

import numpy
S = input()
print(numpy.array([i=='1' for i in S]).sum())
import math
import numpy as np
N, D = map(int, input().split())
times = int(input())  
n = [list(map(int, input().split())) for i in range(times)]
n = np.array(n)
ans = 0
for j in range(n.shape[0]):
  for i in range(n.shape[0]):
    length = np.linalg.norm(n[i]-n[j])
    aaa = math.modf(length)[0]
    if aaa < 0.00001:
      ans +=1
ans = ans - n.shape[0]
ans = int(ans/2)
print(ans)

### FIXED CODE ###

import numpy as np
import math
N, D = map(int, input().split())
 
n = [list(map(int, input().split())) for i in range(N)]
n = np.array(n)
ans = 0
for j in range(n.shape[0]):
  for i in range(n.shape[0]):
    length = np.linalg.norm(n[i]-n[j])
    aaa = math.modf(length)[0]
    if aaa < 0.00001:
      ans +=1
ans = ans - n.shape[0]
ans = int(ans/2)
print(ans)
n=int(input())
a=list(map(int,input().split()))
mod=10**9+7
d=dict()
for i in range(n):
  if a[i] not in d:
    d[a[i]]=1
  else:
    d[a[i]]+=1
d=sorted(list(d.items()))
if n%2:
  for i in range(len(d)):
    if i==0:
      if d[i][0]!=0 or d[i][1]!=1:
        print(0)
        exit()
    else:
      if d[i][0]!=i*2 or d[i][1]!=2:
        print(0)
        exit()
  print(pow(2,len(d)-1,mod)
else:
  for i in range(len(d)):
    if d[i][0]!=2*i+1 or d[i][1]!=2:
      print(0)
      exit()
  print(2,len(d),mod)

### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
mod=10**9+7
d=dict()
for i in range(n):
  if a[i] not in d:
    d[a[i]]=1
  else:
    d[a[i]]+=1
d=sorted(list(d.items()))
if n%2:
  for i in range(len(d)):
    if i==0:
      if d[i][0]!=0 or d[i][1]!=1:
        print(0)
        exit()
    else:
      if d[i][0]!=i*2 or d[i][1]!=2:
        print(0)
        exit()
  print(pow(2,len(d)-1,mod))
else:
  for i in range(len(d)):
    if d[i][0]!=2*i+1 or d[i][1]!=2:
      print(0)
      exit()
  print(pow(2,len(d),mod))
N=int(input())
S=input()
X=int(S,2)

#Sのビット数
bitcount=0
for i in range(N):
  if S[i]=='1':
    bitcount+=1

def f(n):
  c=0
  x=1
  while x<=n:
    if n&x>0:
      c+=1
    x*=2
  return n%c

ls=[0 for i in range(bitcount+2)]  
ls2=[0 for i in range(bitcount+2)]
for i in range(1,bitcount+2):
  ls[i]=f(i)
  ls2[i]=ls2[ls[i]]+1

for i in range(N):
  if S[i]=='0':
    print(ls2[(X^(2**(N-1-i)))%(bitcount+1)]+1)
  else:
    print(ls2[(X^(2**(N-1-i)))%(bitcount-1)]+1)
  

### FIXED CODE ###

N=int(input())
S=input()

#Sのビット数
bitcount=0
for i in range(N):
  if S[i]=='1':
    bitcount+=1
bp=bitcount+1
bm=bitcount-1

lsp=[1 for i in range(N)]
for i in range(1,N):
  lsp[i]=(lsp[i-1]*2)%bp
lsp.reverse()
fXp=0
for i in range(N):
  if S[i]=='1':
    fXp=(fXp+lsp[i])%bp
    
if bm!=0:
  lsm=[1 for i in range(N)]
  for i in range(1,N):
    lsm[i]=(lsm[i-1]*2)%bm
  lsm.reverse()
  fXm=0
  for i in range(N):
    if S[i]=='1':
      fXm=(fXm+lsm[i])%bm


def f(n):
  c=0
  x=1
  while x<=n:
    if n&x>0:
      c+=1
    x*=2
  return n%c

ls=[0 for i in range(bitcount+2)]  
for i in range(1,bitcount+2):
  ls[i]=ls[f(i)]+1

for i in range(N):
  if S[i]=='0':
    print(ls[(fXp+lsp[i])%bp]+1)
  else:
    if bm==0:
      print(0)
    else:
      print(ls[(fXm-lsm[i])%bm]+1)
a,b = map(int(input().split()))

print(int(((a + b) // 2)+1))


### FIXED CODE ###

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

if (a + b) % 2 == 0:
  print(int((a + b)/2))
  
else:
  print(int((a + b) // 2) +1)
from math import gcd
n, m = map(int, input().split())
a = list(map(int, input().split()))

def lcm(a, b):
    return int(a*b / gcd(a, b))
"""
ak の2を除く公約数の組み合わせ一覧のうち、M以下のものを上げれば良い？
もしakが0が含まれると、0個
"""

l = a[0]
for a_ in a[1:]:
    l = lcm(l, a_)
ans = (m // l)
if ans == 0:
    print(ans)
else:
    print(ans+1)

### FIXED CODE ###

from fractions import gcd
n, m = map(int, input().split())
a = list(map(int, input().split()))

def lcm(a, b):
    return a*b // gcd(a, b)
"""
akが偶数だから、bk=2akとして、
bk × (2p + 1)を満たすpが存在すれば良い
2p+1は奇数のため、Xとbkの2の素因数は一致しなければならない
akに含まれる最大の2^kを探す。
"""
if len(a) == 1: lcm_all = a[0]//2
else: lcm_all = lcm(a[0]//2, a[1]//2)
amax = 0
for i in range(1, n):
    lcm_all = lcm(lcm_all, a[i]//2)
    amax = max(amax, a[i]//2)

f = True
if lcm_all > m:
    f = False
for i in range(n):
    if n == 1: break
    if (lcm_all//(a[i]//2))%2 == 0:
        # akの2の約数の数がそろわないので、どんな奇数を掛けても共通のXを作れない
        f = False
if f:
    # amaxの奇数倍でmを超えないもの
    ans = (m // lcm_all + 1)//2
    print(ans)
else:
    print(0)
def euclid(a, b):
    if b == 0:
        return a
    else:
        return euclid(b, a % b)


def lcm(a, b):
    g = euclid(a, b)
    return int(a * b / g)


if __name__ == '__main__':
    N = int(input())
    ans = 1
    for i in range(N):
        T = int(input())
        ans = lcm(ans, T)

    print(ans)


### FIXED CODE ###

import decimal


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


def lcm(a, b):
    g = euclid(a, b)
    # print(g)
    # print(a * b)

    return a * b // g


if __name__ == '__main__':
    N = int(input())
    ans = 1
    for i in range(N):
        T = int(input())
        ans = lcm(ans, T)

    print(ans)
A=list(map(int,input.split()))
s=A[0]
w=A[1]

if s>w:
    return safe
else:
    return unsafe

### FIXED CODE ###


s,w=map(int,input().split())


if s>w:
    print("safe")
else:
    print("unsafe")