output_description: For each dataset, print in a line two numbers describing the height and width,
  namely _h_ and _w_ (> _h_), of the smallest wide integral rectangle bigger
  than the one described in the dataset. Put a space between the numbers. No
  other characters are allowed in the output.
  
  For any wide integral rectangle given in the input, the width and height of
  the smallest wide integral rectangle bigger than the given one are both known
  to be not greater than 150.
  
  In addition, although the ordering of wide integral rectangles uses the
  comparison of lengths of diagonal lines, this comparison can be replaced with
  that of squares (self-products) of lengths of diagonal lines, which can avoid
  unnecessary troubles possibly caused by the use of floating-point numbers.
input_description: The entire input consists of multiple datasets. The number of datasets is no
  more than 100. Each dataset describes a wide integral rectangle by specifying
  its height and width, namely _h_ and _w_ , separated by a space in a line, as
  follows.
  
  > _h_ _w_
  
  For each dataset, _h_ and _w_ (>_h_) are both integers greater than 0 and no
  more than 100.
  
  The end of the input is indicated by a line of two zeros separated by a space.
attempt: while True:
      h, w = map(int, input().split())
      if not h:
          break
      diagonal = h**2 + w**2
      ans = []
      append = ans.append
      for y in range(1, 151):
          for x in range(y + 1, 151):
              if x**2 + y**2 > diagonal:
                  append((x**2 + y**2, y, x))
                  break
      print(*sorted(ans)[0][1:])
  
problem_description: Integral Rectangles
  
  Let us consider rectangles whose height, _h_ , and width, _w_ , are both
  integers. We call such rectangles _integral rectangles_. In this problem, we
  consider only wide integral rectangles, i.e., those with _w_ > _h_.
  
  We define the following ordering of wide integral rectangles. Given two wide
  integral rectangles,
  
    1. The one shorter in its diagonal line is smaller, and 
    2. If the two have diagonal lines with the same length, the one shorter in its height is smaller. 
  
  ![](https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE2_integralRectangles-
  en)
  
  Given a wide integral rectangle, find the smallest wide integral rectangle
  bigger than the given one.
samples: [{"input": "2\n    1 3\n    2 3\n    1 4\n    2 4\n    5 6\n    1 8\n    4 7\n    98 100\n    99 100\n    0 0", "output": "3\n    2 3\n    1 4\n    2 4\n    3 4\n    1 8\n    4 7\n    2 8\n    3 140\n    89 109"}]