#!/usr/bin/env ruby
require 'yaml'
query = gets.strip()
data = YAML.parse(ARGF.read).to_ruby
query.split('.').each do |name|
    if name.empty?
        # nop
    elsif data == nil
        # nop
    else
        if name =~ /^\d+$/
            name = name.to_i
        end
        if data.is_a? Hash and data.include? name
            data = data[name]
        else
            data = nil
        end
    end
end
if data.is_a? Hash
    puts 'object'
elsif data.is_a? String
    puts "string \"#{data}\""
else
    puts 'no such property'
end