/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

class Property {
	// it's empty but can hold some info, like
	//public Person owner; // owners handle
}

class FIO extends Property {
	public String firstName;
	public String name;
	public String batyaName;
	
	public FIO( String f, String s, String b ) {
		firstName = f;
		name = s;
		batyaName = b;
	}
}

class DateHolder extends Property {
	public Date date; //does java have Date? Replace then.
	
	public DateHolder( Date d ) {
		date = d;
	}
}

class PeopleHolder extends Property {
	private ArrayList<Person> people;
	
	public PeopleHolder() {
		people = new ArrayList<Person>();
	}
	
	public PeopleHolder addPerson( Person p ) {
		people.add( p );
		return this;
	}
	
	public PeopleHolder removePerson( Person p ) {
		// TODO
		return this;
	}
}

class Description extends Property {
	public String description;
	
	public Description( String d ) {
		description = d;
	}
}

class Person {
	public String type;
	private HashMap<String, Property> properties;
	
	public Person( String type ) {
		this.type = type;
		properties = new HashMap<String, Property>();
	}
	
	public Person addProperty( String s, Property p ) {
		properties[ s ] = p;
		return this;
	}
}

class PersonList {
	private List<Person> p;
	
	public PersonList() {
		p = new ArrayList<Person>();
	}
	
	// TODO: methods like get/add/remove/find/kill/etc.
}
class Ideone
{
	public static void main (String[] args) throws java.lang.Exception
	{
		// TODO: write factory class
		Person typicalWorker = new Person( "worker" );
		typicalWorker.addProperty( "FIO", new FIO( "Иванов", "Иван", "Иванович" ) )
					 .addProperty( "birth date", new DateHolder( THIS_GUY_BIRTH_DATE ) )
					 .addProperty( "employ date", new DateHolder( THIS_GUY_EMPLOY_DATE ) );
					 
		PeopleHolder slaves = new PeopleHolder();
		slaves.addPerson( typicalWorker );
		Person manager = new Person( "manager" );
		manager.addProperty( "FIO", new FIO( "Петров", "Колян", "Степанович" ) )
			   .addProperty( "birth date", new DateHolder( THIS_GUY_BIRTH_DATE ) )
			   .addProperty( "employ date", new DateHolder( THIS_GUY_EMPLOY_DATE ) )
			   .addProperty( "slaves", slaves );
		
		Person secretary = new Person( "other" );
		secretary.addProperty( "FIO", new FIO( "Сидорова", "Мария", "Никитична" ) )
				 .addProperty( "birth date", new DateHolder( THIS_GUY_BIRTH_DATE ) )
				 .addProperty( "employ date", new DateHolder( THIS_GUY_EMPLOY_DATE ) )
				 .addProperty( "description", new Description( "Секретарша. Неплохо сосёт." ) );
				 
		PersonList pl = new PersonList();
		pl.add( typicalWorker )
		  .add( manager )
		  .add( secretary );
	}
}