ZhenlongDai/ACPR huggingface dataset:
Problem: p02690
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import math
X = int(input())

for a in range(1, 101):
    for b in range(-1, 101):
        an = (a-b)*((a**4) + (a**3)*b + (a**2)*(b**2) + a*(b**3) + b**4)

        if an == X:
            print(a, b)
            exit()


Failing test case input:
244

Expected output:
1 -3


Actual output:
3 -1


Fixed submission (verdict: Accepted):
import math
X = int(input())

for a in range(1, 1500):
    a4 = a**4
    a3 = a**3
    a2 = a**2
    for b in range(-1500, 1500):
        an = (a-b)*(a4 + (a3)*b + (a2)*(b**2) + a*(b**3) + b**4)
        if an < 0:
            break

        if an == X:
            print(a, b)
            exit()

Problem: p02690
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
x = int(input())

lower = -1
upper = -1
for i in range(0, 100000):
    pow5 = pow(i, 5)
    if lower == -1 and pow5 >= x:
        lower = i - 1

    if upper == -1 and pow5 - pow(i-1, 5) >= x:
        upper = i
        break

for a in range(lower, upper+1):
    a5 = pow(a, 5)
    for b in range(-100000, a):
        if a5 - pow(b, 5) == x:
            print(a, b)
            exit(0)


print(0, 0)


Failing test case input:
244

Expected output:
1 -3


Actual output:
3 -1


Fixed submission (verdict: Accepted):
x = int(input())

lower = -1
upper = -1
for i in range(100000000):
    pow5 = pow(i, 5)
    if lower == -1 and pow5 >= x:
        lower = i - 1
        break

for i in range(lower, 100000000):
    pow5 = pow(i, 5)
    if upper == -1 and pow5 - pow(i-1, 5) >= x:
        upper = i
        break

for a in range(-upper-1, upper+1):
    a5 = pow(a, 5)
    for b in range(-upper-1, upper+1):
        if a5 - pow(b, 5) == x:
            print(a, b)
            exit(0)


print(0, 0)

Problem: p02690
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
i=int(input())
f=0
for j in range(-1000,1001):
    for k in range(j,1001):
        if j**5-k**5==i and j**5-k**5==-i:
            print(j, k)
            f=1
            break
    if f==1:
        break

Failing test case input:
244

Expected output:
1 -3


Actual output:

Fixed submission (verdict: Accepted):
i=int(input())
f=0
for j in range(150):
    for k in range(-150,150):
        if j**5-k**5==i:
            print(j, k)
            f=1
            break
    if f==1:
        break
Problem: p02690
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
X = int(input())

B = [n**5 for n in range(66)]

A = []

for i in range(66):
    a = i**5- X if i**5 >= X else X-i**5
    A.append(a)

for j in range(66):
    if A[j] in B:
        if j**5 >= X:
            print(j,B.index(A[j]))
            break
        else:
            print(-j,B.index(A[j]))
            break


Failing test case input:
244

Expected output:
1 -3


Actual output:
-1 3


Fixed submission (verdict: Accepted):
X = int(input())

B = [n**5 for n in range(200)]

A = []

for i in range(200):
    a = i**5- X if i**5 >= X else X-i**5
    A.append(a)

for j in range(200):
    if A[j] in B:
        a = j
        b = B.index(A[j])
        if a**5-b**5 == X:
            print(a,b)
        elif a**5+b**5 == X:
            print(a,-b)
        else:
            print(b,a)
        break

Problem: p02690
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import math
X = int(input())

d =math.floor(math.pow(X, 1.0/5.0))
for i in range(d+1):
    for j in range(d+1):
        if X-i**5==j**5:
            print(i,j)
            exit()

Failing test case input:
244

Expected output:
1 -3


Actual output:
1 3


Fixed submission (verdict: Accepted):
import math
X = int(input())

d =math.floor(math.pow(X, 1.0/4.0))
for i in range(-d-1,d+1,1):
    for j in range(-d-1,d+1,1):
        if X+j**5==i**5:
            print(i,j)
            exit()

Problem: p02690
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
x = int(input())

flag = False

for i in range(int(pow(x, 1/5))+1):
    a = x - i**5
    for j in range(int(pow(a, 1/5))+1):
        if j**5 == a:
            flag = True
            break
    if flag:
        print(j, -i)
        break


Failing test case input:
244

Expected output:
1 -3


Actual output:
3 -1


Fixed submission (verdict: Accepted):
x = int(input())

