Harryxun/stf_run huggingface dataset:
,m = map(int,input().split())

l = []

for i in range(m):
    ta,tb = map(int,input().split())
    l.append((ta-1,tb))
ans = [0]*n
l.sort()
if m ==0 and n==1:
    print(0)
    exit()
elif m ==0:
    print('1'+'0'*(n-1))
    exit()
elif n == 1:
    if len(set(l)) ==1:
        print(l[0][1])
    else:
        print(-1)
    exit()
elif l[0][1] == 0 and l[0][0]==0:
    print(-1)
    exit()
else:
    l = set(l)
    for i,j in l:
        if ans[i] ==0:
            ans[i] = j
        else:
            # print(i,j)
            print(-1)
            exit()
a = ''
for i in ans:
    a+=str(i)
if a[0]=='0':
    a='1'+a[1:]
print(a)

        
        


### FIXED CODE ###


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

l = []

for i in range(m):
    ta,tb = map(int,input().split())
    l.append((ta-1,tb))
ans = [0]*n
l.sort()
if m ==0 and n==1:
    print(0)
    exit()
elif m ==0:
    print('1'+'0'*(n-1))
    exit()
elif n == 1:
    if len(set(l)) ==1:
        print(l[0][1])
    else:
        print(-1)
    exit()
elif l[0][1] == 0 and l[0][0]==0:
    print(-1)
    exit()
else:
    l = set(l)
    for i,j in l:
        if ans[i] ==0:
            ans[i] = j
        else:
            # print(i,j)
            print(-1)
            exit()
a = ''
for i in ans:
    a+=str(i)
if a[0]=='0':
    a='1'+a[1:]
print(a)
うんち

### FIXED CODE ###

S=input()
T=input()
if S[0:len(T)-1] ==T[0:len(T)-1]:
    print("Yes")
else:
    print("No")
import sys
S = str(input())
l = list(S)
s = int(len(S))

num = 0
for i in range(s):
    if l[i] == l[i+1]:
        print("Bad")
        sys.exit()
    else:
        num += 1
        if num == 3:
            print("Yes")

### FIXED CODE ###

S = str(input())
l = list(S)

for i in range(len(S)-1):
    if l[i] == l[i+1]:
        print("Bad")
        break
else:
     print("Good")
import sys

def main():

	p = 0

	args = sys.argv
	n = int(args[1])
	
	print((int(n/2) + n%2 )/n)

if __name__ == "__main__":
    main()

### FIXED CODE ###

import sys

def main():

	p = 0

	args = sys.argv
	n = int(input())
	
	print((int(n/2) + n%2 )/n)

if __name__ == "__main__":
    main()
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees#, log2
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
A = [INT() for _ in range(N)]	

#dic = defaultdict(int)

for a in A:
	print(dic[a])
	dic[a] ^= 1

print(dic)
ans = 0
for x in dic:
	ans += dic[x]
print(ans)
	


### FIXED CODE ###

import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees#, log2
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()

num = defaultdict(int)

for _ in range(N):
	A = INT()
	num[A-1] ^= 1

ans = 0
for x in num:
	ans += num[x]

print(ans)
h, w = (int(i) for i in input().split()) 
s = []

for i in range(h):
  tmp = input()
  s.append(tmp)

#左にいくつあるか
l = [[0 for i in range(w)] for j in range(h)]

for i in range(h):
  for j in range(w):
    if s[i][j] == "#":
      l[i][j] = 0
    else:
      if j == 0:
        l[i][j] = 1
        continue
      l[i][j] = l[i][j-1] + 1
#print(l)
      
#上
d = [[0 for i in range(w)] for j in range(h)]

for j in range(w):
  for i in range(h):
    if s[i][j] == "#":
      d[i][j] = 0
    else:
      if i == 0:
        d[i][j] = 1
        continue
      d[i][j] = d[i-1][j] + 1  
#print(d)      

#右にいくつあるか
r = [[0 for i in range(w)] for j in range(h)]

for i in range(h):
  for j in range(w)[::-1]:
#    print(i,j)
    if s[i][j] == "#":
      r[i][j] = 0
    else:
      if j == w-1:
#        print("aa")
        r[i][j] = 1
        continue
      r[i][j] = r[i][j+1] + 1
      
