       real*8 meanr, meang, meanb
       real*8 down
       integer x, y, z, w
       dimension a(1)
       dimension b(10000000)
       dimension c(10000000)
       dimension d(10000000)


       open (1,file='no')
       read (1,*) (a(x), x=1, 1)

       n = a(1)

       open (2,file='rflux')
       read (2,*) (b(y), y=1, n)

       open (3,file='gflux')
       read (3,*) (c(z), z=1, n)

       open (4,file='bflux')
       read (4,*) (d(w), w=1, n)

       meanr = 0.0
       do i=1, n
       meanr = meanr + b(i)
       end do
       meanr = meanr/n

       meang = 0.0
       do i=1, n
       meang = meang + c(i)
       end do
       meang = meang/n

       meanb = 0.0
       do i=1, n
       meanb = meanb + d(i)
       end do
       meanb = meanb/n

       do i=1, n
       write (7,*) b(i)-meanr
       write (8,*) c(i)-meang
       write (9,*) d(i)-meanb

       end do

       write (10,*) meanr
       end 


