Harryxun/stf_run huggingface dataset:
N = int(input())
A = str(input())

if (N % 2 == 0):
  if (A[:N/2] == A[N/2:]):
    print("Yes")
  else:
    print("No")
else:
  print("No")


### FIXED CODE ###

N = int(input())
A = str(input())

if (N % 2 == 0):
  if (A[:N//2] == A[N//2:]):
    print("Yes")
  else:
    print("No")
else:
  print("No")
s = input()
n = len(s)
N = (int(s)//2019) + 1
ans = 0
P = [0] * N
for i in range(N):
  P[i] = str(i*2019)

for p in P:
  k = s.find(p)
  if k != -1:
    ans += 1
    while k >= 0:
      k = s[k+1:].find(p)
      if k != -1:ans += 1

print(ans)

### FIXED CODE ###

S = input()
S = S + '0'
mod = 2019
p = [0] * mod
r = 0
d = 1
for s in reversed(S):
  t = int(s)%mod
  r += t*d
  r %= mod
  d = d*10%mod
  p[r] += 1

print(sum([i*(i-1)//2 for i in p]))
max = 0
i = 0
j = 0
k = 0
n_max = 0

n_max = int(raw_input())
price = [1,2,3,4,5,6]
for i in range(6):
    if max <= price[j] - price[i]:
    print max

### FIXED CODE ###

import sys

n = int(raw_input())

min_R = int(raw_input())
nums = map(int, sys.stdin.readlines())

ans = -10**9

for num in nums:
    if num - min_R > ans:
        ans = num - min_R
    if num < min_R:
        min_R = num
        
print ans
s = list(input())
t = list(input())
s_copy = s
ans_list = []
n = len(s)
m = len(t)
flag = 0
flag_2 = 0
for i in range(n):
  if s[i] == "?" or s[i] == t[flag]:
    if flag == m-1:
      flag_2 = 1
      for j in range(flag,-1,-1):
        s[i-(m-1-j)] = t[j]
      ans_list.append(s)
      s = s_copy
    else:
      flag += 1
  else:
    flag = 0
x = len(ans_list)
if flag_2 == 1:
  for l in range(x):
    for k in range(n):
      if s[l][k] == "?":
        s[l][k] = "a"
  ans_list.sort()
  print("".join(ans_list[0]))
else:
  print("UNRESTORABLE")

### FIXED CODE ###

import copy
s = list(input())
t = list(input())
ans_list = []
n = len(s)
m = len(t)
for i in range(n-m+1):
  s_copy = copy.copy(s)
  judgement = True
  for j in range(m):
    if s_copy[i+j] != "?" and s_copy[i+j] != t[j]:
      judgement = False
      break
    else:
      s_copy[i+j] = t[j]
  if judgement:
    ans_list.append(s_copy)
x = len(ans_list)
if ans_list != []:
  for l in range(x):
    for k in range(n):
      if ans_list[l][k] == "?":
        ans_list[l][k] = "a"
  ans_list.sort()
  print("".join(ans_list[0]))
else:
  print("UNRESTORABLE")
from sys import stdin, stdout
rl = lambda: stdin.readline()
rll = lambda: stdin.readline().split()
rli = lambda: map(int, stdin.readline().split())

INF, NINF = float('inf'), float('-inf')

def main():
	n, W = rli()
	weight = [0 for _ in range(n)]
	val = [0 for _ in range(n)]
	for i in range(n):
		w, v = rli()
		weight[i], val[i] = w, v
	#dp(i, j) = max val using items 1,...,i at 
	#			weight j

	dp = [[NINF for c in range(W+1)] for r in range(n+1)]
	for r in range(n+1):
		dp[r][0] = 0
	for c in range(W+1):
		dp[0][c] = 0
	for r in range(1, n+1):
		w, v = weight[r-1], val[r-1]
		for c in range(1, W+1):
			if c - w < 0:
				dp[r][c] = max(dp[r][c], dp[r-1][c])
			else:
				dp[r][c] = max(dp[r][c], dp[r-1][c], v + dp[r-1][c-w])
	print(dp[-1][-1])
	stdout.close()

if __name__ == "__main__":
	main()

### FIXED CODE ###

from sys import stdin, stdout
from collections import deque, defaultdict
import math as m

rl = lambda: stdin.readline()
rll = lambda: stdin.readline().split()
rli = lambda: map(int, stdin.readline().split())

INF, NINF = float('inf'), float('-inf')

def main():
	n, W = rli()
	items = []
	maxval = 0
	for _ in range(n):
		w, v = rli()
		maxval += v
		items.append((w, v))

	dp = [INF for _ in range(maxval + 1)]
	dp[0] = 0
	for w, v in items:
		for i in range(maxval, -1, -1):
			if i - v >= 0:
				dp[i] = min(dp[i], dp[i-v] + w)
	ans = NINF
	for val, minweight in enumerate(dp):
		if minweight <= W:
			ans = val
	print(ans)
	stdout.close()

if __name__ == "__main__":
	main()
A, B = map(int, input().split())
print(max[A + B, A - B, A * B])

### FIXED CODE ###

A, B = map(int, input().split())
print(max([A + B, A - B, A * B]))
inp = list(map(int, input().split()))

A = inp[0]
B = inp[1]
K = inp[2]

# 約数を求める
yakusuu_a = []
yakusuu_b = []

for i in range(1,A):
    if A % i == 0:
        yakusuu_a.append(i)

for i in range(1,B):
    if B % i == 0:
        yakusuu_b.append(i)

c = []
for i in yakusuu_a:
  for j in yakusuu_b:
    if i == j:
      c.append(i)

c.sort()
print(c[K-1])

### FIXED CODE ###

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

A = inp[0]
B = inp[1]
K = inp[2]

# 約数を求める
yakusuu_a = []
yakusuu_b = []

for i in range(1,A+1):
    if A % i == 0:
        yakusuu_a.append(i)

for i in range(1,B+1):
    if B % i == 0:
        yakusuu_b.append(i)

c = []
for i in yakusuu_a:
  if i in yakusuu_b:
    c.append(i)

c.sort(reverse=True)
if len(c) == 0:
  print(1)
else:
  print(c[K-1])
x,a,b=map(int,input().split())
 
if b-a<=o:
    print("delicious")
elif b-a<=x:
    print("safe")
else:
    print("dangerous")

### FIXED CODE ###

x,a,b=map(int,input().split())
 
if b-a<=0:
    print("delicious")
elif b-a<=x:
    print("safe")
else:
    print("dangerous")
x=raw_input("> ")
x=x*x*x
print x

### FIXED CODE ###

x = input()
print x**3
a = int(input())
ans = 0
if a % 2 == 0:
    ans = a
elif a[i] == "-":
    ans = a * 2

print(ans)



### FIXED CODE ###

a = int(input())
ans = 0
if a % 2 == 0:
    ans = a
else:
    ans = a * 2

print(ans)
a

### FIXED CODE ###

[a, b] = map(int, input().split())
print(a + b if b % a == 0 else b - a)
a,b,c,d=map(int,input().split())
if a*b>c*d:
    input(a*b)
else:
    input(c*d)

### FIXED CODE ###

a,b,c,d=map(int,input().split())
print(max(a*b,c*d))
from collections import deque,defaultdict
from math import ceil,floor,inf,sqrt,factorial,gcd,log2
from copy import deepcopy
ii1=lambda:int(stdin.readline().strip())
is1=lambda:stdin.readline().strip()
iia=lambda:list(map(int,stdin.readline().strip().split()))
isa=lambda:stdin.readline().strip().split()
mod=1000000007
ani,total = iia()
if 0<=(4*ani-total)<=2*ani:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

from sys import stdin,stdout
import math
from collections import deque,defaultdict
from math import ceil,floor,inf,sqrt,factorial,gcd,log2
from copy import deepcopy
ii1=lambda:int(stdin.readline().strip())
is1=lambda:stdin.readline().strip()
iia=lambda:list(map(int,stdin.readline().strip().split()))
isa=lambda:stdin.readline().strip().split()
mod=1000000007
ani,total = iia()
if total>4*ani:
    print('No')
elif total % 2==0:
    crane=(4*ani - total)
    tor = total-2*ani
    if crane%2==0 or tor%2==0:
        if 0<=crane//2<=ani and 0<=tor//2<=ani:
            print('Yes')
        else:
            print('No')
    else:
        print('No')
else:
    print('No')
print(eval(input())


### FIXED CODE ###

ans = eval(input())
print(ans)
from numpy import int_

mod = 10 ** 9 + 7

N, K, *A = map(int, open(0).read().split())
A = int_(A).reshape(N, N)

K //= 2
ans = A
while K:
    if K & 1:
        ans = (ans @ A) % mod
    A = (A @ A) % mod
    K //= 2

print(ans.sum())

### FIXED CODE ###

from numpy import array, eye

mod = 10 ** 9 + 7

N, K, *A = map(int, open(0).read().split())
A = array(A, dtype=object).reshape(N, N)

ans = eye(N, dtype=object)
while K:
    if K & 1:
        ans = (ans.dot(A)) % mod
    A = A.dot(A) % mod
    K //= 2

print(ans.sum() % mod)
a=inout().split(' ')
n=int(a[0])
sum=int(a[1])
b=9999999
for i in range(n):
    c=int(input())
    sum-=c
    if b>c:
        b=c
print(sum//b)

### FIXED CODE ###

a=input()
sum=700
for i in a:
    if i=='o':
        sum+=100
print(sum)
from math import factorial

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

def c(a, b):
    return int(factorial(a) / (factorial(a-b) * factorial(b)))

for i in range(1, k+1):
    print((c(k-1, i-1) * c(w+1, i)) % (10**9 + 7))



### FIXED CODE ###

from math import factorial

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

def c(a, b):
    if a < b: return 0
    return factorial(a) // (factorial(a-b) * factorial(b))

for i in range(1, k+1):
    print((c(k-1, i-1) * c(r+1, i)) % (10**9 + 7))
h, w = map(int, input().split())
grid = []
seen = [[False for y in range(w)] for x in range(h)]

for x in range(h):
    grid.append(input())



blackSeen = 0
whiteSeen = 0
def countFrom(a, b, lastColor):
    global blackSeen, whiteSeen
    if not (0 <= a < h and 0 <= b < w):
        return
    if seen[a][b]:
        return
    #print(a, b)
    

    thisColor = (1 if grid[a][b] == "." else -1)

    if grid[a][b] == "#" and lastColor != -1:
        blackSeen += 1
    elif grid[a][b] == "." and lastColor != 1:
        whiteSeen += 1
    else:
        return
    seen[a][b] = True

    countFrom(a+1, b, thisColor)
    countFrom(a-1, b, thisColor)
    countFrom(a, b+1, thisColor)
    countFrom(a, b-1, thisColor)

tot = 0
for x in range(h):
    for y in range(w):
        blackSeen = 0
        whiteSeen = 0
        countFrom(x, y, 0)
        #print(x, y, blackSeen, whiteSeen)
        tot += blackSeen * whiteSeen

print(tot)

    

### FIXED CODE ###

import sys
sys.setrecursionlimit(500*500)

h, w = map(int, input().split())
grid = []
seen = [[False for y in range(w)] for x in range(h)]

for x in range(h):
    grid.append(input())



blackSeen = 0
whiteSeen = 0
def countFrom(a, b, lastColor):
    global blackSeen, whiteSeen
    if not (0 <= a < h and 0 <= b < w):
        return
    if seen[a][b]:
        return
    #print(a, b)
    

    thisColor = (1 if grid[a][b] == "." else -1)

    if grid[a][b] == "#" and lastColor != -1:
        blackSeen += 1
    elif grid[a][b] == "." and lastColor != 1:
        whiteSeen += 1
    else:
        return
    seen[a][b] = True

    countFrom(a+1, b, thisColor)
    countFrom(a-1, b, thisColor)
    countFrom(a, b+1, thisColor)
    countFrom(a, b-1, thisColor)

tot = 0
for x in range(h):
    for y in range(w):
        blackSeen = 0
        whiteSeen = 0
        countFrom(x, y, 0)
        #print(x, y, blackSeen, whiteSeen)
        tot += blackSeen * whiteSeen

print(tot)
#include <iostream>
#include <cmath>
using namespace std;

int main(void){
  long long int a, b;
  cin >> a >> b;
  if(a % 2 == 1 && b % 2 == 1){
    cout << (long long int)((long long int)(b*a)/(long long int)2 + 1) << endl;
  }
  else{
    cout << (long long int)((long long int)(b*a)/(long long int)2) << endl;
  }
  
  return 0;
}


### FIXED CODE ###

N = list(map(int, input().split()))
if N[0] == 1 or N[1] == 1:
  print(1)
else:
  print((N[0]*N[1]+1)//2)
#import numpy as np
#from numpy import*
#from scipy.sparse.csgraph import shortest_path #shortest_path(csgraph=graph) # dijkstra# floyd_warshall
#from scipy.sparse import csr_matrix
from time import* 
from collections import* #defaultdict Counter deque appendleft
from fractions import gcd
from functools import* #reduce
from itertools import* #permutations("AB",repeat=2) combinations("AB",2) product("AB",2) groupby accumulate
from operator import mul,itemgetter
from bisect import* #bisect_left bisect_right
from heapq import* #heapify heappop heappushpop
from math import factorial,pi
from copy import deepcopy
import sys
sys.setrecursionlimit(10**8)
#input=sys.stdin.readline
input=sys.stdin.readline
t=time()

def main():
    n,m=map(int,input().split())
    x=[tuple(map(int,input().split()))for i in range(m)]
    y=sorted(x)
    start=set()
    for s,t,r in y:
        if s==1:
            start.add((1,t,r))
    ans=set([-1])
    substart=set()
    while 1:
        while start:
            qp,p,q=start.pop()
            for s,t,r in y:
                if t==n:
                    ans.add(q)
                elif s<=p and p<=t and s!=qp:
                    substart.add((p,t,q+r))
                    
        start=substart
        if time()-t>6:
            if len(ans)!=1:
                print(min(i for i in ans if i!=-1))
            else:
                print(-1)
            exit()
if __name__ == '__main__':
    main()


### FIXED CODE ###

#import numpy as np
#from numpy import*
#from scipy.sparse.csgraph import shortest_path #shortest_path(csgraph=graph) # dijkstra# floyd_warshall
#from scipy.sparse import csr_matrix
 
from collections import* #defaultdict Counter deque appendleft
from fractions import gcd
from functools import* #reduce
from itertools import* #permutations("AB",repeat=2) combinations("AB",2) product("AB",2) groupby accumulate
from operator import mul,itemgetter
from bisect import* #bisect_left bisect_right
from heapq import* #heapify heappop heappushpop
from math import factorial,pi
from copy import deepcopy
import sys
sys.setrecursionlimit(10**8)
#input=sys.stdin.readline

def main():
    n=int(input())
    ans=0
    for i in range(1,n):
        if (i!=n-i and i<n-i):
            ans+=1
        elif i>n-1:
            break
    print(ans)
    
    
if __name__ == '__main__':
    main()
n,k,s = map(int, raw_input())
r = [s] * k + [s+1] * (n - k)
for a in r:
  print a,


### FIXED CODE ###

n,k,s = map(int, raw_input().split())
r = [s] * k 

if s == 10 ** 9:
	for i in range(n - k):  r.append((10 ** 9) - 2)
else:
	for i in range(n - k):  r.append(s + 1)
for a in r: print a,
# from math import factorial,sqrt,ceil,gcd
# from itertools import permutations as permus
# from collections import deque,Counter
# import re
# from functools import lru_cache # 簡単メモ化 @lru_cache(maxsize=1000)
# from decimal import Decimal, getcontext
# # getcontext().prec = 1000
# # eps = Decimal(10) ** (-100)

import numpy as np
# import networkx as nx
# from scipy.sparse.csgraph import shortest_path, dijkstra, floyd_warshall, bellman_ford, johnson
# from scipy.sparse import csr_matrix
# from scipy.special import comb

# slist = "abcdefghijklmnopqrstuvwxyz"
N = int(input())
rows = [int(input()) for _ in range(N)]
arr = np.array(rows)
key,idx,cnt = np.unique(arr,return_index=True,return_counts=True)
cnt = cnt[cnt%2==1]
ans = len(cnt)

print(ans)
# print(*ans)   # unpackして出力。間にスペースが入る
# for row in board:
#     print(*row,sep="")    #unpackして間にスペース入れずに出力する
# print("{:.10f}".format(ans))
# print("{:0=10d}".format(ans))


### FIXED CODE ###

# from math import factorial,sqrt,ceil,gcd
# from itertools import permutations as permus
from collections import deque,Counter
# import re
# from functools import lru_cache # 簡単メモ化 @lru_cache(maxsize=1000)
# from decimal import Decimal, getcontext
# # getcontext().prec = 1000
# # eps = Decimal(10) ** (-100)

import numpy as np
# import networkx as nx
# from scipy.sparse.csgraph import shortest_path, dijkstra, floyd_warshall, bellman_ford, johnson
# from scipy.sparse import csr_matrix
# from scipy.special import comb

# slist = "abcdefghijklmnopqrstuvwxyz"
N = int(input())
rows = [int(input()) for _ in range(N)]
cnt = Counter(rows)
ans = 0
for k,v in cnt.items():
    if v%2 == 1:
        ans += 1
        
print(ans)
# print(*ans)   # unpackして出力。間にスペースが入る
# for row in board:
#     print(*row,sep="")    #unpackして間にスペース入れずに出力する
# print("{:.10f}".format(ans))
# print("{:0=10d}".format(ans))
#another way:
def count_digits(n):
    d=0
    while(n>0):
        d += 1
        n = n//10
    return d
c=0
for i in range(1,N+1):
    if (count_digits(i)%2==1):
        c += 1
print(c)

### FIXED CODE ###

N=int(input())
c=0
for i in range(1, N+1):
    if (len(str(i))%2 == 1):
        c += 1
print(c)
work = [True] * 100001
work[0] = False
work[1] = False
primes = []
for i in range(100001):
    if work[i]:
        primes.append(i)
        for j in range(2, 100001 // i):
            work[j * i] = False

ret = [i for i in primes if (i + 1) // 2 in primes]

csum = [0]
index = 0
for i in range(1, 10001):
    if i < ret[index]:
        csum.append(csum[-1])
    else:
        csum.append(csum[-1] + 1)
        index += 1

q = int(input())
for i in range(q):
    l, r = map(int, input().split())
    low = csum[l-1]
    high = csum[r]
    print(high-low)


### FIXED CODE ###

work = [True] * 100001
work[0] = False
work[1] = False
primes = []
for i in range(100001):
    if work[i]:
        for j in range(2* i, 100001, i):
            work[j] = False


csum = [0] * 100001
index = 0
for i in range(1, 100001):
    if work[i] and work[(i+1)//2]:
        csum[i] = csum[i - 1] + 1
    else:
        csum[i] = csum[i - 1]

q = int(input())
for i in range(q):
    l, r = map(int, input().split())
    low = csum[l-1]
    high = csum[r]
    print(high-low)
import math
tan, tyou, hour, minute = input()
tan_rad = 30 * hour + 0.5 * minute
tyou_rad = 6 * minute
if tan_rad == tyon_rad:
  answer = abs(tyou - tan)
elif abs(tan_rad - tyon_rad) == 180:
  answer = tyou + tan
else:
  rad = abs(tan_rad - tyou_rad)
  if rad > 180:
    rad = 360 - rad
  answer = math.sqrt((tan ** 2) + (tyou ** 2) - 2 * tan * tyou * math.cos(rad))
print(answer)

### FIXED CODE ###

import math
ji, hun, H, M = input().split()
ji = int(ji)
hun = int(hun)
H = int(H)
M = int(M)
ji_rad = 30 * H + 0.5 * M
hun_rad = 6 * M
diff = abs(ji_rad - hun_rad)
if diff == 0:
  answer = abs(ji - hun)
elif diff == 180:
  answer = ji + hun
else:
  if diff > 180:
      diff = abs(360 - diff)
  answer = math.sqrt((ji ** 2) + (hun ** 2) - 2 * ji * hun * math.cos(math.radians(diff)))
print(answer)
import math

if __name__ == "__main__":
    N, A, B = map(int, input().split())
    S = "b" * A + "r" * B
    S = S * math.ceil(1000000000000000000 / len(S))
    ret = S[:N].count("b")
    print(ret)import math

if __name__ == "__main__":
    A, B = map(int, input().split())
    par = A / B
    if par < 0.8:
        print("-1")
        exit(0)
    else:
        a = math.ceil(A / 0.08)
        b = math.ceil(B / 0.1)
        # print(a , b)
        ret = a
        print(a)

### FIXED CODE ###

import math

if __name__ == "__main__":
    A, B = map(int, input().split())
    a = math.ceil(A / 0.08)
    b = math.ceil(B / 0.1)
    # print(a , b)
    if math.floor(a * 0.08) == A and math.floor(a * 0.1) == B:
        ret = a
    elif math.floor(b * 0.08) == A and math.floor(b * 0.1) == B:
        ret = b
    else : 
        ret = -1
    print(ret)
i=int(input);print(i()+i()if1<i()else'Hello World')


### FIXED CODE ###

if int(input())==1:
  print("Hello World")
else:
  a=int(input())
  b=int(input())
  print(a+b)
from collections import Counter
from heapq import heappush, heappop


def solve(n, sss):
    keys = [-1] + sorted(sss.keys())
    m = keys.pop()
    if sss[m] != 1:
        return False
    k = keys[-1]
    q = [(-n, -m)]
    while k != -1:
        r, s = heappop(q)
        r = -r
        s = -s
        if r == 0:
            continue
        if k >= s:
            tmp = set()
            while q:
                tmp.add((-r, -s))
                r, s = heappop(q)
                r, s = -r, -s
                if k < s:
                    for item in tmp:
                        heappush(q, item)
                    break
            else:
                return False
        heappush(q, (-(r - 1), -k))
        heappush(q, (-(r - 1), -s))
        sss[k] -= 1
        if sss[k] == 0:
            keys.pop()
            k = keys[-1]
        # print(s, r, q, keys, sss)
    return True


n = int(input())
sss = Counter(map(int, input().split()))
print('Yes' if solve(n, sss) else 'No')


### FIXED CODE ###

from collections import Counter
from heapq import heappop, heappush


def solve(n, sss):
    ccc = Counter(sss)
    keys = sorted(ccc.keys(), reverse=True)
    if ccc[keys[0]] != 1:
        return False

    q = [(1, keys[0])]
    for k in keys[1:]:
        nq = []
        for _ in range(ccc[k]):
            try:
                r, s = heappop(q)
            except IndexError:
                return False
            if r < n:
                nq.append((r + 1, k))
                heappush(q, (r + 1, s))
        for item in nq:
            heappush(q, item)

    return True


n = int(input())
sss = list(map(int, input().split()))
print('Yes' if solve(n, sss) else 'No')
total = sum(W)
prefix = []
delta = []
for i in range(N):
  prefix.append(sum(W[:i+1]))
  
for i in range(N):
  delta.append(abs(prefix[N-1] /2 - prefix[i]))
  
print(min(delta) * 2)


### FIXED CODE ###

N = input()
N = int(N)
W = input().split()

for i in range(N):
  W[i] = int(W[i])
  
total = sum(W)
prefix = []
delta = []
for i in range(N):
  prefix.append(sum(W[:i+1]))
  
for i in range(N):
  delta.append(abs(prefix[N-1] /2 - prefix[i]))
  
answer = min(delta) * 2
print(int(answer))
a = input()
b = input()

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

print "%d %d" % (s, l)

### FIXED CODE ###

#reference : http://qiita.com/clarinet758/items/53e31ec10b873975438b
#reference : #1511943 Solution for ITP1_1_C: Rectangle by Signorte
# print "%d %d" % (s ,l) => ERROR

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

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

print "%s %s" % (str(s) ,str(l))
print(“x” * len(input()))

### FIXED CODE ###

print("x" * len(input()))
X, N = list(map(int, input().split()))
p = list(map(int, input().split()))
p_max = max(p)
diff = [0]
#リストに含まれるものは飛ばす
for i in range(1, 101):
    if X - i not in P:
        print(X -1)
        break
    if X + i not in P:
        print(X + i)
        break

### FIXED CODE ###

X, N = map(int, input().split())
p = list(map(int, input().split()))

p = set(p)
for i in range(200):
    if X - i not in p:
        print(X - i)
        break
    if X + i not in p:
        print(X + i)
        break
# soundhound2018_summer_qual_d
import networkx as nx
n, m, s, t = map(int, input().split())


Gy = nx.Graph()   # Yen
Gy.add_nodes_from(range(1, n+1))

Gs = nx.Graph()   # Snuuk
Gs.add_nodes_from(range(1, n+1))


for _ in range(m):
    u, v, a, b = map(int, input().split())
    Gy.add_edge(u, v, weight=a)
    Gs.add_edge(u, v, weight=b)

shortest_length_from_s = nx.shortest_path_length(Gy, source=s, weight='weight')
shortest_length_to_t = nx.shortest_path_length(Gs, target=t, weight='weight')


dist = [-1]
for i in range(1, n+1):
    dist.append(shortest_length_from_s[i]+shortest_length_to_t[i])
# print(dist)

for i in range(1, n+1):
    print(10**15-min(dist[i:]))

### FIXED CODE ###

import numpy as np
from heapq import heappush, heappop

n, m, s, t = map(int, input().split())
G = [[] for _ in range(n+1)]
for _ in range(m):
    u, v, a, b = map(int, input().split())
    G[u].append((v, a, b))
    G[v].append((u, a, b))


def dijkstra(start, mode):
    INF = 10 ** 15
    dist = [INF] * (n+1)
    dist[start] = 0
    q = [(0, start)]
    while q:
        d, v = heappop(q)
        if dist[v] < d:
            continue
        for w, *a in G[v]:
            d1 = d + a[mode]
            if dist[w] > d1:
                dist[w] = d1
                heappush(q, (d1, w))
    return dist


d1 = np.array(dijkstra(s, 0))
d2 = np.array(dijkstra(t, 1))

# print(d1)


d = []
for i in range(n+1):
    d.append(d1[i]+d2[i])


ans = []
B = 10**15
for i in range(n):
    B = min(B, d[n-i])
    ans.append(B)
ans = ans[::-1]

for i in range(n):
    print(10**15-ans[i])
import sys
input=sys.stdin.readline

def grid(y,x,mp):
    mod=10**9+7
    dp=[[0]*y for _ in range(x)]
    dp[0][0]=1
    for h in range(H):
        for w in range(W):
            if mp[h][w]=='.':
                if h>=1:
                    dp[h][w]+=(dp[h-1][w]%mod)
                if w>=1:
                    dp[h][w]+=(dp[h][w-1]%mod)
    return dp[y-1][x-1]%mod


H,W=map(int,input().split())
mp=[]
for _ in range(H):
    mp.append(list(input()))
print(grid(H,W,mp))




### FIXED CODE ###

import sys
input=sys.stdin.readline

def grid(y,x,mp):
    mod=10**9+7
    dp=[[0]*x for _ in range(y)]
    dp[0][0]=1
    for h in range(y):
        for w in range(x):
            if mp[h][w]=='.':
                if 1<=h<y and 1<=w<x:
                    dp[h][w]=((dp[h][w-1]+dp[h-1][w])%mod)
                elif h==0 and 1<=w<x:
                    dp[h][w]=(dp[h][w-1]%mod)
                elif 1<=h<y and w==0:
                    dp[h][w]=(dp[h-1][w]%mod)
    return dp[y-1][x-1]


H,W=map(int,input().split())
mp=[list(input()) for _ in range(H)]
print(grid(H,W,mp))