Hope I get a reply on this one, as none of my posts have recieved any replies so far!
Upon suggestions i used bulk i/o, still TLE . any suggestions ?? This is SBANK problem.
import sys
alls=sys.stdin.readlines()
#print len(alls)
ind=0
dd=[]
t=int(alls[ind])
ind+=1
while ind<len(alls):
while t:
n=str(alls[ind])
ind+=1
if ind==len(alls):
break
if n:
n=int(n)
myaccs={}
for i in xrange(0,n):
m=str(alls[ind])
ind+=1
m=m.replace(" ","")
m=int(m)
if myaccs.has_key(m):
myaccs[m]+=1
else:
myaccs.update({m:1})
#print len(myaccs)
for tmp,cnt in sorted(myaccs.iteritems()):
ans=str("%026d"%tmp)
fin= ans[0:2]+" "+ans[2:10]+" "+ans[10:14]+" "+ans[14:18]+" "+ans[18:22]+" "+ans[22:26]+" "+str(cnt)
#print fin
dd.append(fin)
#print "%02d"%int(ans[0:2]),"%08d"%int(ans[3:10]), "%04d"%int(ans[11:15]), "%04d"%int(ans[16:20]),"%04d"%int(ans[21:25]),"%04d"%myaccs[i][26:30],cnt
#print ""
dd.append("")
ind+=1
t-=1
nl="\n"
dd=tuple(dd)
qew=nl.join(dd)
sys.stdout.write(qew)
#print len(dd)