Buggy python submission (verdict: Runtime Error):
def min_diag(A,B,C):
  segments=[A,B,C]
  segments.sort()
  return (segments[0]**2+segments[1]**2)**(1/2)

while True:
  # input one dataset
  A,B,C = tuple(map(int,input().split()))
  if (A,B,C) == (0,0,0):
    break
  n = int(input())
  R = [None]*n
  for i in range(n):
    R[i] = int(input())

  # process
  min_diag = min_diag(A,B,C)

  # judge & output
  for r in R:
    if min_diag < 2*r:
      print("OK")
    else:
      print("NA")

Fixed submission:
def min_diam(A,B,C): # returns a "diameter"
  segments=[A,B,C]
  segments.sort()
  return (segments[0]**2+segments[1]**2)**(1/2)

while True:
  # input one dataset
  A,B,C = tuple(map(float,input().split()))
  if (A,B,C) == (0,0,0):
    break
  n = int(input())
  R = [None]*n
  for i in range(n):
    R[i] = float(input())
  # process
  diam = min_diam(A,B,C)
  # judge & output
  for r in R:
    if diam < 2*r:
      print("OK")
    else:
      print("NA")

Buggy python submission (verdict: Runtime Error):
def min_diag(A,B,C):
  segments=[A,B,C]
  segments.sort()
  return (segments[0]**2+segments[1]**2)**(1/2)

while True:
  # input one dataset
  A,B,C = tuple(map(int,input().split()))
  if (A,B,C) == (0,0,0):
    break
  n = int(input())
  R = [None]*n
  for i in range(n):
    R[i] = int(input())

  # process
  min_diag = min_diag(A,B,C)

  # judge & output
  for r in R:
    if min_diag < 2*r:
      print("OK")
    else:
      print("NA")

Fixed submission:
def min_diam(A,B,C): # returns a "diameter"
  segments=[A,B,C]
  segments.sort()
  return (segments[0]**2+segments[1]**2)**(1/2)

while True:
  # input one dataset
  A,B,C = tuple(map(float,input().split()))
  if (A,B,C) == (0,0,0):
    break
  n = int(input())
  R = [None]*n
  for i in range(n):
    R[i] = float(input())
  # process
  diam = min_diam(A,B,C)
  # judge & output
  for r in R:
    if diam < 2*r:
      print("OK")
    else:
      print("NA")

Buggy python submission (verdict: Runtime Error):
def min_diag(A,B,C):
  segments=[A,B,C]
  segments.sort()
  return (segments[0]**2+segments[1]**2)**(1/2)

while True:
  # input one dataset
  A,B,C = tuple(map(float,input().split()))
  if (A,B,C) == (0,0,0):
    break
  n = int(input())
  R = [None]*n
  for i in range(n):
    R[i] = float(input())

  # process
  min_diag = min_diag(A,B,C)

  # judge & output
  for r in R:
    if min_diag < 2*r:
      print("OK")
    else:
      print("NA")

Fixed submission:
def min_diam(A,B,C): # returns a "diameter"
  segments=[A,B,C]
  segments.sort()
  return (segments[0]**2+segments[1]**2)**(1/2)

while True:
  # input one dataset
  A,B,C = tuple(map(float,input().split()))
  if (A,B,C) == (0,0,0):
    break
  n = int(input())
  R = [None]*n
  for i in range(n):
    R[i] = float(input())
  # process
  diam = min_diam(A,B,C)
  # judge & output
  for r in R:
    if diam < 2*r:
      print("OK")
    else:
      print("NA")

Buggy python submission (verdict: Runtime Error):
def min_diag(A,B,C):
  segments=[A,B,C]
  segments.sort()
  return (segments[0]**2+segments[1]**2)**(1/2)

while True:
  # input one dataset
  A,B,C = tuple(map(float,input().split()))
  if (A,B,C) == (0,0,0):
    break
  n = int(input())
  R = [None]*n
  for i in range(n):
    R[i] = float(input())
  # process
  min_diag = min_diag(A,B,C)
  # judge & output
  for r in R:
    if min_diag < 2*r:
      print("OK")
    else:
      print("NA")

Fixed submission:
def min_diam(A,B,C): # returns a "diameter"
  segments=[A,B,C]
  segments.sort()
  return (segments[0]**2+segments[1]**2)**(1/2)

while True:
  # input one dataset
  A,B,C = tuple(map(float,input().split()))
  if (A,B,C) == (0,0,0):
    break
  n = int(input())
  R = [None]*n
  for i in range(n):
    R[i] = float(input())
  # process
  diam = min_diam(A,B,C)
  # judge & output
  for r in R:
    if diam < 2*r:
      print("OK")
    else:
      print("NA")