      subroutine union(i,j,k,sym1)
      IMPLICIT REAL*8(A-H,O-X,Z),logical*1(y)
      character(3) sym1(7)
      character(5) sym2
      !print*,'entree union ',sym1(i),' ',sym1(j),i,j,k
      sym2=trim(sym1(i))//trim(sym1(j))
      l=len_trim(sym2)
      m=0
      n=0
      sym1(k)=' '
      do kk=1,l
         if(sym2(kk:kk)=='X') m=m+1
      enddo
      if(m==1) then
         n=n+1
         sym1(k)(n:n)='X'
      endif
      m=0
      do kk=1,l
         if(sym2(kk:kk)=='Y') m=m+1
      enddo
      if(m==1) then
         n=n+1
         sym1(k)(n:n)='Y'
      endif
      m=0
      do kk=1,l
         if(sym2(kk:kk)=='Z') m=m+1
      enddo
      if(m==1) then
         n=n+1
         sym1(k)(n:n)='Z'
      endif
      !print*,'sortie union ',sym1(k)
      return
      end