div = set()
for i in range(1, int(x**0.5)+1):
    if x % i == 0:
        div.add(i)
        div.add(x

div = list(div)

for d in div:
    for a in range(int(pow(x, 1/2))+1):
        b = a - d
        if a**5 - b**5 == x:
            print(a, b)
            break

Problem: p02690
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
X=int(input())
for i in range(-118,120):
  for j in range(-119,119):
    if i**5-(j)**5==X:
      print(i,j,sep=" ")
      break

Failing test case input:
244

Expected output:
1 -3


Actual output:
1 -3
3 -1


Fixed submission (verdict: Accepted):
X=int(input())
for i in range(-118,120):
  for j in range(-119,119):
    if i**5-(j)**5==X:
      print(i,j,sep=" ")
      break
  else:
    continue
  break
Problem: p02690
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
def main():
    import sys
    X=int(sys.stdin.readline())
    for i in range(-100,100):
        for j in range(-100,100):
            if i**5-j**5==X:
                print("{} {}".format(i,j))
                


main()

Failing test case input:
244

Expected output:
1 -3


Actual output:
1 -3
3 -1


Fixed submission (verdict: Accepted):
def main():
    import sys
    X=int(sys.stdin.readline())
    for i in range(-1000,1000):
        for j in range(-1000,1000):
            if i**5-j**5==X:
                print("{} {}".format(i,j))
                return
                


main()

Problem: p02690
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
x = int(input())

for a in range(126):
    for b in range(-126, 126):
        if x == 0: continue
        if x == a ** 5 - b ** 5:
            print(a, b)
 

Failing test case input:
244

Expected output:
1 -3


Actual output:
1 -3
3 -1


Fixed submission (verdict: Accepted):
x = int(input())

for a in range(126):
    for b in range(-126, 126):
        if x == 0: continue
        if x == a ** 5 - b ** 5:
            print(a, b)
            exit()

Problem: p02690
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
x = int(input())
count = 0
for i in range(-100,100, 1):
    for j in range(-100,100, 1):
        if i**5-j**5 == x:
            print(i,j,i**5-j**5)
            count=1
            break
    if count == 1:
        break

Failing test case input:
244

Expected output:
1 -3


Actual output:
1 -3 244


Fixed submission (verdict: Accepted):
x = int(input())
count = 0
for i in range(-1000,1000, 1):
    for j in range(-1000,1000, 1):
        if i**5-j**5 == x:
            print(i,j)
            count=1
            break
    if count == 1:
        break

Problem: p02690
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
def resolve():
    x = int(input())
    five = []
    for i in range(-1000, 1001):
        five.append(i ** 5)

    for i in range(len(five)):
        for j in range(len(five)):
            if x == five[i] - five[j]:
                print("{} {}".format(i - 999, j - 999))
                exit()
            elif x == five[j] - five[i]:
                print("{} {}".format(j - 999, i - 999))
                exit()

resolve()

Failing test case input:
244

Expected output:
1 -3


Actual output:
2 -2


Fixed submission (verdict: Accepted):
def resolve():
    x = int(input())
    five = []
    for i in range(-1000, 1001):
        five.append(i ** 5)

    for i in range(len(five)):
        for j in range(len(five)):
            if x == abs(five[i] - five[j]):
                if five[i] >= five[j]:
                    print("{} {}".format(i - 1000, j - 1000))
  
                else:
                    print("{} {}".format(j - 1000, i - 1000))

                    exit()

resolve()
Problem: p02690
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
x = int(input())
flag = True
for a in range(1, 65):
    for b in range(1, 65):
        if a ** 5 - b ** 5 == x:
            print(' '.join([str(a), str(b)]))
            flag = False
            break
    if not flag:
        break


Failing test case input:
244

Expected output:
1 -3


Actual output:

Fixed submission (verdict: Accepted):
x = int(input())
flag = True
for a in range(-500, 500):
    for b in range(-500, 500):
        if a ** 5 - b ** 5 == x:
            print(' '.join([str(a), str(b)]))
            flag = False
            break
    if not flag:
        break

Problem: p02690
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
x = int(input())
print(x)
a = 0
b = 0
for i in range(500):
  for j in range(-500, 500):
    if i**5 - j**5 == x:
      a = i
      b = j
      break
print("{0} {1}".format(a, b))

Failing test case input:
244

Expected output:
1 -3


Actual output:
244
3 -1


Fixed submission (verdict: Accepted):
import sys

x = int(input())

for a in range(500):
  for b in range(-500, 500):
    if a**5 - b**5 == x:
      print(a, b)
      sys.exit(0)

Problem: p02690
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
x = int(input())

rs = [i ** 5 for i in range(300)]

for r in rs:
    if r <= x:
        if x - r in rs:
            print(rs.index(r), rs.index(x - r))
            break
    if r > x:
        if r - x in rs:
            print(rs.index(r),  - rs.index(r - x))
            break


Failing test case input:
244

Expected output:
1 -3


Actual output:
1 3


Fixed submission (verdict: Accepted):
x = int(input())

rs = [i ** 5 for i in range(300)]

for r in rs:
    if r <= x:
        if x - r in rs:
            print(rs.index(r), - rs.index(x - r))
            break
    if r > x:
        if r - x in rs:
            print(rs.index(r), rs.index(r - x))
            break
Problem: p02690
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):

import sys
from bisect import bisect_left,bisect_right
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

def main():
    X=int(input())
    l=[i**5 for i in range(65)]
    for i,a in enumerate(l):
        for j,b in enumerate(l):
            if a+b==X:
                print(j,-i)
                exit()
            elif a-b==X:
                print(j,i)
                exit()
    

if __name__ == '__main__':
    main()


Failing test case input:
244

Expected output:
1 -3


Actual output:
3 -1


Fixed submission (verdict: Accepted):

import sys
from bisect import bisect_left,bisect_right
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

def main():
    X=int(input())
    l=[i**5 for i in range(2000)]
    for i,a in enumerate(l):
        for j,b in enumerate(l):
            if a-b==X:
                print(i,j)
                exit()
            elif a+b==X:
                print(i,-j)
                exit()
    raise Exception
    

if __name__ == '__main__':
    main()

Problem: p02690
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
from math import pow

x = int(input())

for a in range(x):
    b5 = a**5 - x
    b = pow(abs(b5), 1/5)
    print(b)
    if b == int(b):
        if b5 < 0:
            b = -b
        break

print(a, int(b))

Failing test case input:
244

Expected output:
1 -3


Actual output:
3.0024650813881837
3.0
1 -3


Fixed submission (verdict: Accepted):
x = int(input())

flag = 0

for a in range(x):
    b5 = a**5 - x
    for b in range(120):
        if abs(b5) == int(b**5):
            if b5 < 0:
                b = -b
            flag = 1
            break
    if flag:
        break

print(a, int(b))

Problem: p02690
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
x = int(input())

