Mix flour with margarine, add stirring cooled bouillon and knead soft dough. Cut the dough into 4 part, cover with napkin and let stay for 20 minutes. Then roll out flat cakes, fry on both sides, brush with butter, cool.
Cut 3 thin slices of ham, grind the rest ham, dress with 1 tablespoon of mayonnaise. Chop eggs and dill finely, dress with 1 tablespoon mayonnaise. Grate cheese, dress the half of the cheese with ½ tablespoon mayonnaise.
Spread 1 flat cake with cheese mass, the 2d flat cake — with ham, and the 3d — with egg mass. Combine the cakes one upon another and cover with the 4th cake. Spread the top and sides of the prepared pie with the rest mayonnaise. Cover and refrigerate for a day.
Top the pie with cheese and ham slices when serving.