Harryxun/stf_run huggingface dataset:
import numpy as np
class UnionFind:
    def __init__(self, n):
        self.par = [i for i in range(n+1)]
        self.rank = [0] * (n+1)

    # 検索
    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 union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        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

    # 同じ集合に属するか判定
    def same_check(self, x, y):
        return self.find(x) == self.find(y)

#####
N, M = map(int, input().split())
uf = UnionFind(N)
for i in range(M):
    ui, vi, wi = map(int, input().split())
    uf.union(ui, vi)
print(len(np.unique(uf.par[1:])))

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**8)
N, M = map(int, input().split())
num_edges = M
edges = [list(map(int, input().split())) for i in range(num_edges)]
adj = [[] for i in range(N+1)]
for ed in edges:
    adj[ed[0]] += [[ed[1], ed[2]]]
    adj[ed[1]] += [[ed[0], ed[2]]]
col_list = [-1 for i in range(N+1)]

def recfun(v, col):
    col_list[v] = col #色を更新
    for ed in adj[v]: #隣接する頂点をみる
        if col_list[ed[0]] == -1: #更新していない場合
            recfun(ed[0], col) #同じ色でその先をみる
count = 0
for i in range(1, N+1):
    if col_list[i] == -1:
        count +=1
        recfun(i, count)
print(count)
import sys
n, k = map(int, input().split())
a = list(map(int, input().split()))
d = {}
d2 = {}
d3 = {}
loopc = 0
for i in range(1, n + 1):
    d[i] = a[i - 1]


b = d[1]
d2[b] = 1
d3[i] = b
amari = 0
if k >= 2:
    if n >= k:
        for i in range(2, k + 1):
            if b in d:
                b = d[b]
    else:
        for i in range(2, n + 1):
            if b in d:
                b = d[b]
                if b not in d2:
                    b = d[b]
                    d2[b] = i
                    d3[i] = b
                elif b in d2:
                    loopc = i - d2[b]
            else:
                print(b)
                sys.exit()

        amari = k - n
        amari = amari % loopc
        for i in range(amari + 1):
            b = d[b]
        print(b)
else:
    print(b)


### FIXED CODE ###

import sys

n, k = map(int, input().split())
a = list(map(int, input().split()))
d = {}
d2 = {}
d3 = {}
loopc = 0
for i in range(1, n + 1):
    d[i] = a[i - 1]


b = d[1]
d2[b] = 1
d3[i] = b
amari = 0
if k >= 2:
    if n >= k:
        for i in range(2, k + 1):
            if b in d:
                b = d[b]
        print(b)
    else:
        for i in range(2, n + 1):
            if b in d:
                b = d[b]
                if b not in d2:
                    d2[b] = i
                    d3[i] = b
                elif b in d2:
                    loopc = i - d2[b]
            else:
                print(b)
                sys.exit()

        amari = k - n
        amari = amari % loopc
        for i in range(amari):
            b = d[b]
        print(b)
else:
    print(b)
from collections import Counter
n = list(input())
c = Counter(n)
if max(list(c.values))>=3:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

n = list(input())
if n[0]==n[1]==n[2] or n[1]==n[2]==n[3]:
  print('Yes')
else:
  print('No')
import sys

def solve(N, S, K):
    char = S[K]

    ans = ''
    for i in xrange(len(S)):
        ans += S[i] if S[i] == char else '*'
    return ans

if __name__ == '__main__':

    N = sys.stdin.readline().strip()
    S = sys.stdin.readline().strip()
    K = sys.stdin.readline().strip()
    ans = solve(int(N), S, int(K))
    print ans

### FIXED CODE ###

import sys

def solve(N, S, K):
    char = S[K-1]

    ans = ''
    for i in xrange(len(S)):
        ans += S[i] if S[i] == char else '*'
    return ans

if __name__ == '__main__':

    N = sys.stdin.readline().strip()
    S = sys.stdin.readline().strip()
    K = sys.stdin.readline().strip()
    ans = solve(int(N), S, int(K))
    print ans
