# -*- coding: utf-8 -*-
#!/usr/bin/env python

patName=raw_input("Please enter your name: ")
#patPass=raw_input()

patState = []
relatives=["Father", "Mother", "Brother", "Sister", "Cousin", "Aunt",
"Uncle"]
emotions=["sad", "happy", "depressed", "upset", "ok", "fine", "great",
"well"]


def savePatientData(patient):
	"Writes patient data to file"
	pass #to be implemented

def loadPatientData(patient):
	"Loads patient data from file."
	pass #to be implemented


#def getState():
#	"Returns the patient's state."
#	pass
	


def getRelation(person):
	"Returns the patient's emotional relation to person"
	pass


def generateQuestion():
	for state in patState:
		if(state in emotions or state.capitalize() in emotions):
			print "Why are you feeling ", state, "?"
			return
		elif(state in relatives):
			print "How do you feel about " + state + "?"
			return

print "Hello", patName + "."
#loadPatientData(patName)

answer=raw_input("How are you feeling today?")
while(answer!="stop" and answer!="Stop"):
	answer=answer.split(" ")
	for word in answer:
		#ASSUMES ANSWER IS NOT EMPTY!
		if((word[0]==word[0].capitalize()) or (word in emotions) or (word in
relatives)):
			patState.append(word)
	#print answer
	print patState

	answer=raw_input(generateQuestion())
	del patState[0]
