#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < n; i++)
const int    INF = 100000000;
const double EPS = 1e-10;
const int    MOD = 1000000007;
using namespace std;
typedef pair<int,string> P;

string str, s;
vector<string> x;

int main(){
	cin >> str;
	for(int i = 1; i < str.size(); i++){
		if(str[i] == '.'){
			x.push_back(s);
			s.clear();
			continue;
		}
		s.push_back(str[i]);
	}
	x.push_back(s);
	vector<P> y;
	while(getline(cin,s)){
		int cnt = 0;
		rep(i,s.size()){
			if(s[i] != ' '){
				break;
			}
			cnt++;
		}
		while(y.size() > 0){
			if(y[y.size()-1].first < cnt) break;
			y.pop_back();
		}
		string tmp;
		for(int i = cnt; i < s.size(); i++){
			if(s[i] == ':') break;
			tmp.push_back(s[i]);
		}
		y.push_back(P(cnt,tmp));
		if(y.size() != x.size()) continue;
		bool ok = true;
		rep(i,x.size()) if(y[i].second != x[i]) ok = false;
		if(ok){
			if(s[s.size()-1] != ':'){
				string tmpp;
				for(int i = cnt+tmp.size()+2; i < s.size(); i++) tmpp.push_back(s[i]);
				printf("string \"");
				cout << tmpp;
				printf("\"\n");
			} else{
				cout << "object" << endl;
			}
			return 0;
		}
	}
	cout << "no such property" << endl;
}