#! /usr/bin/env python3

from fractions import gcd
from collections import Counter, deque, defaultdict
from heapq import heappush, heappop, heappushpop, heapify, heapreplace, merge
from bisect import bisect_left, bisect_right, bisect, insort_left, insort_right, insort
from itertools import accumulate, product, permutations, combinations, combinations_with_replacement

A, B = [int(_) for _ in input().split()]

for i in range(100+1):

    if int(i * 0.08) == A and int(i * 0.1) == B:
        print(i)
        exit()
print(-1)


### FIXED CODE ###

A, B = [int(_) for _ in input().split()]

for i in range(0, 1250+1):

    if int(i * 0.08) == A and int(i * 0.1) == B:
        print(i)
        exit()
print(-1)
n = int(input())

def func(n, a):
  b = a**2
  if b >= n:
    return (a-1)**2
  else:
    c = a+1
    d = func(n, c)
  
  return d

d = func(n, 1)

print(d)

### FIXED CODE ###

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

ab = abs(a - b)
bc = abs(b - c)
ca = abs(c - a)

if(ab <= d and bc <= d or ca <=d):
  print("Yes")
else:
  print("No")
N, M = [int(_) for _ in input().split()]

LRD = []
path = [[] for _ in range(N + 1)]
for _ in range(M):
    l, r, d = [int(_) for _ in input().split()]
    path[l].append((r, d))
    path[r].append((l, -d))
    LRD.append((l, r, d))

memo = [None] * (N + 1)


def dfs(n):
    for ni, d in path[n]:
        if memo[ni] is not None: continue
        memo[ni] = memo[n] + d
        dfs(ni)


for i in range(N):
    if memo[i] is not None: continue
    memo[i] = 0
    dfs(i)
for l,r,d in LRD:
    if not memo[l] + d == memo[r]:

        print('No')
        exit()
print('Yes')


### FIXED CODE ###

import sys

sys.setrecursionlimit(10000000)
N, M = [int(_) for _ in input().split()]

LRD = []
path = [[] for _ in range(N + 1)]
for _ in range(M):
    l, r, d = [int(_) for _ in input().split()]
    path[l].append((r, d))
    path[r].append((l, -d))
    LRD.append((l, r, d))

INF = -1e12
memo = [INF] * (N + 1)


def dfs(n):
    for ni, d in path[n]:
        if memo[ni] != INF: continue
        memo[ni] = memo[n] + d
        dfs(ni)


for i in range(1, N + 1):
    if memo[i] != INF: continue
    memo[i] = 0
    dfs(i)
for l, r, d in LRD:
    if memo[l] + d != memo[r] and memo[l] - d != memo[r]:
        print('No')
        exit()
print('Yes')
import sys
	a = sys.argv[1]
	b = sys.argv[2]

	if (a * b) % 2 == 0:
		print("Even")
	else:
		print("Odd")

### FIXED CODE ###

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

if (a * b) % 2 == 0:
	print("Even")
else:
	print("Odd")
n = int(input())
nums = map(int,input().split())
num = 10**18
count = 1
for i in range(n):
	count *= nums[i]

if count < num:
	print(-1)
else:
	print(count)

### FIXED CODE ###

N = int(input())
a = list(map(int, input().split()))
ans = 1
if 0 in a:
  print(0)
else:
  for i in range(N):
    ans *= a[i]
    if ans > 10 ** 18:
      print(-1)
      break
  else:
    print(ans)
N,K=map(int,input().split())
S=input()

l=[0]
curr='1'

for c in S:
    if c !=curr:
        l.append(1)
        curr=c
    else:
        l[-1]+=1
if curr=='0':
    l.append(0)

n_group=len(1)
sum_=0
k =min(k,n_group)

for i in range(k):
    sum_+=l[2*i]+l[2*i+1]
sum_ +=l[2*k]
max_=sum_