#print(r)

#下
u = [[0 for i in range(w)] for j in range(h)]

for j in range(w):
  for i in range(h)[::-1]:
    if s[i][j] == "#":
      u[i][j] = 0
    else:
      if i == h-1:
        u[i][j] = 1
        continue
      u[i][j] = u[i+1][j] + 1

#print(u)


#足し合わせ
for i in range(h):
  for j in range(w):
    l[i][j] += r[i][j] + u[i][j] + d[i][j] -3

   
import numpy as np
l = np.array(l)
#print(l)
print(l.max())

### FIXED CODE ###

h, w = (int(i) for i in input().split()) 
s = []

for i in range(h):
  tmp = input()
  s.append(tmp)

#左にいくつあるか
l = [[0 for i in range(w)] for j in range(h)]

for i in range(h):
  for j in range(w):
    if s[i][j] == "#":
      l[i][j] = 0
    else:
      if j == 0:
        l[i][j] = 1
        continue
      l[i][j] = l[i][j-1] + 1
#print(l)
      
#上
d = [[0 for i in range(w)] for j in range(h)]

for j in range(w):
  for i in range(h):
    if s[i][j] == "#":
      d[i][j] = 0
    else:
      if i == 0:
        d[i][j] = 1
        continue
      d[i][j] = d[i-1][j] + 1  
#print(d)      

#右にいくつあるか
r = [[0 for i in range(w)] for j in range(h)]

for i in range(h):
  for j in range(w)[::-1]:
#    print(i,j)
    if s[i][j] == "#":
      r[i][j] = 0
    else:
      if j == w-1:
#        print("aa")
        r[i][j] = 1
        continue
      r[i][j] = r[i][j+1] + 1
      
#print(r)

#下
u = [[0 for i in range(w)] for j in range(h)]

for j in range(w):
  for i in range(h)[::-1]:
    if s[i][j] == "#":
      u[i][j] = 0
    else:
      if i == h-1:
        u[i][j] = 1
        continue
      u[i][j] = u[i+1][j] + 1

#print(u)


#足し合わせ
for i in range(h):
  for j in range(w):
    l[i][j] += r[i][j] + u[i][j] + d[i][j] -3

unko = []
for i in range(h):
  mm = max(l[i])
  unko.append(mm)

print(max(unko))
import math

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


def get_lcm(a, b):
    return (a * b) // math.gcd(a, b)


print(get_lcm(A, B))


### FIXED CODE ###

import fractions

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


def get_lcm(a, b):
    return (a * b) // fractions.gcd(a, b)


print(get_lcm(A, B))
import math
N = int(input())
A = [int(input()) for i in range(N)]
c=0
for i in range(N):
    x=abs(A[i])
    if x==2:c+=1
    if x<2 or x&1==0:continue
    if pow(1,x-1,x)==1 c+=1

print(c)

### FIXED CODE ###

def is_prime(x):
    if x==2:
        return 1
    elif x&1==0:
        return 0
    else: return pow(2,x-1,x)==1
N = int(input())
c=0
for i in range(N):
    c+=is_prime(int(input()))
print(c)
N = int(input())
v = list(map(int,input().split()))
v_even = [0 for i in range(10**5)]
v_odd = [0 for i in range(10**5)]
sum_even = 0
sum_odd = 0
for i in range(N):
    if i%2 :
        v_odd[v[i]] += 1
        sum_odd += 1
    else:
        v_even[v[i]] += 1
        sum_even += 1
max_odd = 0
odd = 0
max_even = 0
even = 0
for i in range(10**5):
    if v_odd[i] > max_odd:
        max_odd = v_odd[i]
        odd = i

for i in range(10**5):
    if v_even[i] > max_even:
        max_even = v_even[i]
        even = i

if odd != even:
    ans = sum_even - max_even + sum_odd - max_odd
else:
    v_odd[odd] = 0
    v_even[even] = 0
    ans = min((sum_even - max_even + sum_odd - max(v_odd)), sum_even - max(v_even) + sum_odd - max_odd)

print(ans)

### FIXED CODE ###