lower = -1
upper = -1
for i in range(100000000):
    pow5 = pow(i, 5)
    if lower == -1 and pow5 >= x:
        lower = i - 1

    if upper == -1 and pow5 - pow(i-1, 5) >= x:
        upper = i
        break

for a in range(lower, upper+1):
    a5 = pow(a, 5)
    for b in range(-a-1, a+1):
        if a5 - pow(b, 5) == x:
            print(a, b)
            exit(0)


print(0, 0)


Failing test case input:
244

Expected output:
1 -3


Actual output:
3 -1


Fixed submission (verdict: Accepted):
x = int(input())

lower = -1
upper = -1
for i in range(100000000):
    pow5 = pow(i, 5)
    if lower == -1 and pow5 >= x:
        lower = i - 1
        break

for i in range(lower, 100000000):
    pow5 = pow(i, 5)
    if upper == -1 and pow5 - pow(i-1, 5) >= x:
        upper = i
        break

for a in range(-upper-1, upper+1):
    a5 = pow(a, 5)
    for b in range(-upper-1, upper+1):
        if a5 - pow(b, 5) == x:
            print(a, b)
            exit(0)


print(0, 0)
Problem: p02690
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
s = int(input())
for i in range(0, s):
    for j in range(-s, s):
        if i**5-j**5 ==s:
            print(i, j)
            break

Failing test case input:
244

Expected output:
1 -3


Actual output:
1 -3
3 -1


Fixed submission (verdict: Accepted):
x=int(input())
for i in range(-200,200):
  for j in range(-200,200):
    if (i**5)-(j**5)==x:
      print(i,j)
      exit()

Problem: p02690
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
x = int(input())
import math
for i in range(10**5):
    z = (x - i ** 5)
    if z == 0:
        b = 0
    else:
        b = pow((x - i ** 5), -5)
    
    if i ** 5 - math.floor(abs(b)) ** 5 == x:
        print(i, math.floor(abs(b)))
        exit()
    if i ** 5 - (-math.floor(abs(b))) ** 5 == x:
        print(i, -math.floor(abs(b)))
        exit()
    if i ** 5 - math.ceil(abs(b)) ** 5 == x:
        print(i, math.ceil(abs(b)))
        exit()
    if i ** 5 - (-math.ceil(abs(b))) ** 5 == x:
        print(i, -math.ceil(abs(b)))
        exit()


Failing test case input:
244

Expected output:
1 -3


Actual output:
3 -1


Fixed submission (verdict: Accepted):
x = int(input())
import math
for i in range(10**5):
    z = (x - i ** 5)
    if z == 0:
        b = 0
    else:
        b = (x - i ** 5) ** (1/5)
    
    if i ** 5 - math.floor(abs(b)) ** 5 == x:
        print(i, math.floor(abs(b)))
        exit()
    if i ** 5 - (-math.floor(abs(b))) ** 5 == x:
        print(i, -math.floor(abs(b)))
        exit()
    if i ** 5 - math.ceil(abs(b)) ** 5 == x:
        print(i, math.ceil(abs(b)))
        exit()
    if i ** 5 - (-math.ceil(abs(b))) ** 5 == x:
        print(i, -math.ceil(abs(b)))
        exit()

Problem: p02690
Buggy submission (Python (3.8.2), verdict: Wrong Answer):

import math

def isAnswer(a, b, X):
    return int(math.pow(a, 5) - math.pow(b, 5)) == X

def pow5(x):
    if x < 0:
        return -1 * math.pow(abs(x), 5)
    return math.pow(x, 5)

def resolver(X):
    for b in range(-300, 300):
        a5 = X + pow5(b)
        if a5 < 0:
            continue
        a = int(math.pow(a5, 0.2))
        print(a5, a)
        if isAnswer(a, b, X):
            return a, b 
    return 0, 0

def main():
    X = int(input())
    a,b = resolver(X)
    print(a, b)

if __name__ == '__main__':
    main()


Failing test case input:
244

Expected output:
1 -3


Actual output:
1.0 1
1 -3


Fixed submission (verdict: Accepted):

import math

def isAnswer(a, b, X):
    return int(math.pow(a, 5) - math.pow(b, 5)) == X

def pow5(x):
    if x < 0:
        return -1 * math.pow(abs(x), 5)
    return math.pow(x, 5)

def resolver(X):
    for b in range(-300, 300):
        a5 = X + pow5(b)
        if a5 < 0:
            continue
        a = int(math.pow(a5, 0.2))
        if isAnswer(a, b, X):
            return a, b 
    return 0, 0

def main():
    X = int(input())
    a,b = resolver(X)
    print(a, b)

if __name__ == '__main__':
    main()
Problem: p02690
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
x = int(input())
for a in range(-120,121):
  for b in range(-120, 121):
    if a**5 - b**5 == x:
      print(a, b)
      break

Failing test case input:
244

Expected output:
1 -3


Actual output:
1 -3
3 -1


Fixed submission (verdict: Accepted):
x = int(input())
j = False
for a in range(-120,121):
  for b in range(-120, 121):
    if a**5 - b**5 == x:
      j = True
      break
  if j:
    break
print(a, b)

Problem: p02690
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
ma = lambda :map(int,input().split())
ni = lambda:int(input())
x = ma()
ma = 200
for i in range(ma):
    for j in range(-ma,ma):
        if (i**5 - j**5) ==x:
            print(i,j)
            exit()


Failing test case input:
244

Expected output:
1 -3


Actual output:

Fixed submission (verdict: Accepted):
ma = lambda :map(int,input().split())
ni = lambda:int(input())
x = ni()
ma = 200
for i in range(ma):
    for j in range(-ma,ma):
        if (i**5 - j**5) ==x:
            print(i,j)
            exit()

