#include <bits/stdc++.h>
#define REP(i, a, n) for(ll i = ((ll) a); i < ((ll) n); i++)
using namespace std;
typedef long long ll;

struct node {
  map<string, node*> childs;
  string value;
  bool object;

  node(): object(true) {}
  node(string value): value(value), object(false) {}
};

vector<string> split(string s, string p) {
  vector<string> ret;
  ll h = 0;
  REP(i, 0, s.size() - p.size() + 1) if(s.substr(i, p.size()) == p) {
    ret.push_back(s.substr(h, i - h));
    h = i + p.size();
    i += (ll) p.size() - 1;
  }
  ret.push_back(s.substr(h, (ll) s.size() - h));
  return ret;
}

int main(void) {
  string target;
  getline(cin, target);
  vector<string> yaml;
  string line;
  while(getline(cin, line)) yaml.push_back(line);

  ll p = 0;
  function<node* (ll&)> parse = [&](ll &p) {
    ll d = 0;
    while(yaml[p][d] == ' ') d++;

    node* n = new node();

    while(p < yaml.size()) {
      ll ld = 0;
      while(yaml[p][ld] == ' ') ld++;
      if(ld < d) break;

      vector<string> tmp = split(yaml[p], ":");
      string key = tmp[0].substr(d, tmp[0].length() - d);
      p++;

      if(tmp[1].length() == 0) {
        n->childs[key] = parse(p);
      } else {
        string val = tmp[1].substr(1, tmp[1].length() - 1);
        n->childs[key] = new node(val);
      }
    }

    return n;
  };
  node* object = parse(p);

  vector<string> keys = split(target, ".");
  node* r = object;
  REP(i, 1, keys.size()) {
    string key = keys[i];
    if(r->object && r->childs.count(key)) {
      r = r->childs[key];
    } else {
      cout << "no such property" << endl;
      return 0;
    }
  }
  if(r->object) cout << "object" << endl;
  else cout << "string \"" << r->value << "\"" << endl;
}

