# Concatenation of Alphabetical Group – Infytq 2019 Solve

#### Sample Input:

```HeLloOWorLDd
```

#### Sample Output:

```DdWerHoOoLlL
```

#### Solution: We strongly recommend you to try the problem first before moving to the solution. Python

```# Code to understand Concatenation of Alphabetical group in Python
# www.codewindow.in

str_list=list(input())
char_list=[]

for i in range (len(str_list)):
if str_list[i]=='':
continue
char_grp=str_list[i]

for j in range (i+1, len(str_list)):
if str_list[i].lower()==str_list[j].lower():
char_grp += str_list[j]
str_list[j]=''
str_list[i]=''
char_list.append(char_grp)
for i in range (len(char_list)):

for j in range (i+1, len(char_list)):

if char_list[i].lower() > char_list[j].lower():
temp=char_list[j]
char_list[j]=char_list[i]
char_list[i]=temp
length=len(char_list)

for i in range (length//2):
print(char_list[i]+char_list[length-i-1], end='')
if length%2!=0:
print(char_list[length//2])

```

#### Input:

```HeLloOWorLDd
```

#### Output:

```DdWerHoOoLlL
```