N = int(input())
v = list(map(int,input().split()))
v_even = [0 for i in range(max(v)+1)]
v_odd = [0 for i in range(max(v)+1)]
sum_even = 0
sum_odd = 0
for i in range(N):
    if i%2 :
        v_odd[v[i]] += 1
        sum_odd += 1
    else:
        v_even[v[i]] += 1
        sum_even += 1
max_odd = 0
odd = 0
max_even = 0
even = 0
for i in range(len(v_odd)):
    if v_odd[i] > max_odd:
        max_odd = v_odd[i]
        odd = i

for i in range(len(v_even)):
    if v_even[i] > max_even:
        max_even = v_even[i]
        even = i

if odd != even:
    ans = sum_even - max_even + sum_odd - max_odd
else:
    v_odd[odd] = 0
    v_even[even] = 0
    ans = min((sum_even - max_even + sum_odd - max(v_odd)), sum_even - max(v_even) + sum_odd - max_odd)

print(ans)
#include <bits/stdc++.h>
using namespace std;

int main(int argc, char const *argv[]){
	int r,g,b;
	cin >> r >> g >> b;
	if((100 * r + 10 * g + b) % 4 == 0)	cout << "YES\n" << endl;
	else puts("NO\n");
}

### FIXED CODE ###

r,g,b = map(int, input().split(' '))
temp = 100 * r + 10 * g + b
if temp % 4 == 0:
	print("YES")
else:
	print("NO")
import sys
import numpy as np
N=int(input())
nums=list(map(int,input().split(" ")))
ans_array=[]
#符号の統一
add=0
mode=0
if min(nums)>0: #全部正の場合
    mode=0
elif max(nums)<0: #全部負の場合
    mode=1
elif max(nums)==min(nums)==0: #全部0
    print("0")
    sys.exit()
else: #正負混合
    mode=2
count=0

if mode==2: #need to modify
    temp=[]
    if abs(max(nums))<abs(min(nums)):
        mode=1 #全部負にする
        add=min(nums)
        ind=np.argmin(nums)
    elif abs(max(nums))>abs(min(nums)):
        mode=0
        add=max(nums)
        ind=np.argmax(nums)
    for i in range(len(nums)):
        nums[i]+=add
        ans_array.append("{0} {1}".format(ind+1,i+1))
        count+=1
        
        

if mode==0: #全部正
    for i in range(len(nums)-1):
        nums[i+1]+=nums[i]
        count+=1
        ans_array.append("{0} {1}".format(i+1,i+2))
    print(count)
    for i in ans_array:
       print(i)
                

elif mode==1:
    nums.reverse()
    for i in range(len(nums)-1):
        nums[i+1]+=nums[i]
        count+=1    
        ans_array.append("{0} {1}".format(len(nums)-i,len(nums)-i-1))

    print(count)
    for i in ans_array:
       print(i)


### FIXED CODE ###

import sys
import numpy as np
N=int(input())
nums=list(map(int,input().split(" ")))
ans_array=[]
#符号の統一
add=0
mode=0
if min(nums)>0: #全部正の場合
    mode=0
elif max(nums)<0: #全部負の場合
    mode=1
elif max(nums)==min(nums)==0: #全部0
    print("0")
    sys.exit()
else: #正負混合
    mode=2
count=0

if mode==2: #need to modify
    temp=[]
    if abs(max(nums))<abs(min(nums)):
        mode=1 #全部負にする
        add=min(nums)
        ind=np.argmin(nums)
    elif abs(max(nums))>=abs(min(nums)):
        mode=0
        add=max(nums)
        ind=np.argmax(nums)
    for i in range(len(nums)):
        nums[i]+=add
        ans_array.append("{0} {1}".format(ind+1,i+1))
        count+=1
        
        

if mode==0: #全部正
    for i in range(len(nums)-1):
        nums[i+1]+=nums[i]
        count+=1
        ans_array.append("{0} {1}".format(i+1,i+2))
    print(count)
    for i in ans_array:
       print(i)
                

elif mode==1:
    nums.reverse()
    for i in range(len(nums)-1):
        nums[i+1]+=nums[i]
        count+=1    
        ans_array.append("{0} {1}".format(len(nums)-i,len(nums)-i-1))

    print(count)
    for i in ans_array:
       print(i)
