#include <stdio.h>
#include <cmath>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
#include <iostream>
typedef long long int ll;
#define BIG_NUM 2000000000
#define MOD 1000000007
using namespace std;

struct Info{
	Info(int arg_indent,int arg_address){
		indent = arg_indent;
		address = arg_address;
	}

	int indent,address;
};

struct Obj{
	void allocate(int n){
		name = new char[n+1];
	}

	char* name;
	vector<int> children;
};

bool strCmp(char* base, char* comp){
	int length1 = 0,length2 = 0;
	for(int i=0;base[i] != '\0'; i++)length1++;
	for(int i=0;comp[i] != '\0'; i++)length2++;
	if(length1 != length2)return false;

	for(int i=0;base[i] != '\0'; i++){
		if(base[i] != comp[i])return false;
	}
	return true;
}

void strcpy(char* to,char* str){
	for(int i=0;str[i] != '\0';i++){
		to[i] = str[i];
		to[i+1] = '\0';
	}
}

int main(){

	char* query = new char[50001];
	char* buf = new char[50001];
	char* work = new char[50001];

	scanf("%s",query);
	getchar();

	Obj obj[15000];

	int ob_index = 0,work_index,calc_index,indent_num;
	stack<Info> S;

	char ch;

	int buf_index;
	bool breakFLG;

	while(true){

		buf_index = 0;
		ch = getchar();

		while(ch != '\n' && ch != '\0' && ch != EOF){
			buf[buf_index++] = ch;
			ch = getchar();
		}
		buf[buf_index] = '\0';

		breakFLG = true;

		for(int z = 0; z < buf_index; z++){
			if(buf[z] == ':'){
				breakFLG = false;
				break;
			}
		}

		if(breakFLG){
			break;
		}

		for(calc_index = 0;buf[calc_index] == ' ';calc_index++);
		indent_num = calc_index;

		work_index = 0;

		for(;buf[calc_index] != ':';calc_index++){
			work[work_index++] = buf[calc_index];
		}
		work[work_index] = '\0';

		obj[ob_index].allocate(work_index);
		strcpy(obj[ob_index].name,work);

		while(S.empty() == false && S.top().indent >= indent_num)S.pop();
		if(S.empty()){
			//Do nothing
		}else{
			obj[S.top().address].children.push_back(ob_index);
		}

		if(buf[calc_index+1] == '\n' || buf[calc_index+1] == '\0'){
			S.push(Info(indent_num,ob_index));
			ob_index++;
		}else{

			obj[ob_index].children.push_back(ob_index+1);

			ob_index++;
			work_index = 0;
			calc_index += 2;
			for(;buf[calc_index] != '\n' && buf[calc_index] != '\0';calc_index++){
				work[work_index++] = buf[calc_index];
			}
			work[work_index] = '\0';

			obj[ob_index].allocate(work_index);
			strcpy(obj[ob_index].name,work);

			ob_index++;
		}
	}

	bool FLG = false;

	int parse_index = 0,parse_address = -1,next_address,ans_index = 0;
	char* ans = new char[50001];
	char const_object[7] = "object";

	while(true){

		if(query[parse_index] == '.'){
			parse_index++;
		}
		work_index = 0;
		for(;query[parse_index] != '.' && query[parse_index] != '\n' && query[parse_index] != '\0';parse_index++){
			work[work_index++] = query[parse_index];
		}
		work[work_index] = '\0';

		if(work_index == 0){
			if(ans_index == 0){
				//Do nothing
			}else{
				if(strCmp(ans,const_object)){
					printf("%s\n",const_object);
				}else{
					printf("string \"%s\"\n",ans);
				}
				FLG = true;
			}
			break;
		}else{
			if(parse_address == -1){
				for(int i = 0; i < ob_index;i++){
					if(strCmp(work,obj[i].name)){
						parse_address = i;
						if(obj[i].children.size() == 0){
							parse_address = -1;
						}else{
							if(obj[i].children.size() == 1 && obj[obj[i].children[0]].children.size() == 0){
								strcpy(ans,obj[obj[i].children[0]].name);
								ans_index = 50;
							}else{
								strcpy(ans,const_object);
								ans_index = 7;
							}
						}
						break;
					}
				}
				if(parse_address == -1){
					break;
				}
			}else{
				next_address = -1;
				for(int i = 0; i < obj[parse_address].children.size();i++){
					if(strCmp(obj[obj[parse_address].children[i]].name,work)){
						next_address = obj[parse_address].children[i];

						if(obj[next_address].children.size() == 0){
							next_address = -1;
						}else{
							if(obj[next_address].children.size() == 1 && obj[obj[next_address].children[0]].children.size() == 0){
								strcpy(ans,obj[obj[next_address].children[0]].name);
								ans_index = 50;
							}else{
								strcpy(ans,const_object);
								ans_index = 7;
							}
						}
						break;
					}
				}
				if(next_address == -1){
					break;
				}else{
					parse_address = next_address;
				}
			}
		}
	}

	if(!FLG){
		printf("no such property\n");
	}

	return 0;
}

Measured memory_bytes: 3788