Harryxun/stf_run huggingface dataset:
h,w,a,b=map(int,input().split())

tmp=[0]*w
lista=[]
for i in range(h):
    lista.append([0]*w)
    
if a>w/2 or b>h/2:
    print("No")

elif h==1:
    for i in range(w-a):
        lista[0][a+i]=1
elif w==1:
    for i in range(h-b):
                lista[b+i][0]=1
else:  
    for i in range(w-a):
        lista[0][a+i]=1
    if b!=0:    
        for i in range(a):
            for j in range(h-b):
                lista[b+j][i]=1 
        for i in range(b):
            for i in range(w-a):
                lista[i][a+j]=1




for i in range(h):
    row = ""
    for j in range(w):
        row += str(lista[i][j])
    print(row)

### FIXED CODE ###

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

lista=[]

for i in range(h):
    lista.append([0]*w)

if (a>w/2)|(b>h/2):
    print("No")

else:
    if h==1:
        for i in range(w-a):
            lista[0][a+i]=1
    elif w==1:
        for i in range(h-b):
            lista[b+i][0]=1

    elif (a==0)&(b==0):
        lista=lista

    else:  
        for i in range(w-a):
            lista[0][a+i]=1
        
           
        if a==0:    
            for i in range(w):
                for j in range(b):
                    lista[j][i]=1 
        elif b==0:    
            for i in range(h):
                for j in range(w-a):
                    lista[i][j+a]=1                         
        else:    
            for i in range(a):
                for j in range(h-b):
                    lista[b+j][i]=1 
            for i in range(b):
                for j in range(w-a):
                    lista[i][a+j]=1


 

    for i in range(h):
        row = ""
        for j in range(w):
            row += str(lista[i][j])
        print(row)
n = int(input())
m = int(input().split(" "))
for i in range n:
    total=1
    for x in m:
        total *= m

if total<10000000000000000
    print(total)
else:
    print("-1")

### FIXED CODE ###

# we collect the input A1 upto An.
# limit cannot exceed 10**18
# if N = 0 then ans = 0
# in N is in range then compute ans * A[n]
# else if  ans is greater than limit then display 1
# finally if length equal 1 then display -1
N = int(input())
ans = 1
limit = 10 ** 18
length = 0

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

A0 = set(A)
if 0 in A0:
    ans = 0
else:
    pass

for n in range(N):
    ans = ans * A[n]
    if ans == 0:
        break
    elif ans > limit:
        length = 1
        break
    else:
        pass

if length == 1:
    print(-1)
else:
    print(ans)
a, b = map(int, input().split())


print(6 - (a + b))

### FIXED CODE ###

a = int(input())
b = int(input())

print(6 - (a + b))
import math
a,b,x=map(int, input().split()) 

threshold = (a*a*b)/2
if x <= threshold:
  rad = math.atan(2*x/(a*b*b))
  print(90-math.degrees(rad))
else:
  at = (a*a*a)/(2*(a*a*b-x))
  print(at)
  rad = math.atan(at)
  print(90-math.degrees(rad))
  

### FIXED CODE ###

import math
a,b,x=map(int, input().split()) 

threshold = (a*a*b)/2
if x <= threshold:
  rad = math.atan(2*x/(a*b*b))
  print(90-math.degrees(rad))
elif x == 2 * threshold:
  print(0)
else:
  at = (a*a*a)/(2*(a*a*b-x))
  rad = math.atan(at)
  print(90-math.degrees(rad))
import fractions


mod = 1000000007

def mul(a, b):
    return ((a % mod) * (b % mod)) % mod

