        subroutine ITOS(INPUT,OUTPUT,LENGTH)
        integer I, INPUT, LENGTH
        character*1 OUTPUT(1), TEMP*5
      write (TEMP,5000) INPUT
5000  format (I5)
      LENGTH = 0
      do 100 I = 1, 5
         if (TEMP(I:I).eq.' ') go to 100
         LENGTH = LENGTH+1
         OUTPUT(LENGTH) = TEMP(I:I)
100   continue
      return
      end
