import re


def FillParagraph(text,width=70,indentLinesBy=0):
  """

  >>> txt = "123 567 90 123\\n456 89\\n"
  >>> print FillParagraph(txt,width=10)
  123 567 90
  123 456 89
  
  >>> print FillParagraph(txt,width=10,indentLinesBy=3)
  123 567 90
     123 456
     89
  >>> txt = '123 567 \\n'
  >>> print FillParagraph(txt,width=10)
  123 567

  """
  expr = re.compile('[\ \t\n\r]+')
  words = expr.split(text)
  res = []
  line = ''
  for word in words:
    if word:
      if len(line)+len(word)>=width:
        res.append(line)
        line = ' '*indentLinesBy
        line += word
      else:
        if line:
          line += ' %s'%word
        else:
          line = word
  if line:
    res.append(line)    
  return '\n'.join(res)