import sys
import math
"""                                                                             
def solve():                                                                    
    while True:                                                                 
        s = raw_input()                                                         
        if s == "-":                                                            
            return                                                              
        n= int(raw_input())                                                     
        ns = ""                                                                 
        for i in range(n):                                                      
            c = int(raw_input())                                                
            ns = s[c:] + s[:c]                                                  
            s = ns                                                              
        print ns                                                                
"""

def solve():
    a,b,c,d = map(int,raw_input().split())
    r =	(a-c)**2 + (b-d)**2
    r =	math.sqrt(r)
    print r
if __name__ == "__main__":
    solve()

### FIXED CODE ###

import sys
import math
"""                                                                             
def solve():                                                                    
    while True:                                                                 
        s = raw_input()                                                         
        if s == "-":                                                            
            return                                                              
        n= int(raw_input())                                                     
        ns = ""                                                                 
        for i in range(n):                                                      
            c = int(raw_input())                                                
            ns = s[c:] + s[:c]                                                  
            s = ns                                                              
        print ns                                                                
"""

def solve():
    a,b,c,d = map(float,raw_input().split())
    r =	(a-c)**2 + (b-d)**2
    r =	math.sqrt(r)
    print r
if __name__ == "__main__":
    solve()
import sys
n = int(input())
mem = [None]*(n+1)
def DFS(k, d):
    if k<0 or d>2000:
        return 10**9
    if k==0:
        return 0
    if k<6:
        return k
    if mem[k] is not None:
        return mem[k]
    tmp = 10**5
    for i in range(1, 7):
        tmp = min(tmp, DFS(k-6**i, d+1)+1)
    for i in range(1, 6):
        tmp = min(tmp, DFS(k-9**i, d+1)+1)
    mem[k] = tmp
    return tmp
if n<6:
    print(n)
else:
    print(DFS(n, 0))

### FIXED CODE ###

import sys
n = int(input())
INF = 10*n
dp = [INF]*(n+1)
dp[0] = 0
for i in range(1, n+1):
    tmp = dp[i-1] + 1
    for j in range(10):
        if i-6**j<0:
            break
        tmp = min(tmp, dp[i-6**j] + 1)
    for j in range(10):
        if i-9**j<0:
            break
        tmp = min(tmp, dp[i-9**j] + 1)
    dp[i] = tmp
print(dp[n])
n, m = map(int, input().split())
A = list(map(int, input().split()))

A.sort(reverse=True)

if A[m] >= (sum(A) / (4 * m)):
    print("Yes")
else:
    print("No")

### FIXED CODE ###

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

A.sort(reverse=True)

if A[m-1] >= (sum(A)/(4*m)):
    print("Yes")
else:
    print("No")
import numpy as np


A, B, K = map(int, input().split())
x = np.arange(A, B+1)
y = x[:K]
z = x[-K:]
ans = np.concatenate([y,z])
ans = sorted(set(ans))
for i in ans:
    print(i)

### FIXED CODE ###

A, B, K = map(int, input().split())
x1 = set(range(A, A+K))
x2 = set(range(B, B-K, -1))
x = x1 | x2
ans = sorted(x)
for i in [x for x in ans if A <= x <= B]:
    print(i)
n,k = map(int,input())
h = [int(input()) for i in range(n)].sort()
ans = 1000000000
for i in range(n-k+1):
  ans = min(ans, h[i+k-1]-h[i])
print(ans)

### FIXED CODE ###

n,k = map(int,input().split())
h = sorted([int(input()) for i in range(n)])
ans = 1000000000
for i in range(n-k+1):
  ans = min(ans, h[i+k-1]-h[i])
