#include <iostream>
#include <vector>
#include <string>
#include <cctype>
#include <sstream>

using namespace std;

string in[50000];
int lineNum, lineMax;

struct object {
  vector<string> key;
  vector<string> property;
  vector<object*> child;
};

object* parse_yaml(int parentIndent = -1) {
  object* obj = new object;

  while( lineNum < lineMax ) {
    int indent = 0;
    for( ;isspace(in[lineNum][indent]); indent++ );

    if( indent <= parentIndent ) break;
    
    int colon = in[lineNum].find(":");
    string key = in[lineNum].substr(indent, colon-indent);
    if( colon == in[lineNum].size()-1 ) {
      // object
      obj->key.push_back(key);
      obj->property.push_back("__ymobj");
      
      lineNum ++;
      // parse children
      obj->child.push_back(parse_yaml(indent));
    } else {
      // has property
      obj->key.push_back(key);
      obj->property.push_back(in[lineNum].substr(colon+2));
      obj->child.push_back(NULL); // NULLポインタを代入しないとセグフォ
      
      lineNum ++;
    }
  }
  
  return obj;
}

bool search( const object* root, const vector<string>vecQ, string& ans ) {
  
  // find object
  for(unsigned i=0; i<vecQ.size()-1; i++) { // "-1" means object(not string)
    bool ok = 0;
    for(unsigned j=0; j<root->key.size(); j++) {
      if(root->key[j] == vecQ[i]) {
	if(root->property[j] != "__ymobj") break; // found same string key with query object
	root = root->child[j];
	ok = 1;
	break;
      }
    }
    if(!ok) return false;
  }
  
  // find property
  for(unsigned i=0; i<root->key.size(); i++) {
    if(root->key[i]==vecQ.back()) {
      
      if(root->property[i] == "__ymobj") {
	ans = "object";
	return true;
      } else {
	ans = "string \"" + root->property[i] + "\"";
	return true;
      }
    }
  }
  
  return false;
}

void input_yaml() {
  lineMax = 0;
  for(int i=0; getline(cin, in[i]); i++, lineMax++);
}

int main() {
  
  string query;
  getline(cin, query);
  //replaceAll( query, ".", " " );
  for(unsigned i=0; i<query.size(); i++) if(query[i]=='.') query[i] = ' ';
  stringstream ss( query );
  vector<string> vecQuery;
  while( ss >> query ) vecQuery.push_back( query );
  
  input_yaml();
  
  lineNum = 0;
  object* yaml = parse_yaml();
  
  string ans;
  if( search( yaml, vecQuery, ans ) ) {
    cout << ans << endl;
  } else {
    cout << "no such property" << endl;
  }
  
  return 0;
}