Problem: p02690
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
X = int(input())
A = [i for i in range(0, 100)]
B = [-i for i in range(0, 100)]
res = []
for i in range(len(A)):
  a = A[i]
  for j in range(len(B)):
    b = B[j]
    cal = a ** 5 - b ** 5
    if cal == X:
      res.append([a, b])


Failing test case input:
244

Expected output:
1 -3


Actual output:

Fixed submission (verdict: Accepted):
X = int(input())
A = [(i**5) for i in range(0, 1000)]
res = []
for i in range(len(A)):
  a = A[i]
  for j in range(len(A)):
    b = -A[j]
    cal = a - b
    cal2 = a + b
    if cal == X:
      print(i, -j)
      exit()
    elif cal2 == X:
      print(i, j)
      exit()

Problem: p02690
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
x = int(input())
for a in range(-200,201):
  for b in range(-200,201):
    if (a**5-b**5==x):
      print(a,b,sep= ' ')
      break

Failing test case input:
244

Expected output:
1 -3


Actual output:
1 -3
3 -1


Fixed submission (verdict: Accepted):
X = int(input())

for i in range(-130,131):
  for j in range(-130,131):
    if X == i**5 - j**5:
      print(i,j)
      exit()

Problem: p02690
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
X=int(input())

for a in range(-200,201):
    for b in range(-200,201):
        if a^5 - b^5 == X:
            print(a,b)
            exit()

Failing test case input:
244

Expected output:
1 -3


Actual output:
-200 60


Fixed submission (verdict: Accepted):
X=int(input())

for a in range(-200,201):
    for b in range(-200,201):
        if a**5 - b**5 == X:
            print(a,b)
            exit()
Problem: p02690
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):

import sys
from bisect import bisect_left,bisect_right
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

def main():
    X=int(input())
    l=[i**5 for i in range(100)]
    for i,a in enumerate(l):
        for j,b in enumerate(l):
            if a+b==X:
                print(j,-i)
                exit()
            elif a-b==X:
                print(j,i)
                exit()
    

if __name__ == '__main__':
    main()


Failing test case input:
244

Expected output:
1 -3


Actual output:
3 -1


Fixed submission (verdict: Accepted):

import sys
from bisect import bisect_left,bisect_right
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

def main():
    X=int(input())
    l=[i**5 for i in range(2000)]
    for i,a in enumerate(l):
        for j,b in enumerate(l):
            if a-b==X:
                print(i,j)
                exit()
            elif a+b==X:
                print(i,-j)
                exit()
    raise Exception
    

if __name__ == '__main__':
    main()

Problem: p02690
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
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

Failing test case input:
244

Expected output:
1 -3


Actual output:
1 -3
3 -1


Fixed submission (verdict: Accepted):
X = int(input())
for A in range(-120, 120):
    for B in range(-120, 120):
        if A**5 - B**5 == X:
            print(A,B)
            exit()

Problem: p02690
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
x = int(input())

q = 0
while abs(x) > q**5:
  q += 1

for A in range(-q, q+1):
  for B in range(-q, q+1):
    if A**5 - B**5 == x:
      print(A,B)
      break

Failing test case input:
244

Expected output:
1 -3


Actual output:
1 -3
3 -1


Fixed submission (verdict: Accepted):
x = int(input())

q = 0
while abs(x) > q**4:
  q += 1

deta = False
for A in range(-q, q+1):
  if deta:
    break
  for B in range(-q, q+1):
    if A**5 - B**5 == x:
      print(A,B)
      deta = True
      break
Problem: p02690
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
x = int(input())
s = []
flag = 0

for i in range(-100, 100):
    s.append(i**5)

a = -80

for n in s:
    b = -80
    for m in s:
        if n-m == x:
            print(a,b)
            flag = 1
            break
        if flag:
            break
        b += 1

    a += 1

Failing test case input:
244

Expected output:
1 -3


Actual output:
21 17


Fixed submission (verdict: Accepted):
x = int(input())
s = []
flag = 0

for i in range(-200, 200):
    s.append(i**5)

a = -200

for n in s:
    b = -200
    for m in s:
        if n-m == x:
            print(a,b)
            flag = 1
            break
        if flag:
            break
        b += 1

    a += 1

Problem: p02690
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
x = int(input())

lower = -1
upper = -1
for i in range(0, 1000):
    pow5 = pow(i, 5)
    if lower == -1 and pow5 > x:
        lower = i - 1

    if upper == -1 and pow5 - pow(i-1, 5) > x:
        upper = i
        break

for a in range(lower, upper+1):
    print(a)
    a5 = pow(a, 5)
    for b in range(-100, a):
        if a5 - pow(b, 5) == x:
            print(a, b)
            exit(0)

print("no")


Failing test case input:
244

Expected output:
1 -3


Actual output:
3
3 -1


Fixed submission (verdict: Accepted):
x = int(input())

lower = -1
upper = -1
for i in range(100000000):
    pow5 = pow(i, 5)
    if lower == -1 and pow5 >= x:
        lower = i - 1
        break

for i in range(lower, 100000000):
    pow5 = pow(i, 5)
    if upper == -1 and pow5 - pow(i-1, 5) >= x:
        upper = i
        break

for a in range(-upper-1, upper+1):
    a5 = pow(a, 5)
    for b in range(-upper-1, upper+1):
        if a5 - pow(b, 5) == x:
            print(a, b)
            exit(0)


print(0, 0)

Problem: p02690
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
ans = int(input())
res = round(ans**0.2)

for i in range(-res, res+1):
    for j in range(-res, res+1):
        if j**5 - i**5 == ans:
            print(i,j)
            exit()


