from stack import Stack
def rev_str(x):
	a=[]
	r=[]
	for i in range(0, len(x)):
		s.push(x[i])
			
		a=(s.peek())
			
		r.append(a)
		
		q=r[::-1]
	print ''.join(q)
	
		

s=Stack()


rev_str('helloworld')
