words=[]
dic={}
#corpus.txt contains all the corpus files catenated after removing other languages.
for word in open('corpus.txt'):
	if(word[0]!='.'):
		word=word.decode('utf-8')
		for t in word:
			if(t==' '):
				if(''.join(words)!=' '):
					try: dic[''.join(words)]+=1
					except KeyError : dic[''.join(words)]=1
				words[:]=[]
			else:
				if(t not in [':',',','.','!','(',')','[',']','/',"'",'-','<','>']):
					words.append(t)
					# print "f"


o=open('Out','w')

for k in sorted(dic, key=dic.get, reverse=True):
	try:print>>Out,dic[k], k.encode('utf-8')
	except: print "Some error"