Failing test case input:
244

Expected output:
1 -3


Actual output:
-3 1


Fixed submission (verdict: Accepted):
ans = int(input())
res = 10*round(ans**0.2)

for i in range(-res, res+1):
    for j in range(-res, res+1):
        if i**5 - j**5 == ans:
            print(i,j)
            exit()

Problem: p02690
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
x = int(input())

for a in range(-200, 200):
    for b in range(-200, 200):
        if a**5 - b**5 == x:
            print(a, b)
            break

Failing test case input:
244

Expected output:
1 -3


Actual output:
1 -3
3 -1


Fixed submission (verdict: Accepted):
x = int(input())

for a in range(-200, 200):
    for b in range(-200, 200):
        if a**5 - b**5 == x:
            print(a, b)
            exit()
Problem: p02690
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
X = int(input())

for i in range(-200,200,1):
    for j in range(-200,200,1):
        if (i**5 - j**5) == X:
            print(str(i) + ' ' + str(j))
            break



Failing test case input:
244

Expected output:
1 -3


Actual output:
1 -3
3 -1


Fixed submission (verdict: Accepted):
X = int(input())

for i in range(-200,200,1):
    for j in range(-200,200,1):
        if (i**5 - j**5) == X:
            print(str(i) + ' ' + str(j))
            break
    else:
        continue
    break

Problem: p02690
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):

x = int(input())
for a in range(-500,500):
    for b in range(500):
        if a**5-b**5==x:
            print(a,b)
            exit()


Failing test case input:
244

Expected output:
1 -3


Actual output:

Fixed submission (verdict: Accepted):
x = int(input())
for a in range(-300,300):
    for b in range(-300,300):
        if a**5-b**5==x:
            print(a,b)
            exit()

Problem: p02690
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
x = int(input())

xset = set([])

for i in range(1000):
    xset.add(i**5)
    xset.add(-i**5)

for xx in xset:
    if xx+x in xset:
        a5 = xx
        b5 = xx+x

if a5 < 0:
    a = -pow(-a5, 0.2)
else:
    a = pow(a5, 0.2)

if b5 < 0:
    b = -pow(-b5, 0.2)
else:
    b = pow(b5, 0.2)

print(int(a), int(b))

Failing test case input:
244

Expected output:
1 -3


Actual output:
-1 3


Fixed submission (verdict: Accepted):
x = int(input())

xset = set([])

for i in range(10000):
    xset.add(i**5)
    xset.add(-i**5)

for xx in xset:
    if xx+x in xset:
        a5 = xx+x
        b5 = xx

if a5 < 0:
    a = -pow(-a5, 0.2)
else:
    a = pow(a5, 0.2)

if b5 < 0:
    b = -pow(-b5, 0.2)
else:
    b = pow(b5, 0.2)

print(int(a), int(b))

Problem: p02690
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
x=int(input())
for i in range(-500,501):
    for j in range(-500,501):
        if i**5+j**5==x:
            print(i,j)
            exit()

Failing test case input:
244

Expected output:
1 -3


Actual output:
1 3


Fixed submission (verdict: Accepted):
x=int(input())
for i in range(-500,501):
    for j in range(-500,501):
        if i**5-j**5==x:
            print(i,j)
            exit()

Problem: p02690
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
x = int(input())
for i in range(400):
  for j in range(400):
    if (i-200)**5-(j-200)**5 == x:
      print(i, j)
      break
  else:
    continue
  break

Failing test case input:
244

Expected output:
1 -3


Actual output:
201 197


Fixed submission (verdict: Accepted):
x = int(input())
for i in range(241):
  for j in range(241):
    if (i-120)**5-(j-120)**5 == x:
      print(i-120, j-120)
      break
  else:
    continue
  break
Problem: p02690
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
x=int(input())
fifth_power=[0]*200
for i in range(200):
    fifth_power[i]=(i+1)**5
for i in range(200):
    if x==1:
        print(0,-1)
        break
    elif fifth_power.count(abs(x-fifth_power[i]))==1:
        if fifth_power[fifth_power.index(abs(x-fifth_power[i]))]-fifth_power[1]==x and i%2==0:
            print(fifth_power.index(abs(x-fifth_power[i]))+1,i+1)
            break
        else:
            print(fifth_power.index(abs(x-fifth_power[i]))+1,-i-1)
            break

Failing test case input:
244

Expected output:
1 -3


Actual output:
3 -1


Fixed submission (verdict: Accepted):
x=int(input())
fifth_power=[0]*200
for i in range(200):
    fifth_power[i]=(i+1)**5
for i in range(200):
    t=abs(x-fifth_power[i])
    if x==1:
        print(0,-1)
        break
    elif fifth_power.count(t)==1:
        if fifth_power[i]-t==x:
            print(i+1,fifth_power.index(t)+1)
            break
        else:
            print(i+1,-fifth_power.index(t)-1)
            break

Problem: p02690
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
x=int(input())
fifth_power=[0]*200
for i in range(200):
    fifth_power[i]=(i+1)**5
for i in range(200):
    if x==1:
        print(0,-1)
        break
    elif fifth_power.count(abs(x-fifth_power[i]))==1:
        if fifth_power[fifth_power.index(abs(x-fifth_power[i]))]-fifth_power[1]==x and i%2==1:
            print(fifth_power.index(abs(x-fifth_power[i]))+1,i)
            break
        else:
            print(fifth_power.index(abs(x-fifth_power[i]))+1,-1)
            break

Failing test case input:
244

Expected output:
1 -3


Actual output:
3 -1


