      PROGRAM GENDAT1
c     GENEROWANIE DANYCH DLA GAUSS
      implicit none
      real*8 AA,FF,A
      integer N,k,l,j
      dimension AA(1000000),FF(10000),A(1000,1000)
      write(*,*)'GENDAT1'
      write(*,*)'PODAJ N - WYMIAR ZADANIA'
      read (*,*) N
c     PETLA GENERUJACA
      do 1,l=1,N,1
      do 2,k=1,N,1
      j=N*(l-1)+k
      A(l,k)=k**(l-1)
      AA(j)=k**(l-1)
    2 continue
    1 continue
      do 3,l=1,N,1
      FF(l)=0
      do 4,k=1,N,1
      FF(l)=FF(l)+A(l,k)
    4 continue
    3 continue
c     KONIEC GENEROWANIA
      open(unit=10,file='AA')
      rewind(10)
      do 5,j=1,N*N,1
      write(10,*)AA(j)
    5 continue
      close(10)
      open(unit=11,file='FF')
      rewind(11)
      do 6,l=1,N,1
      write(11,*)FF(l)
    6 continue
      close(11)
      stop 100
      end