def modpower(x, y):
    if   y == 0     : return 1
    elif y == 1     : return x % mod
    elif y % 2 == 0 : return power(x, y//2)**2 % mod
    else            : return power(x, y//2)**2 * x % mod

def powerX(x, y):
    if   y == 0     : return 1
    elif y == 1     : return x % mod
    elif y % 2 == 0 : return power(x, y//2)**2 
    else            : return power(x, y//2)**2 * x

def power(x,y):
    return x ** y


def div(a, b):
    return mul(a, modpower(b, mod-2))

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

htgcd = fractions.gcd(H,T)
wtgcd = fractions.gcd(W,T)
n = htgcd * wtgcd

p = ( 2 ** ( H // htgcd)) + 2 ** (W // wtgcd)) - 3)
p += 2 ** fractions.gcd( H // htgcd , W // wtgcd))

#print (p,n)

ans = modpower(p , n)

print (ans)

### FIXED CODE ###




import fractions


mod = 1000000007

def mul(a, b):
    return ((a % mod) * (b % mod)) % mod

def modpower(x, y):
    if   y == 0     : return 1
    elif y == 1     : return x % mod
    elif y % 2 == 0 : return power(x, y//2)**2 % mod
    else            : return power(x, y//2)**2 * x % mod

def powerX(x, y):
    if   y == 0     : return 1
    elif y == 1     : return x % mod
    elif y % 2 == 0 : return power(x, y//2)**2 
    else            : return power(x, y//2)**2 * x

def power(x,y):
    return x ** y


def div(a, b):
    return mul(a, modpower(b, mod-2))

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

htgcd = fractions.gcd(H,T)
wtgcd = fractions.gcd(W,T)
n = htgcd * wtgcd

p = pow( 2, ( H // htgcd) ,mod ) +pow( 2, (W // wtgcd) , mod) - 3
p += pow(2,fractions.gcd( H // htgcd , W // wtgcd),mod)

#print (p,n)

ans = pow( p , n , mod )

print (ans)
from math import ceil
from math import factorial
from collections import Counter
from operator import itemgetter
from math import gcd
import bisect
ii = lambda: int(input())
iia = lambda: list(map(int,input().split()))
isa = lambda: list(input().split())

a,b = iia()

print(int((a*b)/gcd(a,b)))

### FIXED CODE ###

import math
from math import ceil
from math import factorial
from collections import Counter
from operator import itemgetter

def gcd(a,b):
	if(b==0):
		return a
	return gcd(b,a%b)
import bisect
ii = lambda: int(input())
iia = lambda: list(map(int,input().split()))
isa = lambda: list(input().split())

a,b = iia()

print(int((a*b)/gcd(a,b)))
while True:
  H, W = map(int, raw_input().spslit())
  if H = 0 and 'W' = 0:
    break
  print '#'*W
  for l in range(0, H-2):
    print '#' + '.'*(W-2) + '#'
  print '#' * W

### FIXED CODE ###

while True:
  H, W = map(int, raw_input().split())
  if H == 0 and W == 0:
    break
  print '#'*W
  for l in range(0, H-2):
    print '#' + (W-2)*'.' + '#'
  print '#' * W
  print ''
while(True):
  n = input()
  if n == 0:
    break;
  sl = 1001
  sh = 0
  ret = 0
  for i in range(n):
    tmp = input()
    sum += tmp
    if tmp < sl:
      sl = tmp
    if tmp > sh:
      sh = tmp
  ret -= (sl + sh)
  print "%d" % (ret/n)

### FIXED CODE ###

while(True):
  n = input()
  if n == 0:
    break;
  sl = 1001
  sh = 0
  ret = 0
  for i in range(n):
    tmp = input()
    ret += tmp
    if tmp < sl:
      sl = tmp
    if tmp > sh:
      sh = tmp
  ret -= (sl + sh)
  print "%d" % (ret/(n-2))
import math
from functools import reduce

n = int(input())
num_list = list(map(int,input().split()))
def gcd_list(numbers):
    return reduce(math.gcd, numbers)

print(gcd_list(num_list))

### FIXED CODE ###

n = int(input())
 
A = list(map(int, input().split()))
 
t = max(A)
 
from fractions import gcd
 
for i in A:
    t = gcd(t, i)
print(t)
import numpy as np
n,l=map(int,input().split())
a = np.arange(l,l+n)
d = abs(a).argmin() # argmin: ndarrayで最小値の要素のインデックスを取得
print(a.sum() - a[d])

### FIXED CODE ###


n,l=map(int,input().split())
aji_lis=[int(l+i-1) for i in range(1,n+1)]

N_sum=sum(aji_lis)
ap=min([abs(i) for i in aji_lis])

if N_sum >=0:
    print(N_sum-ap)
else:
    print(N_sum+ap)
n,k = map(int, input().split())
i=0
p = list(map(int, input().split())
p.sort()
s= sum(p[:k])
print(s)

### FIXED CODE ###

n,k = map(int, input().split())
p = list(map(int, input().split()))
p.sort()
#print(p)
s= sum(p[:k])
print(s)
k, x = map(int, input().split())

tmp = [y for y in range(x-k+1, x+k)]
y = ' '.join(tmp)
print(y)

### FIXED CODE ###

k, x = map(int, input().split())
tmp = [str(y) for y in range(x-k+1, x+k)]
print(' '.join(tmp))
x, y = map(int, input().split())
a = x*y/2
if not a%2 == 0:
    a += 1
print(int(a))

### FIXED CODE ###

k = int(input())
s =  "1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1,  51"
l = s.split(",")
print(int(l[k-1]))
data = [[[0 for r in range(10)] for f in range(3)] for b in range(4)]

n = int(input())

for _ in range(n):
    (b,f,r,v) = [int(i) for i in input().split()]
    data[b - 1][f - 1][r - 1] += v

for b in range(4):
    for f in range(3):
        for r in range(10):
            print('',data[b][f][r], end='')
        print()
    print('#' * 20)
~                    

### FIXED CODE ###

data = [[[0 for r in range(10)] for f in range(3)] for b in range(4)]

n = int(input())

for _ in range(n):
    (b,f,r,v) = [int(i) for i in input().split()]
    data[b - 1][f - 1][r - 1] += v

for b in range(4):
    for f in range(3):
        for r in range(10):
            print('',data[b][f][r], end='')
        print()
    if b < 3:
        print('#' * 20)
n = list(map(int, input()))
count = 0
for i in range n: if i == 1: count += 1
print(count)

### FIXED CODE ###

n = list(map(int, input()))
count = 0
for i in n: 
    if i == 1: count += 1
print(count)
from itertools import product
from collections import deque
import numpy as np
class Grid():
    def __init__(self, grid, w=0, h=0, function=lambda x: x):
        self.w = w = w if w else len(grid[0])
        self.h = h = h if h else len(grid)
        dtype = type(function(grid[0][0]))
        self.grid = np.empty((h, w), dtype=dtype)
        for i, row in zip(range(h), grid):
            for j, val in zip(range(w), row):
                self.grid[i][j] = function(val)
    
    def is_valid_x(self, x):
        return 0 <= x < self.w
    def is_valid_y(self, y):
        return 0 <= y < self.h
    def is_valid_xy(self, x, y):
        return self.is_valid_x(x) and self.is_valid_y(y) 
    
    def __iter__(self):
        return iter(self.grid)
    def __repr__(self):
        return '\n'.join([' '.join(map(str, row)) for row in self.grid])
    def __getitem__(self, x):
        return self.grid[x]
    def __setitem__(self, x, val):
        self.grid[x] = val

X = iter(open(0).readlines())
h, w = map(int, next(X).split())
ch, cw = map(int, next(X).split())
dh, dw = map(int, next(X).split())
dp = Grid([x.strip() for x in X], function=lambda x: 10**6 if x == '.' else -1)

def dfs(stack):
    if not stack:
        return
    x, y, d = stack[0]
    dp[y, x] = d
    stack2 = []
    while stack:
        x, y, d = stack.pop()
        if dp[y, x] < d:
            continue
        for dx, dy in zip([1, 0, -1, 0], [0, 1, 0, -1]):
            nx, ny = x+dx, y+dy
            if dp.is_valid_xy(nx, ny) and dp[ny, nx] > d:
                dp[ny, nx] = d
                stack.append((nx, ny, d))
        for dx, dy in product(range(-2, 3), repeat=2):
            if abs(dx) + abs(dy) < 2:
                continue
            nx, ny = x+dx, y+dy                
            if dp.is_valid_xy(nx, ny) and dp[ny, nx] > d+1:
                dp[ny, nx] = d+1
                stack2.append((nx, ny, d+1))
    dfs(stack2)

dfs([(cw-1, ch-1, 0)])
if dp[dh-1, dw-1] == 10**6:
    print(-1)
else:
    print(dp[dh-1, dw-1])

### FIXED CODE ###

from collections import deque
from itertools import product
h, w = list(map(int,input().split()))
sy, sx = list(map(int,input().split()))
gy, gx = list(map(int,input().split()))
sx, sy, gx, gy = sx-1, sy-1, gx-1, gy-1
 
G = [list(input()) for _ in range(h)]
D = [[10**6]*w for _ in range(h)]
D[sy][sx] = 0
Q = deque([(sy, sx)])
while Q:
    y, x = Q.pop()
    for dy, dx in product(range(-2, 3), repeat=2):
        ny, nx = y+dy, x+dx
        if dx==dy==0:
            G[y][x] = '#'
            continue
        elif ny<0 or h<=ny or nx<0 or w<=nx:
            continue
        elif G[ny][nx] == '#':
            continue
        elif abs(dy)+abs(dx)<=1:
            G[ny][nx] = '#'
            D[ny][nx] = D[y][x]
            Q.append((ny, nx))
        elif D[ny][nx] == 10**6:
            D[ny][nx] = D[y][x]+1
            Q.appendleft((ny, nx))
            
if D[gy][gx] == 10**6:
    print(-1)
else:
    print(D[gy][gx])
import numpy as np
N = int(input())
narray = np.arange(1,N+1)
P = np.hstack((narray , narray))
ans = 0
A = []
for i in range(N):
  for l in range(N):
    ans += narray[l] % P[i+l]
  A.append(ans)
  ans = 0
print(max(A))

### FIXED CODE ###

N = int(input())

print(N*(N-1)//2)
a = raw_input().split()
print(a[0]-a[1]+1)

### FIXED CODE ###

a = raw_input().split()
print(int(a[0])-int(a[1])+1)
mod = 10**9 + 7
n = int(input())
a = sorted(list(map(int,input().split())))

if n % 2 == 0:
  for i in range(n//2):
    if not a[2*i] == a[2*i+1] == 2*i+1:
      print(0)
      exit()
else:
  if a[0] != 0:
    print(0)
    exit()
  for i in range(n//2):
    if not a[2*i+1] == a[2*i+2] == 2*i+2
    print(0)
    exit()
print(pow(2, n//2) % mod)

### FIXED CODE ###

mod = 10**9 + 7
n = int(input())
a = sorted(list(map(int,input().split())))
 
if n % 2 == 0:
  for i in range(n//2):
    if not a[2*i] == a[2*i+1] == 2*i+1:
      print(0)
      exit()
else:
  if a[0] != 0:
    print(0)
    exit()
  for i in range(n//2):
    if not a[2*i+1] == a[2*i+2] == 2*i+2:
      print(0)
      exit()
print(pow(2, n//2) % mod)
A,B,C,D,E,F = map(int,input().split())

waters = set()
for w1 in range(0,F+1,B):
    if w1*100 > F: break
    for w2 in range(0,F+1,A):
        w = (w1+w2)*100
        if w > F: break
        if w==0: continue
        waters.add(w)

sugars = set()
for s1 in range(0,F+1,D):
    if s1 > F: break
    for s2 in range(0,F+1,C):
        s = s1+s2
        if s > F: break
        sugars.add(s)

ans_r = 0
ans_s = ans_w = None
for w in sorted(waters):
    if w > F: break
    for s in sorted(sugars):
        if w+s > F: break
        if s*100 > w*E: break
        r = 100*s/(s+w)
        if r > ans_r:
            ans_r = r
            ans_w = w
            ans_s = s
print(ans_s+ans_w, ans_s)

### FIXED CODE ###

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

ws = set()
i = j = 0
while True:
    j = 0
    if B*i > F//100: break
    while True:
        w = B*i + A*j
        if w > F//100: break
        ws.add(w)
        j += 1
    i += 1
ws = list(ws)
ws.sort()

ss = set()
i = j = 0
while True:
    j = 0
    if D*i > F: break
    while True:
        s = D*i + C*j
        if s > F: break
        ss.add(s)
        j += 1
    i += 1
ss = list(ss)
ss.sort()

limit = E / (100+E)
water = A*100
sugar = rate = 0
for w in ws:
    w = w*100
    if w == 0: continue
    if w > F: break
    for s in ss:
        if w+s > F: break
        r = s / (w+s)
        if r > limit: break
        if r > rate:
            rate = r
            water = w
            sugar = s
print(water+sugar, sugar)
a=list(map(int,input().sprit()))
if a[1]%a[0]==0:
    print(a[0]+a[1])
else:
    print(a[1]-a[0])

### FIXED CODE ###

a=list(map(int,input().split()))
if a[1]%a[0]==0:
    print(a[0]+a[1])
else:
    print(a[1]-a[0])
def segfunc(x, y): return max(x, y)

class SegmentTree:
    def __init__(self, arr):
        size = len(arr)
        n = 2 ** (size - 1).bit_length()
        self.n = n
        self.node = [0] * (2*n)
        for i in range(size):
            self.node[i+n-1] = arr[i]
        for i in reversed(range(n-2)):
            self.node[i] = segfunc(self.node[2*i+1], self.node[2*i+2])

    def update(self, i, x):
        i += self.n - 1
        self.node[i] = x
        while i > 0:
            i = (i - 1) // 2
            self.node[i] = segfunc(self.node[i * 2 + 1], self.node[i * 2 + 2])

    def update(self, x, val):
        x += (self.n - 1)
        self.node[x] = val
        while x > 0:
            x = (x - 1) // 2
            self.node[x] = segfunc(self.node[2 * x + 1], self.node[2 * x + 2])

    def query(self, a, b):
        res = 0
        l = self.n - 1 + a
        r = self.n - 1 + (b - 1)

        while l <= r:
            if l == r:
                res = segfunc(res, self.node[l])
                break

            if l % 2 == 0:
                res = segfunc(res, self.node[l])
            if r % 2 == 1:
                res = segfunc(res, self.node[r])
            l = l // 2
            r = r // 2 - 1

        return res

N, K = map(int, input().split())
INF = 0
seg = SegmentTree([0] * N)
for i in range(N):
    a = int(input())
    tmp = seg.query(max(a - K, 0), min(a + K, 300000) + 1) + 1
    seg.update(a, tmp)
print(seg.query(0, N))


### FIXED CODE ###

def segfunc(x, y): return max(x, y)

class SegmentTree:
    def __init__(self, arr):
        size = len(arr)
        n = 2 ** (size - 1).bit_length()
        self.n = n
        self.node = [0] * (2*n)
        for i in range(size):
            self.node[i+n-1] = arr[i]
        for i in reversed(range(n-2)):
            self.node[i] = segfunc(self.node[2*i+1], self.node[2*i+2])

    def update(self, i, x):
        i += self.n - 1
        self.node[i] = x
        while i > 0:
            i = (i - 1) // 2
            self.node[i] = segfunc(self.node[i * 2 + 1], self.node[i * 2 + 2])

    def update(self, x, val):
        x += (self.n - 1)
        self.node[x] = val
        while x > 0:
            x = (x - 1) // 2
            self.node[x] = segfunc(self.node[2 * x + 1], self.node[2 * x + 2])

    def query(self, a, b):
        res = 0
        l = self.n - 1 + a
        r = self.n - 1 + (b - 1)

        while l <= r:
            if l == r:
                res = segfunc(res, self.node[l])
                break

            if l % 2 == 0:
                res = segfunc(res, self.node[l])
            if r % 2 == 1:
                res = segfunc(res, self.node[r])
            l = l // 2
            r = r // 2 - 1

        return res

N, K = map(int, input().split())
INF = 0
seg = SegmentTree([0] * 300005)
for i in range(N):
    a = int(input())
    tmp = seg.query(max(a - K, 0), min(a + K, 300000) + 1) + 1
    seg.update(a, tmp)
print(seg.query(0, 300005))
S = input()
T = input()
A = S
if S == T:
  print('Yes')
else:
  eq = False:
  for i in range(len(S)):
    A = A[-1] + A[0:-1]
    if A == T:
      eq = True
      break
  if eq:
    print('Yes')
  else:
    print('No')
  

### FIXED CODE ###

S = input()
T = input()
A = S
if S == T:
  print('Yes')
else:
  eq = False
  for i in range(len(S)):
    A = A[-1] + A[0:-1]
    if A == T:
      eq = True
      break
  if eq:
    print('Yes')
  else:
    print('No')
n = input()
s = 0
a = input()
b = a.split(" ")
c = []
for i in range(n):
    c.append(int(b[i]))

for u in c:
    s=s+u

print(min(c),max(c),s)


### FIXED CODE ###

n = input()
s = 0
a = input()
b = a.split(" ")
c = []
for i in range(int(n)):
    c.append(int(b[i]))

for u in c:
    s=s+u

print(min(c),max(c),s)
s = input()
len_s = len(s)
ans = 0
for i in range(len_s - 4):
    for j in range(i + 4 , len_s + 1):
        if int(s[i:j]) % 2019 == 0:
            ans += 1
print(ans)

### FIXED CODE ###

s, w =[int(i) for i in input().split()]
if w >= s:
    print('unsafe')
else:
    print('safe')
import numpy as np

N = int(input())
Nloop = N + 1
A = np.zeros((Nloop, Nloop), dtype="int")
Acount = np.zeros(Nloop, dtype="int")

for i in range(1, Nloop):
    Acount[i] = int(input())
    for _ in range(Acount[i]):
        x, y = map(int, input().split())
        A[i, x] = 1 if y == 1 else -1

honest_loop = 2 ** N
honest_num = np.zeros(Nloop, dtype="int")

ans = 0

for i in range(1, honest_loop):
    for l in range(1, Nloop):
        honest_num[l] = 1 if i >> (l - 1) & 1 == 1 else -1

    check = np.dot(A, honest_num)

    honest_check = True
    for l in range(1, Nloop):
        # lの人が正直者のとき
        if honest_num[l] == 1 and Acount[l] != check[l]:
            honest_check = False

    if honest_check:
        ans = max(sum(honest_num == 1), ans)

print(ans)

### FIXED CODE ###

N = int(input())
Nloop = N + 1
A = [[0] * Nloop for _ in range(Nloop)]

for i in range(1, Nloop):
    Acount = int(input())
    for _ in range(Acount):
        x, y = map(int, input().split())
        if y == 1:
            A[i][x] = 1
        else:
            A[i][x] = -1

honest_loop = 2 ** N
is_honest = [False] * Nloop

ans = 0

for i in range(1, honest_loop):
    for l in range(1, Nloop):
        is_honest[l] = (i >> (l - 1) & 1 == 1)

    honest_check = True
    for l in range(1, Nloop):
        # lの人が正直者のとき
        if is_honest[l]:
            # lの人から見てjの人は正直者か？
            for j in range(1, Nloop):
                if A[l][j] == 1:
                    if not is_honest[j]:
                        honest_check = False
                elif A[l][j] == -1:
                    if is_honest[j]:
                        honest_check = False
                if not honest_check:
                    break
        if not honest_check:
            break

    if honest_check:
        ans = max(sum(is_honest), ans)

print(ans)
print(["NO","YES"][x in input()])

### FIXED CODE ###

print(["NO","YES"][input() in "357"])
n, x = map(int, input( ).split())
a = list(map(int, input().split()))
counter = 0
for i in sorted(a):
  x -= i
  if x < 0:
    print(counter)
  else:
    counter += 1
  if counter == n:
    print(n)
n, x = map(int, input( ).split())
a = list(map(int, input().split()))
counter = 0
for i in sorted(a):
  x -= i
  if x <= 0:
    print(counter)
  else:
    counter += 1
  if counter == n:
    print(n)


### FIXED CODE ###

n, x = map(int, input( ).split())
a = list(map(int, input().split()))
counter = 0
for i in sorted(a):
  x -= i
  counter += 1
  if x<0:
    print(counter-1)
    break
  elif x==0:
    print(counter)
    break
  else:
    if counter==n:
      print(counter-1)
N = int(input())
A = list(map(int, input().split()))
B = [ ]
c = 'non'
for i in A:
  B.append(list(bin(i)))
for i in range(10000):  
  for j in range(N):
    if B[j][-i-1] == '0':
      continue
    else:
      c = i
      break
  if c == 0:
    print(0)
    break
  elif c>0:
    print(i)
    break

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
B = [ ]
c = -1
for i in A:
  B.append(list(bin(i)))
for i in range(10000):  
  for j in range(N):
    if B[j][-i-1] == '0':
      continue
    else:
      c = i
      break
  if c == 0:
    print(0)
    break
  elif c>0:
    print(i)
    break
n,k = map(int,input().split())
ls = []

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

ls.sort()
for a,b in ls:
    if b >= k:
        print(x)
        break
    else:
        k -= b

### FIXED CODE ###

n,k = map(int,input().split())
ls = []

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

ls.sort()
for a,b in ls:
    if b >= k:
        print(a)
        break
    else:
        k -= b