      PROGRAM MATVEC
      REAL A(30,30), X(30)
      OPEN(UNIT=1,FILE='input.dat')
      READ(1,*) N
      DO 10 I = 1,N
        READ(1,*) (A(I,J), J = 1,N)
   10 CONTINUE
      READ(1,*) (X(I), I = 1,N)
      CLOSE(1)
      OPEN(UNIT=2,FILE='output.dat')
      WRITE(2,*) 'To diavusma eivai:'
      DO 20 I = 1,N
        S = 0.0
        DO 30 J = 1,N
          S = S + A(I,J)*X(J)
   30   CONTINUE
        WRITE(2,*) S
   20 CONTINUE
      CLOSE(2)
      STOP
      END