Fixed submission (verdict: Accepted):
x=int(input())
fifth_power=[0]*200
for i in range(200):
    fifth_power[i]=(i+1)**5
for i in range(200):
    t=abs(x-fifth_power[i])
    if x==1:
        print(0,-1)
        break
    elif fifth_power.count(t)==1:
        if fifth_power[i]-t==x:
            print(i+1,fifth_power.index(t)+1)
            break
        else:
            print(i+1,-fifth_power.index(t)-1)
            break

Problem: p02690
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
x = int(input())
i = -1
while (i + 1) ** 5 - i ** 5 < x:
    i += 1
    j = i
    while i ** 5 - j ** 5 < x:
        j -= 1
        
        if i ** 5 - j ** 5 == 0:
            break
    else:
        continue
    break
if x == 1:
    print(1, 0)
else:
    print(i, j)

Failing test case input:
244

Expected output:
1 -3


Actual output:
3 -1


Fixed submission (verdict: Accepted):
x = int(input())
a = 0
if x == 0:
    print(0, 0)
else:
    while a ** 5 - (a - 1) ** 5 <= x:
        a += 1
        b = a
        while a ** 5 - b ** 5 < x:
            b -= 1
            if a ** 5 - b ** 5 == x:
                break
        else:
            continue
        break
    print(a, b)
Problem: p02690
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
X = int(input())

for i in range(10**3):
    if i**5 -(X-i)**5 == X:
        print(i, X-i)
        exit()

Failing test case input:
244

Expected output:
1 -3


Actual output:

Fixed submission (verdict: Accepted):
X = int(input())

for i in range(-200, 200):
    for j in range(-200, 200):
        if i**5 -j**5 == X:
            print(i, j)
            exit()

Problem: p02690
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
x = int(input())
for i in range(1, 200):
    resid = i ** 5 - x
    for j in range(-200, 200):
        if j**5 == resid:
            print(i, j)
            break

Failing test case input:
244

Expected output:
1 -3


Actual output:
1 -3
3 -1


Fixed submission (verdict: Accepted):
x = int(input())
flag = False

for i in range(1, 200):
    resid = i ** 5 - x
    for j in range(-200, 200):
        if j**5 == resid:
            print(i, j)
            flag = True
            break
    if flag:
        break

Problem: p02690
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
x = int(input())

for a in range(-100, 100):
    for b in range(-100, 100):
        if a**5 + b**5 == x:
            print(a, b)
            exit()

Failing test case input:
244

Expected output:
1 -3


Actual output:
1 3


Fixed submission (verdict: Accepted):
x = int(input())

for a in range(-200, 200):
    for b in range(-200, 200):
        if a**5 - b**5 == x:
            print(a, b)
            break
    else:
        continue
    break

Problem: p02690
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
x = int(input())


for i in range(-150,150):
    for j in range(-149,151):
        if i^5 - j^5 == x:
            print(i,j)
            exit()

Failing test case input:
244

Expected output:
1 -3


Actual output:
-150 106


Fixed submission (verdict: Accepted):
x = int(input())


for i in range(-150,150):
    for j in range(-151,149):
        if i**5 - j**5 == x:
            print(i,j)
            exit()

Problem: p02690
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
X = int(input())
C = 0
for i in range(-0000,1000):
	if C == 1:
		break
	for j in range(-0000,1000):
		if i**5-j**5 == X:
			print(i,j)
			C += 1
			break

Failing test case input:
244

Expected output:
1 -3


Actual output:

Fixed submission (verdict: Accepted):
X = int(input())
C = 0
for i in range(-1000,1000):
	if C == 1:
		break
	for j in range(-1000,1000):
		if i**5-j**5 == X:
			print(i,j)
			C += 1
			break

Problem: p02690
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
x=int(input())
f=0
for i in range(x):
  for j in range(i+1,x+1):
    if (i**5-j**5)==x:
      print(i,j)
      f=1
  if f==1:
    break
 

Failing test case input:
244

Expected output:
1 -3


Actual output:

Fixed submission (verdict: Accepted):
x=int(input())
f=0
for i in range(1000):
  for j in range(-1000,1000):
    if (i**5-j**5)==x:
      print(i,j)
      f=1
  if f==1:
    break
Problem: p02690
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
import math
X=int(input())
c=math.ceil(X**0.3)
answers=[]
for a in range(-c,c+1):
    for b in range(-c,c+1):
        if pow(a,5)-pow(b,5)==X:
            answers.append(a)
            answers.append(b)
            break
print(answers)


Failing test case input:
244

Expected output:
1 -3


Actual output:
[1, -3, 3, -1]


Fixed submission (verdict: Accepted):
import math
X=int(input())
a=pow(10,9)
c=math.ceil(a**0.3)
answers=[]
for a in range(-c,c+1):
    for b in range(-c,c+1):
        if pow(a,5)-pow(b,5)==X:
            answers.append(a)
            answers.append(b)
            break
print(answers[0],answers[1])

Problem: p02690
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
x = int(input())
for i in range(-200,200):
  for j in range(-200,200):
    if(i**5-j**5==x):
      print(i,j)
      break
      
    

Failing test case input:
244

Expected output:
1 -3


Actual output:
1 -3
3 -1


Fixed submission (verdict: Accepted):
x = int(input())
judge = 0
for i in range(-200,200):
  for j in range(-200,200):
    if(i**5-j**5==x):
      print(i,j)
      judge += 1
      break
  if(judge == 1):
    break

Problem: p02690
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
X=int(input())
a=1
while a<1001:
    for i in range(-1000,1001):
        if a**5+i**5==X:
            b=i
            print(a,b)
            exit()
    a+=1

Failing test case input:
244

Expected output:
1 -3


Actual output:
1 3


