problem-4

James came across the next problem in a newspaper. It said 

“Bring order to the word and your nation shall be bestowed upon with the same”

The task was to print the letters of the word in the order of their occurrence in the alphabet.

Take a string input(all alphabets and in lower case) from the user and print the character in alphabetical order.

Sample Input:
elementary

Sample Output:
aeeelmntry

SAMPLE INPUT
elementary

SAMPLE OUTPUT
aeeelmntry

Source: hackerearth | Difficulty: UNKNOWN_DIFFICULTY


Solutions:
#! /usr/bin/python

s = input()
lst = [];
for i in range(26):
	lst.append(0);

asc = ord('a')
for i in range(len(s)):
	lst[ord(s[i]) - asc ] += 1

st = '';
for i in range(26):
	for j in range(lst[i]):
		st += chr(i + asc)
print(st)




def ms_comb(strng, l, q, r):
	L = []
	R = []
	i = l
	while i <= q:
		L.append(strng[i])
		i += 1
	while i <= r:
		R.append(strng[i])
		i += 1
	L.append("zzzzzz")
	R.append("zzzzzz")
	i = 0
	j = 0
	k = l
	while k <= r:
		if(L[i] > R[j]):
			strng[k] = R[j]
			j += 1
		else:
			strng[k] = L[i]
			i += 1
		k += 1
	return strng


def ms(strng, l, r):
	if l < r:
		q = (l+r)/2
		ms(strng, l, q)
		ms(strng, q+1, r)
		return ms_comb(strng, l, q, r)


strng = input()
st = []
for ch in strng:
	st.append(ch)
xxx = ms(st, 0, len(strng)-1)
print(''.join(xxx))



	


s=input()
s=sorted(s)
t=''
for i in range(len(s)):
	t=t+s[i]
print(t)


a=input('')

a=sorted(a)

b=''.join(a)
print(b)



s=sorted(input())
print("".join(s))


a=input()
b=sorted(a)
print('' .join(b))


text = input()
a = [ord(c) for c in text]
a.sort()
b = ''.join(chr(i) for i in a)
print(b)


import sys
s=input()
s=sorted(s)
for i in range(len(s)):
	sys.stdout.write(s[i])


str1 = input()
lst = list(str1)
lst.sort()
str2 = ""
for i in range(len(lst)):
	str2 = str2 + lst[i]
print(str2)



str1=input()
str1=list(str1)
list.sort(str1)
str1=''.join(str1)
print(str1)


'''
# Read input from stdin and provide input before running code

name = raw_input('What is your name?\n')
print 'Hi, %s.' % name
'''
#print 'Hello World!'
import sys
a = []
while True:
	try:
		s = input()
		for i in s:
			a.append(i)
		a.sort()
		for i in a:
			sys.stdout.write(i)
		a = []
		print("")
	except(EOFError):
		break