program name
    implicit none
    integer(4):: n,i,ans
    character(200):: s
    integer(4):: mozi(ichar('a'):ichar('z'))
    integer(4),allocatable:: is(:)

    read*, s(:)
    n = len_trim(s)

    allocate(is(n))
    mozi(:) = 0

    do i=1,n-1
        mozi(ichar(s(i:i))) = mozi(ichar(s(i:i)))+1
    end do

    ans = 1
    print*, s(1:n-ans)
    do while(.not. guu(mozi))
        mozi(ichar(s(n-ans:n-ans))) = mozi(ichar(s(n-ans:n-ans))) -1
        ans=ans+1
        print*, s(1:n-ans)
    end do

    print*, n-ans
    
contains
    function guu(cnt) result(ret)
        integer(4):: cnt(:)
        integer(4):: i
        logical:: ret

        ret = .true.

        do i=1,size(cnt)
            if (mod(cnt(i),2) /= 0) ret = .false.
        end do

    end function
end program name