Fixed submission (verdict: Accepted):
X=int(input())
a=1
while a<1001:
    for i in range(-1000,1001):
        if a**5-i**5==X:
            b=i
            print(a,b)
            exit()
    a+=1

Problem: p02690
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
x = int(input())
for i in range(-150,150):
  for j in range(-150,150):
    if (i**5 - j**5 == x):
      print(i,j)

Failing test case input:
244

Expected output:
1 -3


Actual output:
1 -3
3 -1


Fixed submission (verdict: Accepted):
x = int(input())
for i in range(-150,150):
  for j in range(-150,150):
    if (i**5 - j**5 == x):
      print(i,j)
      exit(0)
Problem: p02690
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):

import sys
import math

def solve(X: int):
    A = int(math.pow(X, 1.0/5.0) + 0.5)
    B5 = A ** 5 - X
    if B5 < 0:
        B = -1 * int(math.pow(-B5, 1.0/5.0))
    else:
        B = int(math.pow(B5, 1.0/5.0))
    print(A, B)
    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    X = int(next(tokens))  
    solve(X)

if __name__ == '__main__':
    main()


Failing test case input:
244

Expected output:
1 -3


Actual output:
3 -1


Fixed submission (verdict: Accepted):

import sys



def solve(X: int):
    for i in range(-120, 120):
        for j in range(-120, 120):
            if i ** 5 - j ** 5 == X:
                print(i, j)
                return
    



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    X = int(next(tokens))  
    solve(X)

if __name__ == '__main__':
    main()

Problem: p02690
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
x=int(input())
a=0
b=0
for i in range(-x,x):
  for j in range(-i,x):
    if i**5-j**5==x:
      a=i
      b=j
      break
  else:
    continue
  break
print(a,b)

Failing test case input:
244

Expected output:
1 -3


Actual output:
3 -1


Fixed submission (verdict: Accepted):
x=int(input())
a=0
b=0
for i in range(-500,500):
  for j in range(-500,500):
    if i**5-j**5==x:
      a=i
      b=j
      break
  else:
    continue
  break
print(a,b)

Problem: p02690
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
def foo():
    for i in range(len(F)):
        for j in range(len(F)):
            if F[i] + F[j] == X:
                print(i, j)
                return
            if F[i] - F[j] == X:
                print(i, -j)
                return
X = int(input())
F = [i**5 for i in range(1000)]
flg = False
foo()

Failing test case input:
244

Expected output:
1 -3


Actual output:
1 3


Fixed submission (verdict: Accepted):
def foo():
    for i in range(len(F)):
        for j in range(len(F)):
            if F[i] + F[j] == X:
                print(i, -j)
                return
            if F[i] - F[j] == X:
                print(i, j)
                return
X = int(input())
F = [i**5 for i in range(1000)]
flg = False
foo()
Problem: p02690
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):

import sys


def solve(X: int):
    
    for a in range(0, 101):
        for b in range(0, -101, -1):
            if a**5 + b**5 == X:
                print(a, b)
                exit()

    for a in range(0, 121):
        for b in range(0, 120):
            if a**5 + b**5 == X:
                print(a, b)
                exit()

    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    X = int(next(tokens))  
    solve(X)


if __name__ == '__main__':
    main()


Failing test case input:
244

Expected output:
1 -3


Actual output:
1 3


Fixed submission (verdict: Accepted):

import sys


def solve(X: int):
    
    for a in range(0, 101):
        for b in range(0, -101, -1):
            if a**5 - b**5 == X:
                print(a, b)
                exit()

    for a in range(0, 121):
        for b in range(0, 120):
            if a**5 - b**5 == X:
                print(a, b)
                exit()

    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    X = int(next(tokens))  
    solve(X)


if __name__ == '__main__':
    main()

Problem: p02690
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
def solve(x):

    b = -100
    a = -1
    while a**5 - b**5 != x:
        a += 1
        b = -100
        while b < 100 :
            if x + b **5 == a**5:
                break
            else:
                b += 1

    return a, b

if __name__ == "__main__":
    x = int(input())
    print(solve(x))

Failing test case input:
244

Expected output:
1 -3


Actual output:
(1, -3)


Fixed submission (verdict: Accepted):
def solve(x):

    a = -1000
    while a <= 1000:
        b = -1000
        while b < 1000 :
            if x + b **5 == a**5:
                break
            else:
                b += 1
        if x + b **5 == a**5:
            break
        else:
            a+=1

    return "{0} {1}".format(a,b)

if __name__ == "__main__":
    x = int(input())
    print(solve(x))

Problem: p02690
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
kai = int(input())
for x in range(-1000,kai):
    for y in range(-1000,kai):
        if x**5 - y**5 == kai:
            print(x,y)

Failing test case input:
244

Expected output:
1 -3


Actual output:
1 -3
3 -1


Fixed submission (verdict: Accepted):
num = int(input())
for i in range(-128,128):
    for j in range(-128,128):
        if i ** 5 - j **5 == num:
            print(i,j)
            exit()
Problem: p02690
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
x = int(input())

for a in range(1000):
    for b in range(-1000, 1000):
        a = pow(a,5)
        b = pow(b,5)
        if a - b == x:
            print(a,b)
            exit()


Failing test case input:
244

Expected output:
1 -3


Actual output:
1 -243


Fixed submission (verdict: Accepted):
x = int(input())

for a in range(1000):
    for b in range(-1000, 1000):
        ai = pow(a,5)
        bi = pow(b,5)
        if ai - bi == x:
            print(a,b)
            exit()

Problem: p02690
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
X = int(input())
l = list()
i = int()
while i**5-(i-1)**5 <= 10**9:
    l.append(i**5)
    l.append(0-i**5)
    i += 1
