# -*- coding: utf-8 -*-
import random
s1 = "konnichiwa"
s2 = 'fuel'
s3= 'desperado'
tuple1 = (s1, s2, s3)
sourceword = random.choice(tuple1)
sourceword1 = sourceword
guessword = ''
guesscount = 0
while True:
	if sourceword != '':
		letternumber = random.randrange(len(sourceword))
		guessword += sourceword[letternumber]
		sourceword = sourceword[letternumber + 1:] + sourceword[:letternumber]
	
	if sourceword == '':
		print guessword
		break
	
playerword = raw_input('Enter your guess\n')
playerword = playerword.lower()
while True:
	if playerword != sourceword1 or playerword == '':
		playerword = raw_input('Wrong. Try again\n')
		guesscount += 1
	if guesscount > 0:
		print 'Hint, it has this part in it:', sourceword1[random.randrange(0, len(sourceword1)/2):random.randrange(len(sourceword1)/2, len(sourceword1))]
	if playerword == sourceword1 and guesscount <= 3:
		print 'gratz. you stayed within guess margin'
		break
	elif playerword == sourceword1 and guesscount > 3:
		print 'gratz. tho it took you some time'
		break
raw_input('\n\nPr')