for i in range(k,n_group):
    sum_ -=l[2*i-2*k]+l[2*i+1-2*k]
    sum_ +=l[2*i+1]+l[2*i+2]
    max_ =max(max_,sum_)

print(max_)   


### FIXED CODE ###

a,b=map(int,input().split())
#a,b=(input().split())
c=max(a,b)
d=min(a,b)
if  c>d:
    print(2*c-1)

else:
    print(c+d)
# %%
N = int(input())
M = int(input())
print((N * (N - 1) + M * (M-1)) / 2)


### FIXED CODE ###

N, M = map(int, input().split())
print(int((N * (N - 1) + M * (M-1)) / 2))
nx = [int(e) for e in input().split()]
ll = [int(e) for e in input().split()]

n = nx[0]   # バウンド回数
x = nx[1]   # 終点
point = 0   # バウンド位置
count = 0   # バウンド回数

if point <= x:
    count += 1

while point <= x:

    if count == n:
        break
    point += ll[count - 1]
    count += 1
    if point > x:
        count -= 1
        break

if count == n:
    count = n
print(count)

### FIXED CODE ###

abc = [int(e) for e in input().split()]

x = abc[0]
a = abc[1]

if x < a:
    ans = 0
else:
    ans = 10

print(ans)
import numpy as np
import itertools

N, K = map(int, input().split())
a = list(map(int, input().split()))
a.sort()

def check(i): #i番目のカードを使わなかった時
    dp = np.zeros(K, dtype = np.bool)
    #dp[k]はkが作れる時True
    #保持する情報はTrue/Falseのみで良いので1次元DPを上書きしていく(1回でまとめて)
    dp[0] = True
    for j in itertools.chain(a[:i], a[i+1:]): #i番目の無いカードセット
        dp[j:] = np.logical_or(dp[j:], dp[:-j]) #ある数jを使うと、j以降のもの(N-j)個と前から(N-j)個のどちらかがTrueのものは作れる
    return any(dp[K-a[i]:]) #K-a[i]~K-1のうちどれか作れるならa[i]は必要=True

left = -1
right = N
while right - left > 1:
    mid = (right + left)//2
    if check(mid):
        right = mid
    else:
        left = mid

print (ua)

### FIXED CODE ###

'''
1枚抜いてDPをN枚についてやれば良い, がこれでは間に合わない
そこで必要不要の境界を二分探索で探す
するとO(N^2K)→O(NKlogN)となって間に合う

もう1つの方法は分からない
'''

def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10000000)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations
    #from itertools import accumulate, product
    from bisect import bisect_left,bisect_right
    from math import floor, ceil
    #from operator import itemgetter

    #mod = 1000000007

    N,K = map(int, input().split())
    a = list(map(int, input().split()))
    a = sorted(a)
    a = a[:bisect_left(a, K)]
    n = len(a)


    import numpy as np
    def dp(omit):
        dp = np.zeros((n+1, K), dtype=np.bool)
        dp[0,0] = 1
        for i in range(n):
            # まとめて遷移
            dp[i+1] |= dp[i]
            if i != omit and a[i] < K:
                dp[i+1,a[i]:] |= dp[i,:K-a[i]]
        # 今回の値A[omit]を足してKに到達できるような部分和があれば、これは必要
        for j in range(max(0, K-a[omit]), K):
            if dp[n,j]:
                return True
        # なければ不要
        return False


    # def dp(num):
    #     dp = [[0]*(K) for _ in range(n)]
    #     dp[0][0] = 1
    #     b = a[:num]+a[num+1:] #N-1個
    #     for i in range(n-1):
    #         for j in range(K):
    #             if b[i]<=j:
    #                 dp[i+1][j] = dp[i][j-b[i]] or dp[i][j]
    #             else:
    #                 dp[i+1][j]=dp[i][j]
    #     return any(dp[n-1][K-a[num]:])

    left = 0
    right = n-1
    while left<=right:
        mid = (left+right)//2
        if dp(mid):
            right = mid-1
        else:
            left = mid+1
    print(right+1)

