Harryxun/stf_run huggingface dataset:
import fractions

N = int(input())

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

s = sum(A)

gcd = A[0]

for i in range(N):
    gcd = fractions.gcd(gcd,A[i])

ans = 0
for i in range(N):

    ans += (sum(A) - A[i])//gcd
    ans =%= 10**9+7

print (ans)

### FIXED CODE ###

import fractions

def lcm(x,y):
  return x // fractions.gcd(x,y) * y


mod = 10**9+7


N = int(input())

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

B = 0
for i in A:
    B += pow(i,mod-2,mod)
    B %= mod

g = 1

for i in range(N):
    g = lcm(g,A[i])

print (g * B % mod)
b = input()

if b == A :
	print("T")
elif b == T :
	print("A")
if b == C :
	print("G")
elif b == G :
	print("C")

### FIXED CODE ###

b = str(input())

if b == "A" :
	print("T")
elif b == "T" :
	print("A")
elif b == "C" :
	print("G")
elif b == "G" :
	print("C")
n, q = map(int,input().split())
card_num = list(map(int,input().split()))
card_num.sort()
x_i = []
for i in range(q):
    x_i.append(int(input()))
for i in range(q):
    card = []
    for num in range(n):
        card.append(card_num[num])
    taka = []
    for j in range(n//2):
        temp = max(card)
        card.remove(temp)
        taka.append(temp)
        up = [x for x in card if x >= x_i[i]]
        down = [y for y in card if y < x_i[i]]
        if up == []:
            card.remove(down[-1])
        elif down == []:
            card.remove(up[0])
        elif up[0]-x_i[i]<x_i[i]-down[-1]:
            card.remove(up[0])
        else:
            card.remove(down[-1])
    if n%2==1:
        taka.append(card[0])
    print(sum(taka))

### FIXED CODE ###

N= int(input())
H= int(input())
W= int(input())
print((N-H+1)*(N-W+1))
def op_print(data,a,b):
    for i in range(a,b):
        print(data[i],end="")
    print()
def op_reverse(data,a,b):
    return data[:a] + data[::-1][-b:-a] + data[:b]
def op_replace(data,a,b,q):
    return data.replace(data[a:b],q) 

data = input()
q = int(input())
for _ in range(q):
    op = list(map(str,input().split()))
    if(op[0] == "print"):
        op_print(data,int(op[1]),int(op[2])-1)
    elif(op[0] == "reverse"):
        data = op_reverse(data,int(op[1]),int(op[2]))
    elif(op[0] == "replace"):
        data = op_replace(data,int(op[1]),int(op[2]),op[3])


### FIXED CODE ###

s=input()
for _ in range(int(input())):
    o=input().split()
    a,b=map(int,o[1:3]);b+=1
    c=o[0][2]
    if c=='p':s=s[:a]+o[3]+s[b:]
    elif c=='i':print(s[a:b])
    elif c=='v':s=s[:a]+s[a:b][::-1]+s[b:]
A,B=map(int,input().split())
if A<=8:
  print(Yay!)
if B<=8:
  print(:()

### FIXED CODE ###

A,B = map(int,input().split())
if A <= 8 and B <= 8:
  print('Yay!')
else:
  print(':(')
n,k = map(int,input().split())
h = input()
a = 0
for i in range(n):
    if h[i] > k:
        a += 1
print(a)

### FIXED CODE ###

n,k = map(int,input().split())
h = list(map(int,input().split()))
a = 0
for i in range(n):
    if h[i] >= k:
        a += 1
print(a)
from functools import lru_cache
import sys
MOD = 998244353


@lru_cache(maxsize=None)
def pow_mod(i):
    # pow(2, i - 1, MOD)
    if i == 1:
        return 1
    else:
        return pow_mod(i - 1) * 2 % MOD


def main():
    input = sys.stdin.buffer.readline
    n, s = map(int, input().split())
    a = list(map(int, input().split()))
    dp = [[None] * (s + 1) for _ in range(n + 1)]
#     dp[i][j]:=集合{1..i}の空でない部分集合T全てについて,和がjとなる部分集合の個数の和
    for i in range(n + 1):
        for j in range(s + 1):
            if i == 0 or j == 0:
                dp[i][j] = 0
                continue
            if j > a[i - 1]:
                dp[i][j] = dp[i - 1][j] * 2 + dp[i - 1][j - a[i - 1]]
            elif j == a[i - 1]:
                dp[i][j] = dp[i - 1][j] * 2 + pow_mod(i)
            else:
                dp[i][j] = dp[i - 1][j] * 2
            dp[i][j] %= MOD
    print(dp[n][s])


if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
MOD = 998244353


def main():
    input = sys.stdin.buffer.readline
    n, s = map(int, input().split())
    a = list(map(int, input().split()))
    dp = [[None] * (s + 1) for _ in range(n + 1)]
#     dp[i][j]:=集合{1..i}の空でない部分集合T全てについて,和がjとなる部分集合の個数の和
    for i in range(n + 1):
        for j in range(s + 1):
            if i == 0 or j == 0:
                dp[i][j] = 0
                continue
            if j > a[i - 1]:
                dp[i][j] = dp[i - 1][j] * 2 + dp[i - 1][j - a[i - 1]]
            elif j == a[i - 1]:
                dp[i][j] = dp[i - 1][j] * 2 + pow(2, i - 1, MOD)
            else:
                dp[i][j] = dp[i - 1][j] * 2
            dp[i][j] %= MOD
    print(dp[n][s])


if __name__ == '__main__':
    main()
import math

def main():

    def lcm(x, y):
        return (x * y) // math.gcd(x, y)

    A,B = map(int, input().split())
    print(lcm(A,B))

if __name__ == '__main__':
    main()

### FIXED CODE ###

def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

def lcm(x, y):
    return (x * y) // gcd(x, y)

def main():
    A,B = map(int, input().split())
    print(lcm(A,B))

if __name__ == '__main__':
    main()
a,b = map(int,input().split())

s = a*b
l = 2*(a+b)

return s,l


### FIXED CODE ###

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

s = a*b
l = 2*(a+b)

print(s,l)
W, H, N = list(map(int, input().split()))

X = [0] * N
Y = [0] * N
A = [0] * N

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

# print("test")
# print(W,H,N)

#solve
xb = 0
xe = W
yb = 0
ye = H

for _ in range(N):
    if A[_] == 1:
        # Xiより小さいを黒
        xb = max(xb, X[_])
    elif A[_] == 2:
        # Xiより大きいを黒
        xe = min(xe, X[_])
    elif A[_] == 3:
        # Yiより小さいを黒
        yb = max(yb, Y[_])
    else:
        # Yiより大きいを黒
        ye = min(ye, [_])
    
    # check
    if (xe - xb) <= 0 or (ye - yb) <= 0:
        print(0)
        import sys
        sys.exit()

ans = (xe - xb) * (ye - yb)
print(ans)

### FIXED CODE ###

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

X = [0] * N
Y = [0] * N
A = [0] * N

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

# print("test")
# print(W,H,N)

#solve
xb = 0
xe = W
yb = 0
ye = H

for _ in range(N):
    if A[_] == 1:
        # Xiより小さいを黒
        xb = max([xb, X[_]])
    elif A[_] == 2:
        # Xiより大きいを黒
        xe = min([xe, X[_]])
    elif A[_] == 3:
        # Yiより小さいを黒
        yb = max([yb, Y[_]])
    else:
        # Yiより大きいを黒
        ye = min([ye, Y[_]])
    
    # check
    if (xe - xb) <= 0 or (ye - yb) <= 0:
        print(0)
        import sys
        sys.exit()

ans = (xe - xb) * (ye - yb)
print(ans)
# coding: utf-8
# Your code here!
X,Y,Z,K=map(int,input().split())
A=(list(map(int,input().split())))
B=(list(map(int,input().split())))
C=sorted(list(map(int,input().split())))

ans=max(A)+max(B)+max(C)

temp=[]
for a in A:
    for b in B:
        temp.append(a+b)

temp.sort()

dif=[temp[i]-temp[i+1] for i in range(len(temp)-1)[::-1]]
dif_c=[C[i]-C[i+1] for i in range(len(C)-1)[::-1]]

dif=dif[:K]

temp=[]
for d in dif:
    for dc in dif_c:
        temp.append(d+dc)
temp.sort()
temp=temp[::-1]
for k in range(K):
    print(ans)
    ans+=temp[k]

print(temp)
#TLEでそう

### FIXED CODE ###

# coding: utf-8
# Your code here!
X,Y,Z,K=map(int,input().split())
A=(list(map(int,input().split())))
B=(list(map(int,input().split())))
C=sorted(list(map(int,input().split())))

ans=max(A)+max(B)+max(C)

temp=[]
for a in A:
    for b in B:
        temp.append(a+b)

temp.sort()

dif=[temp[i]-temp[-1] for i in range(len(temp))[::-1]]
dif_c=[C[i]-C[-1] for i in range(len(C))[::-1]]

dif=dif[:K]

temp=[]
for d in dif:
    for dc in dif_c:
        temp.append(ans+d+dc)
temp.sort()
temp=temp[::-1]

for k in range(K):
    print(temp[k])
X = int(input())
A = int(input())
B = int(input())

remain = X - A
for i in range(100000):
  if (remain - B) < 0:
    print(ans)
    break
  elif (remain - B) == 0:
    print(0)
    break
  else:
    remain -= B


### FIXED CODE ###

X = int(input())
A = int(input())
B = int(input())
ans = 0
remain = X - A
for i in range(100000):
  if (remain - B) < 0:
    ans = remain
    break
  elif (remain - B) == 0:
    ans = 0
    break
  else:
    remain -= B
print(ans)
x = map(int, input().split(" "))
z=x[0]*x[1]
a=(x[0]+x[1])*2
print(z,a)

### FIXED CODE ###

x = map(int,raw_input().split())
z=x[0]*x[1]
a=(x[0]+x[1])*2
print z,a
from collections import deque
h,w = map(int, input().split())
G = [['#']*(w+2)]
white = 0
for i in range(h):
    G.append(['#']+list(input()) + ['#'])
    white += G[i+1].count('.')
G.append(['#']*(w+2))

G[1][1] = 1
que = deque([[1,1]])
while que:
    y,x = que.popleft()
    d = G[y][x]
    for dy,dx in ((1,0),(-1,0),(0,1),(0,-1)):
        ny = y+dy
        nx = x+dx
        if G[ny][nx] == '.':
            G[ny][nx] = d+1
            que.append((ny,nx))
ans = white-G[h][w]
print(ans)


### FIXED CODE ###

from collections import deque
h,w = map(int, input().split())
G = [['#']*(w+2)]
white = 0
for i in range(h):
    G.append(['#']+list(input()) + ['#'])
    white += G[i+1].count('.')
G.append(['#']*(w+2))

G[1][1] = 1
que = deque([[1,1]])
while que:
    y,x = que.popleft()
    d = G[y][x]
    for dy,dx in ((1,0),(-1,0),(0,1),(0,-1)):
        ny = y+dy
        nx = x+dx
        if G[ny][nx] == '.':
            G[ny][nx] = d+1
            que.append((ny,nx))
if G[h][w] == '.':
    print('-1')
else:
    ans = white - G[h][w]
    print(ans)
a,b,c = map(int,input().split())
N = 100*a + 10*b + c
if c == 2 or 4 or 5 or 7 or 9 :
    print('hon')
elif c == 0 or 6 or 1 or 8 :
    print('pon')
else :
    print('bon')

### FIXED CODE ###

N = input()
n = int(N[len(N)-1] )
if n == 0 or n == 1 or n ==  6 or n == 8   :
    print('pon')
elif n == 2 or n == 4 or n == 5 or n == 7 or n == 9 :
    print('hon')
elif n == 3 :
    print('bon')
# -*- coding: Shift-JIS -*-
import sys 
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10**6)

class UnionFind:
    """素集合を木構造として管理する。"""
    def __init__(self, n):
        self.parent = [-1] * n
        self.n = n
        self.cnt = n
 
    def root(self, x):
        """要素xの代表元を求める。O(α(N))"""
        if self.parent[x] < 0:
            return x
        else:
            self.parent[x] = self.root(self.parent[x])
            return self.parent[x]
 
    def merge(self, x, y):
        """要素xを含む集合と要素yを含む集合を併合する。O(α(N))"""
        x = self.root(x)
        y = self.root(y)
        if x == y:
            return False
        if self.parent[x] > self.parent[y]:
            x, y = y, x
        self.parent[x] += self.parent[y]
        self.parent[y] = x
        self.cnt -= 1
        return True
 
    def is_same(self, x, y):
        """要素x, yが同じ集合に属するかどうかを求める。O(α(N))"""
        return self.root(x) == self.root(y)
 
    def size(self, x):
        """要素xを含む集合の要素数を求める。O(α(N))"""
        return -self.parent[self.root(x)]
 
    def count(self):
        """集合の個数を求める。O(1)"""
        return self.cnt
 
    def groups(self):
        """集合を列挙する。list[list[int]]で返す。O(N)"""
        res = [[] for _ in range(self.n)]
        for i in range(self.n):
            res[self.root(i)].append(i)
        return [group for group in res if group]

N,Q = map(int,readline().split())
uf = UnionFind(N)

for _ in range(Q):
    x,y = map(int,readline().split())
    x-=1; y-=1
    uf.merge(x,y)

print(uf.count()-1)


### FIXED CODE ###

# -*- coding: utf-8 -*-
import sys 
sys.setrecursionlimit(10**6)
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N,M = map(int,readline().split())
road = [[] for _ in range(N+1)]
visit = [0]*(N+1)

for i in range(M):
    x,y = map(int,readline().split())
    road[x].append(y)
    road[y].append(x)
  
def dfs(v,prev):
    for x in road[v]:
        if x == prev:
            continue
        if visit[x] != 0:
            continue
        visit[x] = 1
        dfs(x,v)
    return 

count = 0     
for i in range(1,N+1):
    if visit[i] == 0:
        dfs(i,-1)
        count += 1

print(count-1)
# coding=utf-8
N=int(input())
a=list(map(int,input().split()))
a.sort(reverse=True)  
alice=a[::2]　　
bob=a[1::2]　　　
print(sum(alice)-sum(bob))


### FIXED CODE ###

#coding=utf-8
N = int(input())
A = list(map(int,input().split()))
A.sort(reverse=True)
Alice = A[::2]
Bob = A[1::2]
print(sum(Alice) - sum(Bob))
A, B, C, X, Y = map(int, input().split())

if 2 * C > A + B :
  print(A * X + B * Y)
else C < min(A, B):
  print(max(X, Y) * 2 * C)
else:
  print(min(X, Y) * 2 * C + (A if X > Y else B) * abs(X-Y))


### FIXED CODE ###

A, B, C, X, Y = map(int, input().split())

print(min(min(X, Y) * 2 * C + (A if X > Y else B) * abs(X-Y), A * X + B * Y, max(X, Y) * 2 * C))
#include <bits/stdc++.h>
using namespace std;

int main() {
  int N, A;
  cin >> N >> A;
  cout << N*N-A << endl;
}


### FIXED CODE ###

N = int(input())
A = int(input())
print(N**2-A)
N = int(input())
coordinate = []
ans = -1
for _ in range(N):
    x, y, h = map(int, input().split())
    if h == 0:
        continue
    coordinate.append([x, y, h])

for cx in range(101):
    for cy in range(101):
        x1, y1, h1 = coordinate[0]
        H1 = h1 + abs(cx-x1) + abs(cy-y1)
        f = 1
        for n in range(1, N):
            x, y, h = coordinate[n]
            H = h + abs(cx-x) + abs(cy-y)
            if H == H1:
                f *= 1
            else:
                f *= 0
            if f and n == N-1:
                break
        if f:
            Cx = cx
            Cy = cy
            ans = H1
            break
    if f:
        break
        
print(Cx, Cy, ans)

### FIXED CODE ###

N = int(input())
coordinate = []
ans = -1
for _ in range(N):
    x, y, h = map(int, input().split())
    if h == 0:
        continue
    coordinate.append([x, y, h])
N = len(coordinate)
for cx in range(101):
    for cy in range(101):
        x1, y1, h1 = coordinate[0]
        H1 = h1 + abs(cx-x1) + abs(cy-y1)
        f = 1
        if N == 1:
            f = 2
            Cx = x1
            Cy = y1
            ans = h1
            break
        for n in range(1, N):
            x, y, h = coordinate[n]
            H = h + abs(cx-x) + abs(cy-y)
            if H == H1:
                f *= 1
            else:
                f *= 0
            if f and n == N-1:
                break
        if f == 1:
            Cx = cx
            Cy = cy
            ans = H1
            break
    if f:
        break
        
print(Cx, Cy, ans)
#!/usr/bin/env python3

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

    h.append(INF)
    h.append(INF)
    
    INF = 1 << 60
    dp = [INF] * 100010

    dp[0] = 0

    for i in range(N):
        dp[i + 1] = min(dp[i + 1], dp[i] + abs(h[i] - h[i + 1]))
        dp[i + 2] = min(dp[i + 2], dp[i] + abs(h[i] - h[i + 2]))

    print(dp[N-1])


if __name__ == "__main__":
    main()


### FIXED CODE ###

def main():
    N = int(input())
    h = list(map(int, input().split()))
    INF = 10**30
    h_dp = [INF] * N
    h_dp[0] = 0
    for i in range(1, N):
        h_dp[i] = min(h_dp[i], h_dp[i - 1] + abs(h[i] - h[i - 1]))
        if i > 1:
            h_dp[i] = min(h_dp[i], h_dp[i - 2] + abs(h[i] - h[i - 2]))
    print(h_dp[N - 1])


if __name__ == "__main__":
    main()
#include<bits/stdc++.h>

int main(void){
    int S;
    int h, m, s;
 
    std::cin >> S;
 
    std::cout << S / 3600 << ":" << (S / 60) % 60 << ":" << (S % 3600) % 60 << std::endl;
    return 0;
}

### FIXED CODE ###

x = int(input())
 
h = x // 3600
m = x % 3600 // 60
s = x % 60
 
print(h,m,s,sep=':')
n, k = map(int, input().split())

lis = []

for _ in range(n):
    lis.append(int(input())

lis.sort()

min = 10**10
for i in range(len(lis)-k+1):
    dist = lis[i+k-1] - lis[i]
    if min > dist: min = dist
print(min)


### FIXED CODE ###

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

lis = []

for _ in range(n):
    lis.append(int(input()))

lis.sort()

min = 10**10
for i in range(len(lis)-k+1):
    dist = lis[i+k-1] - lis[i]
    if min > dist: min = dist
print(min)
n=int(input())
a=list(map(int, input().split()))
count=0 
def h(L):
  for i in range(len(L)):
    if L[i] % 2 != 0:
      return(1)
  return(0)
while h(a) == 0:
  for j in range(n):
    a[j]=a[j]/2
  count=count+1
  
print(count)


### FIXED CODE ###

S = list(input())
print(S.count('1'))
N,K = map(int,input().split())
A = list(map(int,input().split()))
town = [[] for _ in range(N)]
visited = [0]

for i in range(N):
  town[i] = [i,A[i] - 1]

def teleport(i,con):
  goal = town[i][1]
  if goal in visited or con == N:
    return goal + 1
  else:
    visited.append(goal)
    return teleport(goal,con + 1)

l = teleport(0,0)
visited = [i + 1for i in visited]
cs = visited.index(l)
cycle = visited[cs:]

if K <= len(visited):
  print(visited[K])
else:
  K = K - len(visited) + len(cycle)
  print(cycle[K % len(cycle)])

### FIXED CODE ###

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

A = list(map(int,input().split()))
town = [[] for _ in range(N)]
visited = [0]
flag = [-1] * N

for i in range(N):
  town[i] = [i,A[i] - 1]

f = 0

while flag[f] == -1:
  t = town[f][1]
  flag[f] = t
  f = town[t][0]
  visited.append(t)
  
l = visited[-1]
lv = len(visited)

if K <= lv:
  print(visited[K] + 1)
else:
  cs = visited.index(l)
  cycle = visited[cs:-1]
  lc = len(cycle)
  print(cycle[(K - lv + 1) % lc] + 1)
##i
S = input()
K = int(input())
L = [int(i) for i in S]
count = 1
for i in L:
    if i != 1:
        if count <= K:
            print(i)
        else:
            print(1)
        exit()
    else:
        count += 1
print(1)

### FIXED CODE ###

# -*-  coding: utf-8 -*-
n,m=map(int,input().split())
print("{}".format((n-1)*(m-1)))
# -*- coding: utf-8 -*-
N = int(input())

#
X, Y = [], []
for _ in range(N):
    x, y = map(int, input().split(' '))
    X.append(x)
    Y.append(y)

#
import collections
xy_frq_dict = collections.defaultdict(int)
for i in range(N):
    for j in range(N):
        if i == j:
            continue

        x, y = X[i] - X[j], Y[i] - Y[j]
        xy_frq_dict[(x, y)] += 1

xy_frq_pairs = list(xy_frq_dict.items())
xy_frq_pairs.sort(key=lambda x: x[1])
ret = N - xy_frq_pairs[-1][1]
print(ret)





### FIXED CODE ###

# -*- coding: utf-8 -*-
N = int(input())

if N == 1:
    print(1)
    exit()

#
X, Y = [], []
for _ in range(N):
    x, y = map(int, input().split(' '))
    X.append(x)
    Y.append(y)

#
import collections
xy_frq_dict = collections.defaultdict(int)
for i in range(N):
    for j in range(N):
        if i == j:
            continue

        x, y = X[i] - X[j], Y[i] - Y[j]
        xy_frq_dict[(x, y)] += 1

xy_frq_pairs = list(xy_frq_dict.items())
xy_frq_pairs.sort(key=lambda x: x[1])
ret = N - xy_frq_pairs[-1][1]
print(ret)
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
import functools
import math

input = sys.stdin.readline
n, x = map(int, input().split())
a = input().split()
b = list(map(int, a))
b.append(x)
b.sort()
c = []
for i in range(n):
    if i <= n - 1:
        c.append(b[i + 1] - b[i])
gcd = functools.reduce(math.gcd, c)
print(gcd)


### FIXED CODE ###

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys

input = sys.stdin.readline
n, x = map(int, input().split())
a = input().split()
b = list(map(int, a))
b.append(x)
b.sort()
if len(b) == 2:
    print(b[1] - b[0])
    exit(0)
c = [abs(a - x) for a in b]


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


ans = c[0]
for i in range(len(c)):
    ans = gcd(c[i], ans)
print(ans)
import numpy as np
from numba import jit
N, K = map(int, input().split())
A = np.array(list(map(int, input().split())))

@jit   # 高速化
def imo(a, n):
    imos = np.zeros(n+1)
    for i in range(n):
        imos[max(0, i-a[i])] += 1
        imos[min(n, i+a[i])+1] -= 1

    # 累計和はnumpyの方が高速
    immo = np.zeros(n+1)
    immo = np.cumsum(imos)

    return immo[:n]


for _ in range(min[K, 41]):
    A = imo(A, N)

print(*A)

### FIXED CODE ###

import numpy as np
from numba import jit
N, K = map(int, input().split())
A = np.array(list(map(int, input().split())), dtype=np.int64)

# 高速化
@jit
def imo(a, n):
    imos = np.zeros(n+1, dtype=np.int64)
    for i in range(n):
        imos[max(0, i-a[i])] += 1
        imos[min(n, i+a[i])+1] -= 1

    # 累計和はnumpyの方が高速
    immo = np.zeros(n+1, dtype=np.int64)
    immo = np.cumsum(imos)

    return immo[:n]


for _ in range(min(K, 41)):
    A = imo(A, N)

print(*A)
X = int(input())
P = {0}
i=1
while True:
    Q = {0}
    for p in P:
        Q.add(p+i)
        Q.add(p-i)
    P = P.union(Q)
    if X in P:
        print(i)
        break
    i = i+1

### FIXED CODE ###

a,b = input().split()
if a == b:
     print('H')
else:
     print('D')
N = input()
K = input()
mod = N%K
if mod=0:
  print('0')
else:
  print('1')


### FIXED CODE ###

N, K = map(int, input().split())
if N%K == 0:
  print(0)
else:
  print(1)
from collections import defaultdict
import sys
sys.setrecursionlimit(5*sys.getrecursionlimit())
V, E = map(int, input().split())
G = defaultdict(list)
T = defaultdict(list)
for i in range(E):
    s,t = map(int, input().split())
    G[s].append(t)
    G[t].append(s)

prenum = [float('inf')] * V
lowest = [float('inf')] * V
parent = [None] * V
visited = [False] * V

def dfs(g,s,c=0,p=None):    
    visited[s] = True
    prenum[s] = c
    lowest[s] = c
    c+=1    
    for v in g[s]:
        if not visited[v]:
            parent[v] = s
            T[v].append(s)
            T[s].append(v)
            dfs(g,v,c,s)
            lowest[s] = min( lowest[s], lowest[v] )
        elif v != p:
            lowest[s] = min( lowest[s], prenum[v] )

dfs(G,0)
k = []
if len(T[0]) > 1: k.append(0)
for u in range(V):
    p = parent[u]
    if p is None or p == 0: continue
    if prenum[p] <= lowest[u]: k.append(p)
for i in sorted(set(k)):
    print(i)

### FIXED CODE ###

from collections import defaultdict
import sys
sys.setrecursionlimit(100*sys.getrecursionlimit())
V, E = map(int, input().split())
G = defaultdict(list)
T = defaultdict(list)
for i in range(E):
    s,t = map(int, input().split())
    G[s].append(t)
    G[t].append(s)

prenum = [float('inf')] * V
lowest = [float('inf')] * V
parent = [None] * V
visited = [False] * V

def dfs(g,s,c=0,p=None):    
    visited[s] = True
    prenum[s] = c
    lowest[s] = c
    c+=1    
    for v in g[s]:
        if not visited[v]:
            parent[v] = s
            T[v].append(s)
            T[s].append(v)
            dfs(g,v,c,s)
            lowest[s] = min( lowest[s], lowest[v] )
        elif v != p:
            lowest[s] = min( lowest[s], prenum[v] )

dfs(G,0)
k = []
if len(T[0]) > 1: k.append(0)
for u in range(V):
    p = parent[u]
    if p is None or p == 0: continue
    if prenum[p] <= lowest[u]: k.append(p)
for i in sorted(set(k)):
    print(i)
s = input()
x = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']
print(7-x.find(s))

### FIXED CODE ###

s = input()
x = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']
print(7-x.index(s))
a, b = map(int, input().split())
c=a＊b
print(c)

### FIXED CODE ###

a,b=map(int,input().split())
c=a*b
print(c)
INF = 10**9

N, K = map(int, input().split())
x_list = [int(i) for i in input().split()]
for i in range(N):
    if x_list[i] >= 0:
        T = i
        break
min_take_time = INF
for i in range(K+1):
    if T-K+i < 0 or T+i>N:
        continue
    if x_list[T-K+i] *  x_list[T+i-1] <= 0:
        take_time = min(abs(x_list[T-K+i]), abs(x_list[T+i-1])) * 2 + max(abs(x_list[T-K+i]), abs(x_list[T+i-1]))
    else:
        take_time = max(abs(x_list[T-K+i]), abs(x_list[T+i-1]))
    min_take_time = min(min_take_time, take_time)


print(min_take_time)

### FIXED CODE ###

INF = 10**9

N, K = map(int, input().split())
x_list = [int(i) for i in input().split()]
for i in range(N):
    if x_list[i] >= 0:
        T = i
        break
else:
    print(abs(x_list[-K]))
    exit()
min_take_time = INF
for i in range(K+1):
    if T-K+i < 0 or T+i>N:
        continue
    if x_list[T-K+i] *  x_list[T+i-1] <= 0:
        take_time = min(abs(x_list[T-K+i]), abs(x_list[T+i-1])) * 2 + max(abs(x_list[T-K+i]), abs(x_list[T+i-1]))
    else:
        take_time = max(abs(x_list[T-K+i]), abs(x_list[T+i-1]))
    min_take_time = min(min_take_time, take_time)


print(min_take_time)