#include <iostream>
#include <iomanip>
#include <sstream>
#include <cstdio>
#include <string>
#include <vector>
#include <algorithm>
#include <complex>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <cassert>
#include <climits>
#include <queue>
#include <set>
#include <map>
#include <valarray>
#include <bitset>
#include <stack>
using namespace std;

#define REP(i,n) for(int i=0;i<(int)(n);++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
typedef long long ll;
typedef pair<int,int> pii;
const int INF = 1<<29;
const double PI = acos(-1);
const double EPS = 1e-8;

vector<string> lines;
vector<string> v;
string ans;

void solve(int &id, int indent, int now) {
  while(id<lines.size()) {
    int ind = 0;
    while(lines[id][ind] == ' ') ++ind;
    if (ind < indent) {
      return;
    }
    int t = lines[id].find(':');
    string a = lines[id].substr(ind,t-ind);
    string b = "";
    if (t+2<lines[id].size()) b = lines[id].substr(t+2);
    id++;
    if (a == v[now]) {
      if (now == v.size()-1) {
        ans = b;
      } else {
        solve(id, ind+1, now+1);
      }
    } else {
      // 違ったらそれより下位のものを飛ばす
      while(id<lines.size()) {
        int tmp = 0;
        while(lines[id][tmp] == ' ') ++tmp;
        if (tmp <= ind) {
          break;
        }
        id++;
      }
    }
  }
}

int main() {
  string in;
  cin >> in;
  FOR(it, in) if (*it == '.') *it = ' ';
  stringstream ss(in);
  string t;
  while(ss >> t) {
    v.push_back(t);
  }
  string line;
  getline(cin,line);
  while(getline(cin,line)) {
    lines.push_back(line);
  }
  int id = 0;
  ans = "*";
  solve(id, 0, 0);
  if (ans == "*") {
    puts("no such property");
  } else if (ans == "") {
    puts("object");
  } else {
    printf("string \"%s\"\n", ans.c_str());
  }
}