if __name__ == '__main__':
    main()
#config:utf-8
x = input()

if x < 100:
    print(0)
    return
if 5 * int(x[0:-2]) >= int(x[-2:]):
    print(1)
else:
    print(0)


### FIXED CODE ###

#config:utf-8
x = input()

if int(x) < 100:
    print(0)
elif 5 * int(x[0:-2]) >= int(x[-2:]):
    print(1)
else:
    print(0)
import collections

n = int(input())
a = collections.Counter(list(map(int, input().split())))

f = []
t = []
for i in a:
    if a[i] >= 4:
        f.append(i)
    if a[i] >= 2:
        t.append(i)
fa, ta = 0, 0
f.sort()
t.sort()
if len(f) >= 1:
    fa = f[-1]**2
if len(t) >= 2:
    ta = max(t[-1]*t[-2], t[-1]*f[-1])
else:
    print(0)

### FIXED CODE ###

import sys
import collections

n = int(input())
a = collections.Counter(list(map(int, sys.stdin.readline().split())))

q = [0, 0]
for v, k in a.items():
    if k >= 4:
        q.append(v)
    if k >= 2:
        q.append(v)
q.sort()
print(q[-1]*q[-2])
[A,B,C,D] = list(map(int,input().split()))
#print(C,D)
#both
import math
f=math.gcd(C,D)
f2=C*D//f
#print(f2)

i=-1
flag=0
while True:
    i+=1
    if f2*i>=A and flag!=1:
        hajime=i
        flag=1
    elif f2*i>B:
        owari=i
        break
both=owari-hajime
#print('both', both)

#C
i=-1
flag=0
while True:
    i+=1
    if C*i>=A and flag!=1:
        hajime=i
        flag=1
    elif C*i>B:
        owari=i
        break
Ccount=owari-hajime
#print('C', Ccount)

#D
i=-1
flag=0
while True:
    i+=1
    if D*i>=A and flag!=1:
        hajime=i
        flag=1
    elif D*i>B:
        owari=i
        break
Dcount=owari-hajime
#print('D', Dcount)

print(B-A+1 -(Ccount+Dcount-both))

### FIXED CODE ###


[A,B,C,D] = list(map(int,input().split()))
#print(C,D)
#both
import fractions
f=fractions.gcd(C,D)
f2=C*D//f
#print(f2)

both=B//f2 - (A-1)//f2
#print('both', both)

#C
Ccount=B//C - (A-1)//C
#print('C', Ccount)

#D
Dcount=B//D - (A-1)//D
#print('D', Dcount)

print(B-A+1 -(Ccount+Dcount-both))
S,  T = input().split()
print("".join(T,S))

### FIXED CODE ###

import sys
input = sys.stdin.readline
def print_ans(S):
    """Test Case
    >>> print_ans(["oder",  "atc"])
    atcoder
    """
    print("".join(S[::-1]))

if __name__ == '__main__':
    S = list(input().rstrip().split())
    print_ans(S)
#!/usr/local/bin/python3

import math