for i in range(len(l)):
    for j in range(i, len(l)):
        if abs(l[i]-l[j])==X:
            if l[i]-l[j]==X:
                A=l[i]
                B=l[j]
            else:
                A=l[j]
                B=l[i]
            A=A**0.2
            B=B**0.2
            print(A, B)
            exit()


Failing test case input:
244

Expected output:
1 -3


Actual output:
1.0 (2.4270509831248424+1.7633557568774194j)


Fixed submission (verdict: Accepted):
X = int(input())
l = list()
i = int()
while i**5-(i-1)**5 <= 10**9:
    l.append(i**5)
    l.append(0-i**5)
    i += 1
for i in range(len(l)):
    for j in range(i, len(l)):
        if abs(l[i]-l[j])==X:
            if l[i]-l[j]==X:
                A=l[i]
                B=l[j]
            else:
                A=l[j]
                B=l[i]
            
            ifAM=False
            ifBM=False
            if A<0:
                ifAM=True
            if B<0:
                ifBM=True
            A=int(abs(A)**0.2)
            B=int(abs(B)**0.2)
            if ifAM:
                A=0-A
            if ifBM:
                B=0-B
            print(A, B)
            exit()

Problem: p02690
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
x = int(input())

lower = -1
upper = -1
for i in range(100000000):
    pow5 = pow(i, 5)
    if lower == -1 and pow5 >= x:
        lower = i - 1
        break

for i in range(lower, 100000000):
    pow5 = pow(i, 5)
    if upper == -1 and pow5 - pow(i-1, 5) >= x:
        upper = i
        break

for a in range(lower-1, upper+1):
    a5 = pow(a, 5)
    for b in range(-upper-1, upper+1):
        if a5 - pow(b, 5) == x:
            print(a, b)
            exit(0)


print(0, 0)


Failing test case input:
244

Expected output:
1 -3


Actual output:
3 -1


Fixed submission (verdict: Accepted):
x = int(input())

lower = -1
upper = -1
for i in range(100000000):
    pow5 = pow(i, 5)
    if lower == -1 and pow5 >= x:
        lower = i - 1
        break

for i in range(lower, 100000000):
    pow5 = pow(i, 5)
    if upper == -1 and pow5 - pow(i-1, 5) >= x:
        upper = i
        break

for a in range(-upper-1, upper+1):
    a5 = pow(a, 5)
    for b in range(-upper-1, upper+1):
        if a5 - pow(b, 5) == x:
            print(a, b)
            exit(0)


print(0, 0)
Problem: p02690
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
x = int(input())
a,b = 0,0
for i in range(int(x**0.2)+1):
    for j in range(int(x**0.2)+1):
        if i**5 - j**5 == x:
            a = i
            b = j
            break
        elif i**5 + j**5 == x:
            a = i
            b = -j
            break
print(a,b)

Failing test case input:
244

Expected output:
1 -3


Actual output:
3 -1


Fixed submission (verdict: Accepted):
x = int(input())
a,b = 0,0
f = 0
for i in range(int(x**0.25)+1):
    for j in range(int(x**0.25)+1):
        if i**5 - j**5 == x:
            a = i
            b = j
            f = 1
            break
        elif i**5 + j**5 == x:
            a = i
            b = -j
            f = 1
            break
    if f:
        break
print(a,b)

Problem: p02690
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
from collections import defaultdict as dc
x = int(input())
d = dc(lambda:0)
for i in range(10):
    d[i**5] = i

f=0
l = list(d.items())

for i in range(len(l)):
    for j in range(len(l)):
        if l[i][0] - l[j][0] == x:
            print(l[i][1],l[j][1])
            f=1
            break 
        elif l[i][0] + l[j][0] == x:
            print(l[j][1] ,- l[i][1])
            f=1
            break
    if f == 1:
        break

Failing test case input:
244

Expected output:
1 -3


Actual output:
3 -1


Fixed submission (verdict: Accepted):
from collections import defaultdict as dc
x = int(input())
d = dc(lambda:0)
for i in range(200):
    d[i**5] = i

f=0
l = list(d.items())

for i in range(len(l)):
    for j in range(len(l)):
        if l[i][0] - l[j][0] == x:
            print(l[i][1],l[j][1])
            f=1
            break 
        elif l[i][0] + l[j][0] == x:
            print(l[i][1] ,- l[j][1])
            f=1
            break
    if f == 1:
        break

Problem: p02690
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
from sys import stdin
import sys
import math

X = int(input())

x = int(math.sqrt(X) + 1)






a5 = []
for i in range(100):
    a5.append(i ** 5)

b5 = []
for j in range(100):
    b5.append(j ** 5)

ans_a = 0
ans_b = 0

for a in a5:
    for b in b5:
        if a - b == X:
            print("%d %d" % (a5.index(a), b5.index(b)))
            sys.exit()
        elif a + b == X:
            print("%d %d" % (b5.index(b), (a5.index(a)) * (-1)))
            sys.exit()


Failing test case input:
244

Expected output:
1 -3


Actual output:
3 -1


Fixed submission (verdict: Accepted):
from sys import stdin
import sys
import math

X = int(input())

x = int(math.sqrt(X) + 1)






a5 = []
for i in range(1000):
    a5.append(i ** 5)

b5 = []
for j in range(1000):
    b5.append(j ** 5)

ans_a = 0
ans_b = 0

for a in a5:
    for b in b5:
        if a - b == X:
            print("%d %d" % (a5.index(a), b5.index(b)))
            sys.exit()
        elif a + b == X:
            print("%d %d" % (a5.index(a), -1 * b5.index(b)))
            sys.exit()