	LOGICAL*1	LN(132),FI(15),FO(15),PW(6),OS(33),ED
	INTEGER*4	IS
	DATA	OS	/'X','X','X','X','X','X','X','X','X','X','X',
     +	"10,"10,"10,"10,"10,"10,"10,"10,"10,"10,"10,'*','*','*','*',
     +	'*','*','*','*','*','*','*'/

	WRITE (5,10)
10	FORMAT (' PW-->',$)
	READ (5,20,END=1000,ERR=1000) PW
20	FORMAT (6A1)
	DO 25 I=1,6
	   IF ( PW(I) .GE. 'A' .AND. PW(I) .LE. 'Z' ) GOTO 22
	GOTO 1000
22	PW(I)=PW(I)-'A'
25	CONTINUE
	WRITE (5,26) ( OS(I), I=1,33 )
26	FORMAT ('+',33A1)

	IS=0
	DO 28 I=1,6
	   IS=(IS*36)+PW(I)
28	CONTINUE
	I1=IS/65536
	I2=IS-I1

	WRITE (5,30)
30	FORMAT (' FI-->',$)
	READ (5,40,END=1000,ERR=1000) FI
40	FORMAT (15A1)
	DO 50 I=1,11
	   IF ( FI(I) .EQ. '.' ) GOTO 60
50	CONTINUE
60	FI(I+4)=0

	WRITE (5,70)
70	FORMAT (' FO-->',$)
	READ (5,40,END=1000,ERR=1000) FO
	DO 80 I=1,11
	   IF ( FO(I) .EQ. '.' ) GOTO 90
80	CONTINUE
90	FO(I+4)=0

	WRITE (5,100)
100	FORMAT (' ED-->',$)
	READ (5,110,END=1000,ERR=1000) ED
110	FORMAT (A1)

	OPEN	(UNIT=1,STATUS='OLD',CARRIAGECONTROL='LIST',FILE=FI)
	OPEN	(UNIT=2,STATUS='NEW',CARRIAGECONTROL='LIST',FILE=FO)

120	READ (1,130,END=1000,ERR=1000) NCHARS, ( LN(I), I=1,NCHARS)
130	FORMAT (Q,132A1)
	DO 140 I=1,NCHARS
	   IR=( RAN(I1,I2) * 127 ) + 1
	   IF ( ED .EQ. 'E' ) LN(I)=LN(I)+IR
	   IF ( ED .EQ. 'D' ) LN(I)=LN(I)-IR
140	CONTINUE
	WRITE (2,150) ( LN(I), I=1,NCHARS )
150	FORMAT (132A1)
	GOTO 120

1000	CLOSE	(UNIT=1)
	CLOSE	(UNIT=2)
	END

