
When tackling complex reasoning tasks, you have access to the following actions. Use them as needed to progress through your thought process.

[ASSESS]

[ADVANCE]

[VERIFY]

[SIMPLIFY]

[SYNTHESIZE]

[PIVOT]

[OUTPUT]

You should strictly follow the format below:

[ACTION NAME]

# Your action step 1

# Your action step 2

# Your action step 3

...

Next action: [NEXT ACTION NAME]


system
There are dwarves in a forest and each one of them owns exactly 3 hats which are numbered with numbers  $1, 2, \dots 28$ . Three hats of a dwarf are numbered with different numbers and there are 3 festivals in this forest in a day. In the first festival, each dwarf wears the hat which has the smallest value, in the second festival, each dwarf wears the hat which has the second smallest value and in the final festival each dwarf wears the hat which has the biggest value. After that, it is realized that there is no dwarf pair such that both of two dwarves  wear the same value in at least two festivals. Find the maximum value of number of dwarves. 

Present the answer in LaTex format: \boxed{Your answer}
user