print(ans)
while True:                                                                  
    (a, op, b) = input().split()
    a = int(a)
    b = int(b)

    if op = '?':
        break
    elif op = '+':
        print(a + b)
    elif op = '-':
        print(a - b)
    elif op = '*':
        print(a * b)
    elif op = '/':
        print(a // b)

### FIXED CODE ###

while True:
    (a, op, b) = input().split()
    a = int(a)
    b = int(b)

    if op == '?':
        break
    elif op == '+':
        print(a + b)
    elif op == '-':
        print(a - b)
    elif op == '*':
        print(a * b)
    elif op == '/':
        print(a // b)
a, b, k = map(int,input().split())

Answer = set([])
for i in range(K):
    if A+i <=B:
        Answer.add(A+i)
    if B - i >= A:
        Answer.add(B-i)
Answer = sorted(Answer)
for i in Answer:
    print(i)

### FIXED CODE ###

A, B, K = map(int, input().split())
a = [i for i in range(A, min(A+K,B))]
b = [i for i in range(max(A,B-K+1), B+1)]
for x in sorted(list(set(a + b))):
  print(x)
h, w, m = map(int, input().split())
h_cnt = [0 for i in range(h)]
w_cnt = [0 for i in range(w)]
bomb = set()
for _ in range(m):
    c_h, c_w = map(int, input().split())
    h_cnt[c_h-1] +=1
    w_cnt[c_w-1]+=1
    bomb.add(((c_h-1),(c_w-1)))

max_h = [i for i in range(len(h_cnt)) if h_cnt[i] == max(h_cnt)]
max_w = [i for i in range(len(w_cnt)) if h_cnt[i] == max(w_cnt)]

ans = []
for i in max_h:
    for j in max_w
    if (i,j) in bomb:
        ans.append(h_cnt[i] + w_cnt[j] -1)
    else:
        ans.append(h_cnt[i] + w_cnt[j])

print(max(ans))

### FIXED CODE ###

h, w, m = map(int, input().split())
h_cnt = [0 for i in range(h)]
w_cnt = [0 for i in range(w)]
bomb = set()

for i in range(m):
    _h, _w = map(int, input().split())
    h_cnt[_h-1] += 1
    w_cnt[_w-1] += 1
    bomb.add(((_h-1),(_w-1))) #爆破対象の位置を判断

h_max = max(h_cnt)
w_max = max(w_cnt)

max_h = []
max_w = []

for i in range(h):
    if h_cnt[i] == h_max:
        max_h.append(i)

for i in range(w):
    if w_cnt[i] == w_max:
        max_w.append(i)

flg = True

for i in max_h:
    for j in max_w:
        if (i,j) not in bomb:
            flg = False
            break
print(h_max+w_max-1 if flg else h_max+w_max)
import sys
s=input()
cnt=0
if s[0]!='A':
    print('WA')
elif s[1].isuper():
    print('WA')
elif s[-1].isuper():
    print('WA')
else:
    for i in range(2,len(s)-1):
        if s[i]=='C':
            cnt+=1
        else:
            if s[i].isupper():
                print('WA')
                sys.exit()
    if cnt==1:
        print('AC')
    else:
        print('WA')

### FIXED CODE ###

import sys
s=input()
cnt=0
if s[0]!='A':
    print('WA')
elif s[1].isupper():
    print('WA')
elif s[-1].isupper():
    print('WA')
else:
    for i in range(2,len(s)-1):
        if s[i]=='C':
            cnt+=1
        else:
            if s[i].isupper():
                print('WA')
                sys.exit()
    if cnt==1:
        print('AC')
    else:
        print('WA')
s = raw_input()

if 'B' not in s:
    print s
else:
    str_list = list(s)
    output_list = []
    for i, c in enumerate(str_list):
        if c != 'B':
            output_list.append(c)
        else:
            # if output_list:
            if len(output_list) > 0:
                output_list.pop()

print ''.join(output_list)


### FIXED CODE ###

s = raw_input()

str_list = list(s)
output_list = []
for i, c in enumerate(str_list):
    if c != 'B':
        output_list.append(c)
    else:
        if output_list:
            output_list.pop()

print ''.join(output_list)
N = int(input())
len_N = len(N)
num = int(str(N)[0]) + 1
if int(str(num) * len_N) < N:
  print(str(num) * len_N)
else:
  print(str(num + 1) * (len(str(N))))

### FIXED CODE ###

N = int(input())
len_N = len(str(N))
num = int(str(N)[0])
if int(str(num) * len_N) < N:
  print(str(num + 1) * len_N)
else:
  print(str(num) * (len(str(N))))
a,b,c = int(input()).split()

if a<= c <=b:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

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

if a<= c <=b:
  print('Yes')
else:
  print('No')
from functools import lru_cache

n = list(map(int, list(input())))
m = len(n)

@lru_cache(10**10)
def rec(keta, tight):
    if keta == m:
        if tight:
            return 1
        else:
            return 0
    tmp = float("inf")
    for i in range(10):
        if tight:
            if i == 0:
                tmp = min(tmp, rec(keta+1, True)+9-n[keta])

            elif i <= n[keta]:
                tmp = min(tmp, rec(keta+1, True)+i+10+i-1-n[keta])
            else:
                tmp = min(tmp, rec(keta+1, False)+i+i-1-n[keta])
        else:
            if i < n[keta]:
                tmp = min(tmp, rec(keta+1, True)+i+(10+i)-n[keta])
            else:
               tmp = min(tmp, rec(keta+1, False)+i+i-n[keta])
    return tmp

ans = rec(0, False)
print(ans)

### FIXED CODE ###

n = list(map(int, list(input())))
m = len(n)

DP = [[float("inf")]*2 for i in range(m+1)]
DP[0] = [0,1]

for i in range(m):
    # tight
    tmp = float("inf")
    for j in range(10):
        if j == 0:
            tmp = min(tmp, DP[i][1]+9-n[i])
        elif j <= n[i]:
            tmp = min(tmp, DP[i][1]+j+10+j-1-n[i])
        else:
            tmp = min(tmp, DP[i][0]+j+j-1-n[i])
    DP[i+1][1] = tmp

    # not tight
    tmp = float("inf")
    for j in range(10):
        if j < n[i]:
            tmp = min(tmp, DP[i][1]+j+(10+j)-n[i])
        else:
            tmp = min(tmp, DP[i][0]+j+j-n[i])
    DP[i+1][0] = tmp

print(DP[-1][0])
n = int(input())
for num in range(n+1):
  total = total + num
print(total)


### FIXED CODE ###

n = int(input())
total = 0
for num in range(n+1):
  total = total + num
print(total)
W = 101

def solve(N, xyh):
    for yy in range(W):
        for xx in range(W):
            H = set()
            Z = W ** 2 # INF
            for x, y, h in xyh:
                d = abs(xx - x) + abs(yy - y)
                if h > 0:
                    H.add(d + h)
                else:
                    Z = min(Z, d)
            if len(H) == 1:
                h = H.pop()
                if h <= Z:
                    return (xx, yy, h)

N = int(input())
xyh = [tuple(map(int, input().split())) for i in range(N)]
print(*solve(N, xyh))

### FIXED CODE ###

W = 101

def solve(xyh):
    for bx, by, bh in xyh:
        if bh > 0:
            break
    for yy in range(W):
        for xx in range(W):
            H = bh + abs(bx - xx) + abs(by - yy)
            for x, y, h in xyh:
                if max(H - abs(xx - x) - abs(yy - y), 0) != h:
                    break
            else:
                return (xx, yy, H)

N = int(input())
xyh = [tuple(map(int, input().split())) for i in range(N)]
print(*solve(xyh))
n,m=list(map(int,input().split()))
a=list(map(int,input().split()))
b=[]
s=0
for i in range(m):
    p=list(map(int,input().split()))
    b.append(p)
    s+=p[0]
b.sort(key=lambda x:-x[1])
a.sort()
if s>n:
    s=n
c=[]
i=0
sun=0
while sun>=s:
    for j in range(b[i][0]):
        c.append(b[i][1])
    sun+=b[i][0]
    i+=1
c.append(1)
print(c)
for u in range(s):
    if a[u]<c[u]:
        a[u]=c[u]
    
print(sum(a))

### FIXED CODE ###

n,m=list(map(int,input().split()))
a=list(map(int,input().split()))
b=[]
s=0
for i in range(m):
    p=list(map(int,input().split()))
    b.append(p)
    s+=p[0]
b.sort(key=lambda x:-x[1])
a.sort()
if s>n:
    s=n
c=[]
i=0
sun=0
while sun<s:
    for j in range(b[i][0]):
        c.append(b[i][1])
    sun+=b[i][0]
    i+=1
for u in range(s):
    if a[u]<c[u]:
        a[u]=c[u]
    
print(sum(a))
X=int(input())
for A in range(-120,120):
    for B in range(-120,120):
        if A**5-B**5==X:
            print(A,B)
            breakｓ

### FIXED CODE ###

import sys
X=int(input())
for A in range(-120,120):
    for B in range(-120,120):
        if A**5-B**5==X:
            print(A,B)
            sys.exit()