#include<bits/stdc++.h>

using namespace std;

vector< string > split(string s, string cc)
{
  s += cc;
  int tail = 0;
  string buff;
  vector< string > ret;
  while(tail < s.size()) {
    if(cc.find(s[tail]) != string::npos) {
      if(buff.size()) ret.push_back(buff);
      buff.clear();
    } else {
      buff += s[tail];
    }
    ++tail;
  }
  return (ret);
}

int main()
{
  string K, S;
  vector< string > data;
  cin >> K;
  cin.ignore();
  while(getline(cin, S)) data.push_back(S);

  auto latte = split(K, ".");

  bool flag = false;
  vector< pair< string, int > > vs;

  auto ismatch = [&]
  {
    if(vs.size() != latte.size()) return (false);
    for(int i = 0; i < vs.size(); i++) if(vs[i].first != latte[i]) return (false);
    return (true);
  };

  for(auto &s : data) {
    auto malta = split(s, " :");
    int indent = 0;
    while(s[indent] == ' ') ++indent;
    while(vs.size() && indent <= vs.back().second) vs.pop_back();
    vs.emplace_back(malta[0], indent);
    if(ismatch()) {
      auto p = s.substr(s.find(':') + 1);
      if(p.empty()) cout << "object" << endl;
      else cout << "string \"" << p.substr(1) << "\"" << endl;
      flag = true;
      break;
    }
  }

  if(!flag) cout << "no such property" << endl;
}