output_description: For each dataset, output a single line containing two positive integers
  representing the plan with the maximal number of vertically adjacent floors
  with its rent price exactly equal to the budget of Mr. Port. The first should
  be the lowest floor number and the second should be the number of floors.
input_description: The input consists of multiple datasets, each in the following format.
  
  > _b_  
  >
  
  A dataset consists of one line, the budget of Mr. Port _b_ as multiples of the
  rent of the first floor. _b_   is a positive integer satisfying 1 < _b_ < 109.
  
  The end of the input is indicated by a line containing a zero. The number of
  datasets does not exceed 1000.
attempt: import sys
  
  while True:
      n = int(sys.stdin.readline())
      if not n:
          break
      head = tail = 1
      s = 0
      while True:
          while s < n:
              s += tail
              tail += 1
          while s > n:
              s -= head
              head += 1
          if s == n:
              sys.stdout.write("%d %d\n" % (head, tail - head))
              break
  
problem_description: Skyscraper "MinatoHarukas"
  
  Mr. Port plans to start a new business renting one or more floors of the new
  skyscraper with one giga floors, MinatoHarukas. He wants to rent as many
  vertically adjacent floors as possible, because he wants to show advertisement
  on as many vertically adjacent windows as possible. The rent for one floor is
  proportional to the floor number, that is, the rent per month for the _n_ -th
  floor is _n_ times that of the first floor. Here, the ground floor is called
  the first floor in the American style, and basement floors are out of
  consideration for the renting. In order to help Mr. Port, you should write a
  program that computes the vertically adjacent floors satisfying his
  requirement and whose total rental cost per month is _exactly equal_ to his
  budget.
  
  For example, when his budget is 15 units, with one unit being the rent of the
  first floor, there are four possible rent plans, 1+2+3+4+5, 4+5+6, 7+8, and
  15. For all of them, the sums are equal to 15. Of course in this example the
  rent of maximal number of the floors is that of 1+2+3+4+5, that is, the rent
  from the first floor to the fifth floor.
samples: [{"input": "16\n    2\n    3\n    9699690\n    223092870\n    847288609\n    900660121\n    987698769\n    999999999\n    0", "output": "5\n    16 1\n    2 1\n    1 2\n    16 4389\n    129 20995\n    4112949 206\n    15006 30011\n    46887 17718\n    163837 5994"}]