      subroutine accent(c,n,cc,nn,iopt)
      character*512 ccc,cc,c
      character*1 cbid,antis
c
      if (n.gt.512) return
      cbid = char(255)
      antis = char(92)
      if (n.ge.3) then
        ccc(1:n) = c(1:n)
        iflag = 0
        np = 1
        imem = 0
        do i=1,n-2
          if (c(i:i+2).eq.antis//"`e") then
            iflag = 1
            if (iopt.eq.0) then
              ccc(i:i+2) = char(232)//cbid//cbid
            else
              ccc(np:np+3) = antis//'346'
              np = np+4
              imem = 2
            endif
          elseif (c(i:i+2).eq.antis//"'e") then
            iflag = 1
            if (iopt.eq.0) then
              ccc(i:i+2) = char(233)//cbid//cbid
            else
              ccc(np:np+3) = antis//'342'
              np = np+4
              imem = 2
            endif
          elseif (c(i:i+2).eq.antis//"^e") then
            iflag = 1
            if (iopt.eq.0) then
              ccc(i:i+2) = char(234)//cbid//cbid
            else
              ccc(np:np+3) = antis//'344'
              np = np+4
              imem = 2
            endif
          elseif (c(i:i+2).eq.antis//'"e') then
            iflag = 1
            if (iopt.eq.0) then
              ccc(i:i+2) = char(235)//cbid//cbid
            else
              ccc(np:np+3) = antis//'345'
              np = np+4
              imem = 2
            endif
          elseif (c(i:i+2).eq.antis//"`a") then
            iflag = 1
            if (iopt.eq.0) then
              ccc(i:i+2) = char(224)//cbid//cbid
            else
              ccc(np:np+3) = antis//'337'
              np = np+4
              imem = 2
            endif
          elseif (c(i:i+2).eq.antis//"'a") then
            iflag = 1
            if (iopt.eq.0) then
              ccc(i:i+2) = char(225)//cbid//cbid
            else
              ccc(np:np+3) = antis//'200'
              np = np+4
              imem = 2
            endif
          elseif (c(i:i+2).eq.antis//"^a") then
            iflag = 1
            if (iopt.eq.0) then
              ccc(i:i+2) = char(226)//cbid//cbid
            else
              ccc(np:np+3) = antis//'335'
              np = np+4
              imem = 2
            endif
          elseif (c(i:i+2).eq.antis//'~a') then
            iflag = 1
            if (iopt.eq.0) then
              ccc(i:i+2) = char(227)//cbid//cbid
            else
              ccc(np:np+3) = antis//'202'
              np = np+4
              imem = 2
            endif
          elseif (c(i:i+2).eq.antis//'"a') then
            iflag = 1
            if (iopt.eq.0) then
              ccc(i:i+2) = char(228)//cbid//cbid
            else
              ccc(np:np+3) = antis//'336'
              np = np+4
              imem = 2
            endif
          elseif (c(i:i+2).eq.antis//"`u") then
            iflag = 1
            if (iopt.eq.0) then
              ccc(i:i+2) = char(249)//cbid//cbid
            else
              ccc(np:np+3) = antis//'362'
              np = np+4
              imem = 2
            endif
          elseif (c(i:i+2).eq.antis//"'u") then
            iflag = 1
            if (iopt.eq.0) then
              ccc(i:i+2) = char(250)//cbid//cbid
            else
              ccc(np:np+3) = antis//'212'
              np = np+4
              imem = 2
            endif
          elseif (c(i:i+2).eq.antis//'^u') then
            iflag = 1
            if (iopt.eq.0) then
              ccc(i:i+2) = char(251)//cbid//cbid
            else
              ccc(np:np+3) = antis//'357'
              np = np+4
              imem = 2
            endif
          elseif (c(i:i+2).eq.antis//'"u') then
            iflag = 1
            if (iopt.eq.0) then
              ccc(i:i+2) = char(252)//cbid//cbid
            else
              ccc(np:np+3) = antis//'360'
              np = np+4
              imem = 2
            endif
          elseif (c(i:i+2).eq.antis//"~n") then
            iflag = 1
            if (iopt.eq.0) then
              ccc(i:i+2) = char(241)//cbid//cbid
            else
              ccc(np:np+3) = antis//'205'
              np = np+4
              imem = 2
            endif
          elseif (c(i:i+2).eq.antis//"`o") then
            iflag = 1
            if (iopt.eq.0) then
              ccc(i:i+2) = char(242)//cbid//cbid
            else
              ccc(np:np+3) = antis//'207'
              np = np+4
              imem = 2
            endif
          elseif (c(i:i+2).eq.antis//"'o") then
            iflag = 1
            if (iopt.eq.0) then
              ccc(i:i+2) = char(243)//cbid//cbid
            else
              ccc(np:np+3) = antis//'206'
              np = np+4
              imem = 2
            endif
          elseif (c(i:i+2).eq.antis//"^o") then
            iflag = 1
            if (iopt.eq.0) then
              ccc(i:i+2) = char(244)//cbid//cbid
            else
              ccc(np:np+3) = antis//'355'
              np = np+4
              imem = 2
            endif
          elseif (c(i:i+2).eq.antis//'~o') then
            iflag = 1
            if (iopt.eq.0) then
              ccc(i:i+2) = char(245)//cbid//cbid
            else
              ccc(np:np+3) = antis//'210'
              np = np+4
              imem = 2
            endif
          elseif (c(i:i+2).eq.antis//'"o') then
            iflag = 1
            if (iopt.eq.0) then
              ccc(i:i+2) = char(246)//cbid//cbid
            else
              ccc(np:np+3) = antis//'356'
              np = np+4
              imem = 2
            endif
          elseif (c(i:i+2).eq.antis//"`i") then
            iflag = 1
            if (iopt.eq.0) then
              ccc(i:i+2) = char(236)//cbid//cbid
            else
              ccc(np:np+3) = antis//'204'
              np = np+4
              imem = 2
            endif
          elseif (c(i:i+2).eq.antis//"'i") then
            iflag = 1
            if (iopt.eq.0) then
              ccc(i:i+2) = char(237)//cbid//cbid
            else
              ccc(np:np+3) = antis//'203'
              np = np+4
              imem = 2
            endif
          elseif (c(i:i+2).eq.antis//"^i") then
            iflag = 1
            if (iopt.eq.0) then
              ccc(i:i+2) = char(238)//cbid//cbid
            else
              ccc(np:np+3) = antis//'347'
              np = np+4
              imem = 2
            endif
          elseif (c(i:i+2).eq.antis//'"i') then
            iflag = 1
            if (iopt.eq.0) then
              ccc(i:i+2) = char(239)//cbid//cbid
            else
              ccc(np:np+3) = antis//'354'
              np = np+4
              imem = 2
            endif
          elseif (c(i:i+2).eq.antis//'cc') then
            iflag = 1
            if (iopt.eq.0) then
              ccc(i:i+2) = char(231)//cbid//cbid
            else
              ccc(np:np+3) = antis//'340'
              np = np+4
              imem = 2
            endif
          elseif (c(i:i+2).eq.antis//'pm') then
            iflag = 1
            if (iopt.eq.0) then
              ccc(i:i+2) = char(177)//cbid//cbid
            else
              ccc(np:np+3) = antis//'232'
              np = np+4
              imem = 2
            endif
          elseif (c(i:i+2).eq.antis//'mu') then
            iflag = 1
            if (iopt.eq.0) then
              ccc(i:i+2) = char(181)//cbid//cbid
            else
              ccc(np:np+3) = antis//'233'
              np = np+4
              imem = 2
            endif
          elseif (c(i:i+2).eq.antis//'ae') then
            iflag = 1
            if (iopt.eq.0) then
              ccc(i:i+2) = char(230)//cbid//cbid
            else
              ccc(np:np+3) = antis//'361'
              np = np+4
              imem = 2
            endif
          elseif (c(i:i+2).eq.antis//'be') then
            iflag = 1
            if (iopt.eq.0) then
              ccc(i:i+2) = char(223)//cbid//cbid
            else
              ccc(np:np+3) = antis//'373'
              np = np+4
              imem = 2
            endif
          elseif (c(i:i+2).eq.antis//'em') then
            iflag = 1
            if (iopt.eq.0) then
              ccc(i:i+2) = char(216)//cbid//cbid
            else
              ccc(np:np+3) = antis//'351'
              np = np+4
              imem = 2
            endif
          elseif (c(i:i+2).eq.antis//'de') then
            iflag = 1
            if (iopt.eq.0) then
              ccc(i:i+2) = char(176)//cbid//cbid
            else
              ccc(np:np+3) = antis//'353'
              np = np+4
              imem = 2
            endif
          elseif (iopt.ne.0) then
            if (imem.eq.0) then
              call accXtops(c,i,ccc,np)
            else
              imem = imem-1
            endif
          endif
        enddo
        if (iopt.eq.0) then
          if (iflag.eq.0) then
            nn = n
            cc(1:nn) = c(1:n)
          else
            nn = 0
            do i=1,n
              if (ccc(i:i).ne.cbid) then
                nn = nn+1
                cc(nn:nn) = ccc(i:i)
              endif
            enddo
          endif
        else
          if (imem.eq.0) then
            call accXtops(c,n-1,ccc,np)
          else
            imem = imem-1
          endif
          if (imem.eq.0) call accXtops(c,n,ccc,np)
          nn = np-1
          cc(1:nn) = ccc(1:nn)
        endif
      else
        nn = n
        cc(1:nn) = c(1:n)
      endif
      end
