query = gets

a = [?{]
indent = [0]

while gets
	s = $_.chomp
	if s =~ /^(\s*)(\w+): (.+)$/
		i = $1.size
		while i < indent[-1]
			a << " " * indent.pop + "},"
		end
		if i > indent[-1]
			indent << i
		end
		a << %(#{$1}"#{$2}" => "#{$3}",)
	else
		s =~ /^(\s*)(\w+):$/ 
		a << %(#{$1}"#{$2}" => {)
	end
end

loop do
	indent.pop
	break if indent.empty?
	a << " " * indent[-1] + "},"
end

a << ?}

yaml = eval a.join

query.scan(/(?<=\.)\w+/) do |key|
	if yaml.class == String
		puts "no such property"
		exit
	end
	yaml = yaml[key]
	if !yaml
		puts "no such property"
		exit
	end
end

if yaml.class == String
	puts %(string "#{yaml}")
else
	puts 'object'
end