Perhaps a better way, but:
Using bash and find
while IFS= read -r dir; do
    mv -- "$dir" "${dir%/*}/X"
done< <(find . -maxdepth 2 -mindepth 2 -type d)
DO a test run first with something like:
while IFS= read -r dir; do
    printf 'mv "%s" "%s"\n' "$dir" "${dir%/*}/X"
done< <(find . -maxdepth 2 -mindepth 2 -type d)
In short:
- find- 
- .current directory as base (Typically- Ain your case)
- type d(directory) at minimum and maximum depth of 2
 
- bashread- $dirfrom- findand move- $dirto- 
- ${dir%/*}remove last- /and everything there after- 
- /Xappend the new directory name.
 
 
Use for example find ./A ... if you reside one level below A etc.
Optionally add -v to mv (non-POSIX) to show actions taken.