Harryxun/stf_run huggingface dataset:
R, G, B, N = map(int, input().split())

ans = 0
rsum = 0
for r in range(0, N+1):
    rsum += R
    if N < rsum:
        break
    rgsum = rsum
    for g in range(0, N+1):
        rgsum += G
        if N < grsum:
            break
        left = N - rgsum
        if left % B == 0:
            ans += 1

print(ans)


### FIXED CODE ###

R, G, B, N = map(int, input().split())

ans = 0
rsum = 0
for r in range(0, N+1):
    if N < rsum:
        break
    rgsum = rsum
    for g in range(0, N+1):
        if N < rgsum:
            break
        left = N - rgsum
        if left % B == 0:
            ans += 1
        rgsum += G
    rsum += R

print(ans)
S = input()
K = int(input())

l = len(S)
pair = []
current = S[0]
seq = 1
for i in range(1, l):
    if(i == l-1):
        if(S[i]==current):
            seq += 1
        if(seq != 1):
            pair.append(seq)
    elif(S[i] == current):
        seq += 1
    else:
        if(seq != 1):
            pair.append(seq)
        seq = 1
        current = S[i]

ans = 0
#print(pair)
if(S[0] != S[l-1]):
    for i in range(len(pair)):
        ans += K * (pair[i]//2)
else:
    if(S[l-2] != S[l-1]):
        pair.append(1)
    if(len(pair) == 1):
        ans += ((pair[0]+1)//2)*(K-1) + (pair[0]//2)
    else:
        for i in range(len(pair)-1):
            ans += K * i
        ans += ((pair[i+1]+1)//2)*(K-1) + (pair[i+1]//2)

print(ans)

### FIXED CODE ###

S = input()
K = int(input())

S += "1"
l = len(S)
pair = []
current = S[0]
seq = 1
for i in range(1, l):
    if(i == l):
        pair.append(seq)
    elif(S[i] == current):
        seq += 1
    else:
        pair.append(seq)
        seq = 1
        current = S[i]

ans = 0
#print(pair)
if(len(pair) == 1):
    ans += (K * pair[0])//2
elif(S[0] != S[l-2]):
    for i in range(len(pair)):
        ans += K * (pair[i]//2)
else:
    for i in range(1, len(pair)-1):
        ans += K * (pair[i]//2)
    ans += (pair[0]//2) + (pair[i+1]//2) + ((pair[0]+pair[i+1])//2)*(K-1)

print(ans)
a = input()

b = int(a[0:1])
c = int(a[1:1])
d = int(a[2:1])

ball = 0

if(b == 1):
  ball += 1

if(c == 1):
  ball += 1

if(d == 1):
  ball += 1
  
print(ball)

### FIXED CODE ###

a = input()
b = int(a[0:1])
c = int(a[1:2])
d = int(a[2:3])

ball = 0

if(b == 1):
  ball += 1

if(c == 1):
  ball += 1

if(d == 1):
  ball += 1
  
print(ball)
n = int(input())
divisors = []
for i in range(1, int(pow(n, 0.5)) + 1):
    if n % i == 0:
        if i != n // i:
            divisors.append([i, n // i])
        else:
            divisors.append([i])
divisors = sorted(divisors, key= lambda x:x[1])
res = divisors[0][0] - 1 + divisors[0][1] - 1
print(res)

### FIXED CODE ###

import math

n = int(input())
divisors = []
for i in range(1, int(n**0.5) +1):
    if n % i == 0:
        divisors.append(i)
        if i != n // i:
            divisors.append(n//i)

ans = math.pow(10, 12)
tmp = 0
for i in divisors:
    j = n / i
    tmp = i + j -2
    if tmp < ans:
        ans = tmp

print(int(ans))
n=int(input())
ans=0
for i in range(n):
    x,u=map(int,input().split())
    x=float(x)
    if u == 'BTC':
        x=x*380000.
    ans+=x
print(ans)

### FIXED CODE ###

n=int(input())
ans=0
for i in range(n):
    x,u=input().split()
    x=float(x)
    
    if u == 'BTC':
        x=x*380000.
    ans+=x
print(ans)
n = int(raw_input())
s = map(int, raw_input().split())
m = int(raw_input())
t = map(int, raw_input().split())

s = list(set(s))
s.sort()
l = len(s)-1

count = 0
for i in t:
    while low <= high:
        low = 0
        high = l
        mid = (low+high)/2
        if s[mid] == i:
            count += 1
            break
        if s[mid] < i:
            low = mid+1
        else:
            high = mid-1

print count

### FIXED CODE ###

n = int(raw_input())
s = map(int, raw_input().split())
m = int(raw_input())
t = map(int, raw_input().split())

s = list(set(s))
s.sort()
l = len(s)-1

count = 0
for i in t:
    low = 0
    high = l
    while low <= high:
        mid = (low+high)/2
        if s[mid] == i:
            count += 1
            break
        if s[mid] < i:
            low = mid+1
        else:
            high = mid-1

print count
# -*- coding: utf-8 -*-
import sys
import itertools
N,K=map(int, sys.stdin.readline().split())
cnt=(N-1)*(N-2)/2 #距離2の組み合わせができる最大の通り数
if cnt<K:
    print -1
    quit()
L=list( itertools.combinations(range(1,N+1),2) )

M=N-1+cnt-K
print M
for i in range(N-1):
    print L[i][0],L[i][1]

if N,K==100,0:
    for i in range(N,N+cnt-K-1):
            print L[i][0],L[i][1]
else:
    for i in range(N,N+cnt-K):
            print L[i][0],L[i][1]


### FIXED CODE ###

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

torisu=(N-1)*(N-2)/2

if torisu<K:
	print -1
	quit()

print N-1+(torisu-K)

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

cnt=0
for i in range(2,N+1):
	for j in range(i+1,N+1):
		if cnt==torisu-K:
			quit()
		print i,j
		cnt+=1
n = int(input())
  for i in range(n + 1):
      if i != 0 and i % 3 == 0:
          print('', i,end='')
      elif '3' in str(i):
          print('', i,end='')

### FIXED CODE ###

n = int(input())
for i in range(n + 1):
    if i != 0:
        if i % 3 == 0 or '3' in str(i):
            print('',i,end='')                                                  
print()
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
ans = 0

for i in range(n):
    print(a,b)
    if b[i] >= sum(a[i:i+2]):
        ans += sum(a[i:i+2])
        a[i+1] = 0
    elif a[i] >= b[i]:
        ans += b[i]
    elif a[i] < b[i]:
        ans += b[i]
        a[i+1] -= b[i] - a[i]
print(ans)

### FIXED CODE ###

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

for i in range(n):
    if b[i] >= sum(a[i:i+2]):
        ans += sum(a[i:i+2])
        a[i+1] = 0
    elif a[i] >= b[i]:
        ans += b[i]
    elif a[i] < b[i]:
        ans += b[i]
        a[i+1] -= b[i] - a[i]
print(ans)
n=int(input())
l=list(map(int,input().split()))
if(0 in l):
  print(0)
else:
  p=1
  for i in l:
      p*=i
      if(p>1000000000000000000):
          print(-1)
          exit()
  print(p)


### FIXED CODE ###

x,y=map(int,input().split())
print(x*y)
X = int(input())
c = 0
for a in range(-118, 119):
  for b in range(-118, 119):
    Y = a ** 5 - b ** 5
    if Y == X:
      A = a
      B = b
      print(A, B)
      c = 1
      break
    if c ==1:
      break

### FIXED CODE ###

S = input()
if S == "ABC":
  print("ARC")
else:
  print("ABC")
import math
N = input()
A = list(map(int, input().split()))

f,e,d = 0,0,0

for a in A:
    x = a % 4
    if(x==0):
        f = f+1
    elif(x==2):
        e = e+1
    else:
        d = d+1
if(e>0): d = d+1
if(d <= math.ceil(len(A)/2)):
    print("Yes")
else:
    print("No")

### FIXED CODE ###

s = input()
print(s[0] + str(len(s)-2) + s[len(s)-1])
def main():
    _ = input()
    li1 = [int(x) for x in input().split()]
    _ = input()
    li2 = [int(x) for x in input().split()]
    count = 0

    for l in li2:
        if binary_search(li1, l):
            count += 1

    print(count)


def binary_search(li, x):
    if len(li) == 0:
        return False
    
    mid = len(li)//2
    
    k = li[mid]
    if k == x:
        return True
    elif k > x:
        li = li[:mid]
    else:
        li = li[mid+1:]
        
    return binary_search(li, x)

if __name__='__main__':
    main()


### FIXED CODE ###

import array

def main():
    n1 = int(input())
    li1 = array.array('l', [int(x) for x in input().split()])
    n2 = int(input())
    li2 = array.array('l', [int(x) for x in input().split()])
    count = 0

    for l in li2:
        if binary_search(li1, l):
            count += 1

    print(count)


def binary_search(li, x):
    if len(li) == 0:
        return False
    
    mid = len(li)//2
    
    k = li[mid]
    if k == x:
        return True
    elif k > x:
        li = li[:mid]
    else:
        li = li[mid+1:]
        
    return binary_search(li, x)

if __name__=='__main__':
    main()
import numpy as np

H, W = map(int, input().split(" "))

lines = np.asarray([list(input().replace("\n", "")) for h in range(H)])

h_indexs, w_indexs = map(set, np.where(lines == "#"))

outlines = lines[list(h_indexs), :][:, list(w_indexs)]
for outline in outlines:
    print("".join(outline))

### FIXED CODE ###

import numpy as np

inputs = raw_input().replace("\n", "")
H, W = map(int, inputs.split(" "))

lines = np.asarray([list(raw_input().replace("\n", "")) for h in xrange(H)])

h_indexs, w_indexs = map(set, np.where(lines == "#"))

outlines = lines[list(h_indexs), :][:, list(w_indexs)]
for outline in outlines:
    print "".join(outline)
if a == 0:
    print(0)
else:
    ans = (int(n / (a+b)) * a)
    if n % (a+b) > a:
        print(ans + a)
    else:
        print(ans + (n % (a+b)))

### FIXED CODE ###

n,a,b,=map(int, input().split())
if a == 0:
    print(0)
else:
    ans = (int(n / (a+b)) * a)
    if n % (a+b) > a:
        print(ans + a)
    else:
        print(ans + (n % (a+b)))
A = int(input())
B= int(input())
if A > 9 or B > 9:
	print(-1)
else
	print(A*B)

### FIXED CODE ###

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

if A > 9 or B > 9:
	print(-1)
else:
	print(A*B)
s=input()
l=len(s)
T=753
c=[None]*(l-2)
for s in range(l-2):
	c[s]=abs(int(s[s:(s+3)])-T)
print(min(c))


### FIXED CODE ###

s=input()
l=len(s)
T=753
c=[None]*(l-2)
for sp in range(l-2):
	c[sp]=abs(int(s[sp:(sp+3)])-T)
print(min(c))
N,K = list(map(str, input().split()))
D = sorted(input().split())
W = []
P = ""

for i in range(10):
    if str(i) not in D:
        W.append(str(i))

for i in range(len(N)):
    for j in range(len(W)):
        if N[i] <= W[j]:
            P += W[j]
            break

print(int(P))

### FIXED CODE ###

N,K = list(map(int, input().split()))
D = sorted(input().split())
W = []
for i in range(10):
    if str(i) not in D:
        W.append(i)

while True:
    cnt = 0
    for i in range(len(W)):
        cnt += str(N).count(str(W[i]))
    if cnt == len(str(N)):
        break
    N += 1

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

print(max(A * 10 + B + C, A + N * 10 + C))

### FIXED CODE ###

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

t = sorted([A, B, C])
print(t[0] + t[1] + t[2] * 10)
n, m = map(int,input().split())

la = []
for i in range(n):
    a, b = map(int, input().split())
    la.append([a,b])

ca = []
for i in range(n):
    a, b = map(int, input().split())
    ca.append([a,b])

for i in la:
    mi = 1000000001
    ans = 0
    for k,j in enumerate(ca):
        if abs(i[0]-j[0]) + abs(i[1]-j[1]) < mi:
            mi = abs(i[0]-j[0]) + abs(i[1]-j[1])
            ans = k+1
    print(ans)



### FIXED CODE ###

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

la = []
for i in range(n):
    a, b = map(int, input().split())
    la.append((a,b))

ca = []
for i in range(m):
    a, b = map(int, input().split())
    ca.append((a,b))

for i in range(len(la)):
    mi = 1000000001
    ans = 0
    for j in range(len(ca)):
        p = abs(la[i][0]-ca[j][0]) + abs(la[i][1]-ca[j][1])
        if  p < mi:
            mi = p
            ans = j+1
    print(ans)
input(a)

a**2 + a**3 + a**4 = Z
print("Z")

### FIXED CODE ###

a = int(input())
print(a + a**2 + a**3)
from sys import stdin
a = int(stdin.readline().rstrip())



### FIXED CODE ###

li = list(map(int, input().rstrip().split()))

if (li[0] * li[1]) % 2 == 0:
  print("Even")
else:
  print("Odd")
class UnionFind:
    def __init__(self, n):
        self.par = list(range(n)) #親
        self.rank = [0] * n #根の深さ

    # xの属する根を求める
    def find(self, x):
        if self.par[x] == x:
            return x
        else:
            self.par[x] = self.find(self.par[x])
            return self.par[x]

    # 併合
    def unite(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x == y:
            # if they have the same parent, no need to union
            return
        if self.rank[x] < self.rank[y]:
            self.par[x] = y
        else:
            self.par[y] = x
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1

    # xとyが同じ集合に属するかを判定（同じ根に属するか）
    def same(self, x, y):
        return self.find(x) == self.find(y)


N, M = map(int, input().split())
uf = UnionFind(N)

for _ in range(M):
    a, b = map(int, input().split())
    uf.unite(a-1, b-1)

cnt = [0] *n
for i in range(N):
    cnt[uf.par[i]] += 1
print(max(cnt))

### FIXED CODE ###

class UnionFind:
    # 作りたい要素数nで初期化
    # 使用するインスタンス変数の初期化
    def __init__(self, n):
        self.n = n
        # root[x]<0ならそのノードが根かつその値が木の要素数
        # rootノードでその木の要素数を記録する
        self.root = [-1]*(n+1)
        # 木をくっつける時にアンバランスにならないように調整する
        self.rank = [0]*(n+1)

    # ノードxのrootノードを見つける
    def findRoot(self, x):
        if(self.root[x] < 0): # 根
            return x
        else:
            # ここで代入しておくことで、後の繰り返しを避ける
            self.root[x] = self.findRoot(self.root[x])
            return self.root[x]
    # 木の併合、入力は併合したい各ノード
    def unite(self, x, y):
        # 入力ノードのrootノードを見つける
        x = self.findRoot(x)
        y = self.findRoot(y)
        # すでに同じ木に属していた場合
        if x == y:
            return 
        # 違う木に属していた場合rankを見てくっつける方を決める
        if self.rank[x] > self.rank[y]:
            self.root[x] += self.root[y]
            self.root[y] = x

        else:
            self.root[y] += self.root[x]
            self.root[x] = y
            # rnkが同じ（深さに差がない場合）は1増やす
            if self.rank[x] == self.rank[y]:
                self.rank[y] += 1
    # xとyが同じグループに属するか判断
    def isSameGroup(self, x, y):
        return self.findRoot(x) == self.findRoot(y)

    # ノードxが属する木のサイズを返す
    def count(self, x):
        return -self.root[self.findRoot(x)]

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

for i in range(m):
    x, y = map(int,input().split())
    union.unite(x, y)

ans = 0

for i in range(n):
    ans = max(union.count(i), ans)

print(ans)
n, m = list(map(int, input().split()))
AB = [[int(x) for x in input().split()] for _ in range(m)]

# representation matrix
repn = [[] for j in range(n)]
for a, b in AB:
    a -= 1
    b -= 1
    repn[a].append(b)
    repn[b].append(a)


# Minimum Spanning Tree
tree = [[] for i in range(n)]
visited = [True] + [False] * (n - 1)
q = [0]

while q:
    u = q.pop()
    for v in repn[u]:
        if visited[v]:
            continue
        visited[v] = True
        tree[u].append(v)
        tree[v].append(u)
        q.append(v)


# define directions of the edges other than that of MST
degree = [0] * n
ans = []

for a, b in AB:
    a -= 1
    b -= 1
    if b in tree[a]:
        continue
    ans.append('{} {}'.format(a + 1, b + 1))
    degree[a] += 1


# defining orientations
def dfs(u = 0, parent = None):
    for v in tree[u]:
        if v == parent:
            continue
        dfs(v, u)
        if degree[v] % 2 == 0:
            ans.append('{} {}'.format(u + 1, v + 1))
            degree[u] += 1
        else:
            ans.append('{} {}'.format(v + 1, u + 1))
            degree[v] += 1

dfs()


# output answer
if degree[0] % 2 == 1:
    print(-1)
else:
    print('\n'.join(ans))


### FIXED CODE ###

from collections import deque

N = int(input())
A = deque(map(int, input().split()))
first = A.popleft()


def round(a):
        B = list(A)
        eval = 0
        pre = first
        post = a
        B.remove(a)
        num = N - 2
        while num != 0:
                c = pre ^ post
                try:
                        B.remove(c)
                        pre = post
                        post = c
                        num -= 1
                except:
                        return 0
                        eval = 1
                        break
        
        if eval == 0 and post ^ first == a:
                return 1
        elif eval == 0:
                return 0

val = first
for i in range(N - 1):
        val = val ^ A[i]

if val != 0:
        print('No')
else:
        ans = 0
        for i in range(0, N - 1):
                ans = round(A[i])
                if ans == 1:
                        print('Yes')
                        break
                        

        if ans == 0:
                print('No')
def dfs(n):
    s = str(format(n, "b"))
    c = s.count("1")
    return l[n % c] + 1
n = int(input())
x = input()
xi = int(x, 2)
c = x.count("1")
l = [0]
for i in range(1, 2 ** n):
    l.append(dfs(i))
for i in range(n):
    k = 0
    if x[i] == "1":
        m = xi - pow(2, n - i - 1)
        c2 = c - 1
    else:
        m = xi + pow(2, n - i - 1)
        c2 = c + 1
    print(dfs(m))

### FIXED CODE ###

def dfs(n):
    if n == 0:return 0
    return dfs(n % format(n, "b").count("1")) + 1
n = int(input())
x = input()
c = x.count("1")
a = int(x, 2)
if c == 1:
    for i in range(n):
        if x[i] == "1":
            print(0)
        elif i == n - 1:
            print(2)
        else:
            print(1)
else:
    j, k = a % (c + 1), a % (c - 1)
    for i in range(n):
        if x[i] == "1":print(dfs((k - pow(2, n - i - 1, c - 1)) % (c - 1)) + 1)
        else:print(dfs((j + pow(2, n - i - 1, c + 1)) % (c + 1)) + 1)
#include <iostream>
#include <string>
using namespace std;
int main()
{
    string s, t;
    cin >> s >> t;
    cout << t+s;
}

### FIXED CODE ###

s, t = input("").split(" ")
res = t + s
print(res)
k=int(input())
a,b=map(int,input().split())

for i in 1000:
 if a<=k*i<=b:
  print("OK")
 else:
  pass
print("NG")

### FIXED CODE ###

k=int(input())
a,b=map(int,input().split())
 
for i in range(10000):
 if a<=k*i<=b:
  print("OK")
  exit()
 else:
  pass
print("NG")
import math
n,x=map(int,input().split())
print(4*(n-math.gcd(n,x)))

### FIXED CODE ###

from fractions import gcd
n,x=map(int,input().split())
print(3*(n-gcd(n,x)))
N = int(input())

a_s = input().split()

for i in ragne(3*N):
  a_s[i] = int(a_s[i])
  
a_s = sorted(a_s)

a_1 = a_s[:N]
a_2 = a_s[N:]

ans = sum(a_2[0::2])

print(ans)


### FIXED CODE ###

N = int(input())

a_s = input().split()

for i in range(3*N):
  a_s[i] = int(a_s[i])
  
a_s = sorted(a_s)

a_1 = a_s[:N]
a_2 = a_s[N:]

ans = sum(a_2[0::2])

print(ans)
# ID
n,m=map(int,input().split())
s=[[] for _ in range(m)]
for i in range(m):
    p,y=map(int,input().split())
    s[p-1].append([y,i])

for i in range(len(s)):
    s[i].sort()

ans=[]
for i,ss in enumerate(s):
    for j,sss in enumerate(ss):
        id_no=''
        id_no+='0'*(6-len(str(i+1)))+str(i+1)
        id_no+='0'*(6-len(str(j+1)))+str(j+1)
        s[i][j].append(id_no)

for i,ss in enumerate(s):
    for j,sss in enumerate(ss):
        ans.append(s[i][j])
ans.sort(key=lambda x:x[1])
for aa in ans:
    print(aa[2])



### FIXED CODE ###

n, m = map(int, input().split())
py = []
for _ in range(m):
  py.append(list(map(int,input().split())) + [0])

sortPy = sorted(py, key = lambda x : (x[0], x[1]))
 
d = {}
for i, (p, y, n) in enumerate(sortPy):
  if p in d:
    d[p] += 1
  else:
    d[p] = 1
  sortPy[i][2] = d[p]

for p, y, n in py:
  print(str(p).zfill(6) + str(n).zfill(6))
s = input()
k = int(input())
for c in range(len(s)):
    if s[c] == "1":
        k -= 1
        if k >= 0:
            print(1)
            break
    else:
        print(s[c])
        break

### FIXED CODE ###

a,b = map(int,input().split())
print((a-1)*(b-1))
N,M = map(int,input().split)
a = int((N * (N-1) + M * (M-1)) / 2)
print(a)


### FIXED CODE ###

N, M = map(int,input().split())
a = int((N * (N-1) + M * (M-1)) / 2)
print(a)
def main():
    n,k = map(int,input().split())
    a = list(sorted(map(int,input().split())))
    mi = 0
    MA = a[n-1]
    if(k == 0):
        print(MA)
        return
    while(True):
        m = mi + (MA - mi)//2
        #print(mi,m,MA)
        count = 0
        for i in a:
            count += i//m
        if(MA < mi):
            print(mi)
            break
        if(k < count):
            mi = m+1
        else:
            MA = m-1
        




if __name__ == "__main__":
    main()

### FIXED CODE ###

def main():
    n,k = map(int,input().split())
    a = list(sorted(map(int,input().split())))
    mi = 0
    MA = a[n-1]
    if(k == 0):
        print(MA)
        return
    while(True):
        m = mi + (MA - mi)//2
        if(MA == 1):
            print(1)
            return
        count = 0
        for i in a:
            plus = i//m - 1 if i%m == 0 else i//m 
            count += plus
        if(MA - mi <= 0):
            if(k >= count):
                print(m)
            else:
                print(mi)
            break
        if(k < count):
            mi = m+1
        else:
            MA = m
        





if __name__ == "__main__":
    main()
A = int(input())
  
B = A // 10
C = B // 10

  if A % 10 == 7:
   print ("Yes")

elif B % 10 == 7:
     print ("Yes")
  
elif C % 10 == 7:
  print ("Yes")
else:
  print ("No")

### FIXED CODE ###

import sys
input = sys.stdin.readline

A = int(input())
      
B = A // 10
C = B // 10
 
if A % 10 == 7:
  print ("Yes")
elif B % 10 == 7:
  print ("Yes")
elif C % 10 == 7:
  print ("Yes")
else:
  print ("No")
import numpy as np
n =int(input())
a = list(map(float,input().split()))


b = sum(np.reciprocal(a))

print(np.reciprocal(b))

### FIXED CODE ###

import numpy as np
n =int(input())
a = list(map(float,input().split()))

b = sum(np.reciprocal(a))

print(np.reciprocal(b))
a=int(input());b=int(input());print('EQUAL' if a==b else 'GREATER' if a>b else 'LESS')

### FIXED CODE ###

print(*[x[0].swapcase() for x in input().split()],sep='')
k = int(input())
s = input()
        
length = len(s)
if length > K:
    S = S[:K]+"..."
print(S)


### FIXED CODE ###

k = int(input())
s = input()
        
length = len(s)
if length > k:
    s = s[:k]+"..."
print(s)
N,M = map(int,input().split())
pos=["-"]*N
l,r,d=map(int,input().split())
pos[l-1]=0
pos[r-1]=pos[l-1]+d
for i in range(1,M):
  l,r,d=map(int,input().split())
  if pos[r-1]=="-":
    pos[r-1] = pos[l-1]+d
  elif pos[r-1]==pos[l-1]+d:
    continue
  else:
    print("No")
    exit()
print("Yes")

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**9)

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

for _ in [0]*M:
  a, b, d = map(int, input().split())
  a -= 1
  b -= 1
  G[a].append((b, d))
  G[b].append((a, -d))

X = [None]*N

def dfs(i, x=0):
  for j, d in G[i]:
    if X[j] is None:
      X[j] = x+d
      dfs(j, x+d)
    elif X[j] != x+d:
      print('No')
      exit()

for i in range(N):
  if X[i] is not None:
    continue
  X[i] = 0
  dfs(i)
print('Yes')
n, a, b = map(int, input().split())

t = n//(a+b)

if t == 0 and n < a:
    c += n
    print(c)
elif t == 0 and n >= a:
    c += a
    print(a)
elif t > 0:
    c += t * a
    r = n%(a+b)
    if r == 0:
        print(c)
    elif r < a:
        c += r 
        print(c)
    elif r > a:
        c += a
        print(c)

### FIXED CODE ###

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

t = n//(a+b)
c=0

if t == 0 and n < a:
    c += n
    print(c)
elif t == 0 and n >= a:
    c += a
    print(c)
elif t > 0:
    c += t * a
    r = n%(a+b)
    if r == 0:
        print(c)
    elif r < a:
        c += r 
        print(c)
    elif r > a:
        c += a
        print(c)
S = list(input())
T = list(input())

if S == T:
  print(counter)
  exit()
  
counter = 0 
for i in range(len(S)):
  if T[i] != S[i]:
    counter += 1
    if S == T:
      break
  i += 1
  
print(counter)

### FIXED CODE ###

S = list(input())
T = list(input())
i = 0
counter = 0

if S == T:
  print(counter)
  exit()
  
for i in range(len(S)):
  if T[i] != S[i]:
    counter += 1
    if S == T:
      break
      
print(counter)