      DIMENSION NUMS(15)
C
C READ IN THE ARRAY, UNTIL -1 OR 15 NUMBERS READ.  
C LEAVE THE NUMBER READ IN N.
      N = 1
 10   READ 15, IN
 15   FORMAT(I3)
      IF(IN + 1) 20,40,20
 20   NUMS(N) = IN
      IF(N - 15) 25,70,70
 25   N = N + 1
      GOTO 10
C
C SORT THE ARRAY USING BUBBLE SORT.
 40   N = N - 1
 70   ISCAN = 1
      IOK = 1
      ISTOP = N
      IF(ISTART - ISTOP) 50, 110, 110
 50   IF(NUMS(ISCAN) - NUMS(ISCAN+1)) 90,90,60
C
C SWAP
 60   J = NUMS(ISCAN)
      NUMS(ISCAN) = NUMS(ISCAN+1)
      NUMS(ISCAN+1) = J
      IOK = 0
C
C TIME TO ISTART OVER?
 90   IF(ISCAN - (ISTOP - 1)) 80,100,100
C
C NEXT PAIR
 80   ISCAN = ISCAN + 1
      GOTO 50
C
C NEXT ISCAN
 100  IF(IOK) 105,105,110
 105  ISTOP = ISTOP - 1
      GOTO 70
C
C PRINT
 110  DO 120 I=1, N
 120  PRINT 130, NUMS(I)
 130  FORMAT(I10)
      STOP
      END
