/***************************************************
Print town names from census data
***************************************************/
#include <iostream>
#include <fstream>
#include <string>
using namespace std;

int main()
{
  // Open census data file
  ifstream fin("tempdata");
  
  // Read in (and ignore!) header information

  // Loop over each row
  {    
    /***** Process row **************/
    // Read (and ignore) 7 entries
    string s;
    fin >> s >> s >> s >> s >> s >> s >> s;

    // Read name of city/town/CDP/village
    string t, N;
    fin >> t;
    while(t != "town" && t != "city" && t != "CDP" && t != "village")
    {
      N = N + t;
      fin >> t;
    }

    // Print name if town
    if (t == "town")
      cout << N << endl;
  }

  return 0;
}