def solve(a,b,c,d):
	a = a - 1
	l = int(c * d / math.gcd(c, d))
	r1 = a - (a // c + a // d - a // l)
	r2 = b - (b // c + b // d - b // l)
	return (r2 - r1)


a,b,c,d = map(int, input().split())
ans = solve(a,b,c,d)
print(ans)


### FIXED CODE ###

#!/usr/local/bin/python3

import fractions

def solve(a,b,c,d):
	a = a - 1
	l = c * d // fractions.gcd(c, d)
	r1 = a - (a // c + a // d - a // l)
	r2 = b - (b // c + b // d - b // l)
	return (r2 - r1)


a,b,c,d = map(int, input().split())
ans = solve(a,b,c,d)
print(ans)
def gcd(a, b):
  if a < b:
    return gcd(b, a)
  if b == 0:
    return a
  return gcd(b, a%b)

K = int(input())

if gcd(K, 10) != 1:
  print(-1)
else:
  if K % 7 == 0:
    K/=7
  ans = 1
  cur = 1
  while cur % K != 0:
    cur += pow(10, ans, K)
    ans += 1
  print(ans)

### FIXED CODE ###

def gcd(a, b):
  if a < b:
    return gcd(b, a)
  if b == 0:
    return a
  return gcd(b, a%b)

K = int(input())

if gcd(K, 10) != 1:
  print(-1)
else:
  if K % 7 == 0:
    K//=7
  ans = 1
  cur = 1
  while cur % K != 0:
    cur += pow(10, ans, K)
    ans += 1
  print(ans)
d = int(input())

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

sd = np.zeros((d, 26), dtype=np.int)
for i in range(d):
  s = list(map(int, input().split()))
  s_array = np.array(s)
  sd[i, :] = s_array

pp = np.zeros(26, dtype=np.int)
  
for i in range(d):
  pp += c
  pp_max = np.argmax(pp)+1
  pp_max_val = np.max(pp)
  print(np.sum(pp), pp_max, pp_max_val)
  sd_max = np.argmax(sd[i,:])+1
  sd_max_val = np.max(sd[i,:])
  print(sd_max, sd_max_val)
  if np.sum(pp) >= sd_max_val:
    t = pp_max
    pp[pp_max-1] = 0
  else:
    t = sd_max
  print(t)

### FIXED CODE ###

import numpy as np

d = int(input())

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

sd = np.zeros((d, 26), dtype=np.int)
for i in range(d):
  s = list(map(int, input().split()))
  s_array = np.array(s)
  sd[i, :] = s_array
  
for i in range(d):
  print(np.argmax(sd[i, :])+1)
a,b=map(int,input().split())
if b=100:
  b+=1

print(b*(100**a))


### FIXED CODE ###

a,b=map(int,input().split())
if b==100:
  b+=1

print(b*(100**a))
K, N = list(map(int, input().srtip().split()))
As = list(map(int, input().strip().split()))
 
diffs =[]
for base, switch in zip(As[:-1], As[1:]):
  diffs.append(switch-base)
 
diffs.append(As[0]+K-As[-1])
 
print(K-max(diffs))

### FIXED CODE ###

K, N = list(map(int, input().split()))
As = list(map(int, input().split()))
diffs =[]
for base, switch in zip(As[:-1], As[1:]):
  diffs.append(switch-base)
diffs.append(As[0]+K-As[-1])
print(K-max(diffs))
n,ww=map(int,input().split())
waight=[0]
value=[0]
for _ in range(n):
    a,b=map(int,input().split())
    waight.append(a)
    value.append(b)
dp=[[0]*(ww+1) for _ in range(n+1)]
for i in range(n):
    for w in range(ww+1):
        if w-waight[i+1]>=0:
            dp[i+1][w]=max(dp[i][w],dp[i][w-waight[i+1]]+value(i+1))
        else:
            dp[i+1][w]=dp[i][w]
print(dp[-1][-1])

### FIXED CODE ###

n,ww=map(int,input().split())
waight=[0]
value=[0]
for _ in range(n):
    a,b=map(int,input().split())
    waight.append(a)
    value.append(b)
dp=[[0]*(ww+1) for _ in range(n+1)]
for i in range(n):
    for w in range(ww+1):
        if w-waight[i+1]>=0:
            dp[i+1][w]=max(dp[i][w],dp[i][w-waight[i+1]]+value[i+1])
        else:
            dp[i+1][w]=dp[i][w]
print(dp[-1][-1])
x = int(input())
y = int(input())


print((x*y), (2*x+2*y))



### FIXED CODE ###

x,y=map(int, input().split())
print(x*y,2*(x+y))
#!/usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10**5)
stdin = sys.stdin
bisect_left = bisect.bisect_left
bisect_right = bisect.bisect_right
def LI(): return list(map(int, stdin.readline().split()))
def LF(): return list(map(float, stdin.readline().split()))
def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def II(): return int(stdin.readline())
def IF(): return float(stdin.readline())
def LS(): return list(map(list, stdin.readline().split()))
def S(): return list(stdin.readline().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')

#A
def A():
    n = S()
    for i in n:
        if i == "1":
            print(9, end="")
        else:
            print(1, end="")
    print()
    return

#B
def B():
    n = II()
    for i in range(111, , 111):
        if n <= i:
            print(i)
    return

#C
def C():
    return

#D
def D():
    return

#E
def E():
    return

#F
def F():
    return

#G
def G():
    return

#H
def H():
    return

#Solve
if __name__ == '__main__':
    A()


### FIXED CODE ###

#!/usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10**5)
stdin = sys.stdin
bisect_left = bisect.bisect_left
bisect_right = bisect.bisect_right
def LI(): return list(map(int, stdin.readline().split()))
def LF(): return list(map(float, stdin.readline().split()))
def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def II(): return int(stdin.readline())
def IF(): return float(stdin.readline())
def LS(): return list(map(list, stdin.readline().split()))
def S(): return list(stdin.readline().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')

#A
def A():
    n = S()
    for i in n:
        if i == "1":
            print(9, end="")
        else:
            print(1, end="")
    print()
    return

#B
def B():
    n = II()
    for i in range(111, 1000, 111):
        if n <= i:
            print(i)
            return
    return

#C
def C():
    return

#D
def D():
    return

#Solve
if __name__ == '__main__':
    B()
import numpy as np

n = int(input())
As = list(map(int, input().split()))

prime = [2]
for i in range(3, 999, 2):
  for j in range(len(prime)):
    if i % prime[j] == 0:
      break
    elif prime[j] > pow(i, 1/2):
      prime.append(i)
      break
    
mat = np.zeros((n, len(prime)))

for i in range(len(As)):
  a = As[i]
  for j in range(len(prime)):
    while True:
      if a % prime[j] == 0:
        mat[i,j] += 1
        a /= prime[j]
      else:
        break
    if a == 1:
      break

max_exp = mat.max(axis=0)

B_total = 0
for i in range(len(As)):
  _exp = max_exp - mat[i]
  b = 1
  for j in range(len(prime)):
    b *= prime[j]**_exp[j]
  B_total += b
  B_total = B_total % (pow(10,9)+7)

print(int(B_total % (pow(10,9)+7)))

### FIXED CODE ###

from fractions import gcd

def lcm(c,d):
    return c//gcd(c,d)*d
mod=10**9+7

n=int(input())
a=[int(i) for i in input().split()]
l=a[0]
for i in range(1,n):
    l=lcm(l,a[i])
ans=0
for i in range(n):
    ans+=l//a[i]
    #ans%=mod
print(ans%mod)
a,b=map(int,input().split)
c=input().split()
l=[]
for i in c:
  l.append(int(i))
if sum(l)>a:
  print(-1,end="")
else:
  print(a-sum(l),end="")
  

### FIXED CODE ###

a,b=map(int,input().split())
c=input().split()
l=[]
for i in c:
  l.append(int(i))
if sum(l)>a:
  print(-1,end="")
else:
  print(a-sum(l),end="")
n = int(input())
h = map(int, input().split())
l = [0,0,0]

for i in range(n):
  if h[i] > h[i + 1]:
    l.insert(i, 1)

con = 0
max = 0
for i in range(n + 1):
  if l[i] == 1:
    con += 1
  else:
    if con > max:
      max = con
      con = 0
print(max)

### FIXED CODE ###

n = int(input())
h = list(map(int,input().split()))
l = [0,0,0]
for i in range(n-1):
  if h[i] >= h[i + 1]:
    l.insert(i, 1)
  else:
    l.insert(i,0)

con = 0
max = 0
for i in range(n + 1):
  if l[i] == 1:
    con = con + 1
  else:
    if con > max:
      max = con
    con = 0
print(max)
def e_friendships(N, K):
    if K > (N - 1) * (N - 2) // 2:
        return -1

    ans_graph = []
    for i in range(2, N + 1):
        ans_graph.append('{} {}'.format(1, i))  # スターの構成

    def append_edge(t, lst):
        count = 0
        for i in range(2, N):
            for j in range(i + 1, N + 1):
                if count == t:
                    return lst
                lst.append('{} {}'.format(i, j))
                count += 1

    ans_graph = append_edge((N - 1) * (N - 2) // 2 - K, ans_graph)
    return str(len(ans_graph)) + '\n' + '\n'.join(ans_graph)

N, K = [int(i) for i in input().split()]
print(e_friendships(N, K))

### FIXED CODE ###

def e_friendships(N, K):
    if K > (N - 1) * (N - 2) // 2:
        return -1

    ans_graph = []
    for i in range(2, N + 1):
        ans_graph.append('{} {}'.format(1, i))  # スターの構成

    def append_edge(t, lst=[]):
        count = 0
        for i in range(2, N):
            for j in range(i + 1, N + 1):
                if count == t:
                    return lst
                lst.append('{} {}'.format(i, j))
                count += 1
        return lst

    ans_graph = append_edge((N - 1) * (N - 2) // 2 - K, ans_graph)
    return str(len(ans_graph)) + '\n' + '\n'.join(ans_graph)

N, K = [int(i) for i in input().split()]
print(e_friendships(N, K))
n=input()
p = list(map(int,input().split()))
result=sum(p)
for i in range(n-1):
    s1 = sum(p[:i+1])
    s2 = sum(p[i+1:])
    result = min(result,abs(s1-s2))
print(result)

### FIXED CODE ###

n=int(input())
p = list(map(int,input().split()))
result=sum(p)
for i in range(n-1):
    s1 = sum(p[:i+1])
    s2 = sum(p[i+1:])
    result = min(result,abs(s1-s2))
print(result)
# https://beta.atcoder.jp/contests/agc025/tasks/agc025_b
from functools import reduce
import operator as op

MOD = 998244353
mod_inv = [0, 1]


def init_mod_inv(n):
    for i in range(2,n+1):
        ans = MOD - (MOD // i) * mod_inv[MOD % i] % MOD
        mod_inv.append(ans)
    return ans


def nCr(n, r):
    r = min(r, n - r)
    ans = 1
    for i in range(n, n - r, -1):
        ans = (ans * i) % MOD
    for i in range(1, r + 1):
        ans = (mod_inv[i] * ans) % MOD
    return ans

def main():
    n, a, b, k = map(int, input().split())

    ways = 0
    init_mod_inv(n)
    for x in range(0, n + 1):
        yb = k - a*x
        if yb >= 0 and yb % b == 0 and yb//b<=n:
            ways += nCr(n, x)*nCr(n, yb//b)
            ways %= MOD
    print(ways)

if __name__ == "__main__":
    main()


### FIXED CODE ###

# https://beta.atcoder.jp/contests/agc025/tasks/agc025_b
from functools import reduce
import operator as op

MOD = 998244353
mod_inv = [0, 1]


def init_mod_inv(n):
    for i in range(2, n + 1):
        ans = MOD - (MOD // i) * mod_inv[MOD % i] % MOD
        mod_inv.append(ans)


def main():
    n, a, b, k = map(int, input().split())

    init_mod_inv(n)
    nCr = [0] * (n + 1)
    nCr[0] = 1
    for i in range(1, n+1):
        nCr[i] = (nCr[i - 1] * (n - i + 1) * mod_inv[i]) % MOD

    ways = 0
    for x in range(0, n + 1):
        yb = k - a * x
        if yb >= 0 and yb % b == 0 and yb // b <= n:
            ways += nCr[x] * nCr[yb // b]
            ways %= MOD
    print(ways)


if __name__ == "__main__":
    main()