This will be a story about courage, sacrifice and love, about a man who had to keep one's head to get a warm feeling of a beautiful princess. And it was so. Long long time ago for the seven seas and seven mountains, seven woods, was the kingdom of the measure. Called this because it was exactly in the center of the earth. His king and queen and all the residents were very proud of such an unusual location of its kingdom. However, for this reason had a number of problems which are not able to deal for the hundreds of years. Because of the location in the spring and summer there was very hot and winters were extremely cold in the kingdom . For this reason, the king and queen were not able to organize a ball and take the guests in the Throne room. Throne hall was so large that the service could not make there warm enough in winter and cool in summer There had always been too hot or too cold. Diplomatic contacts had suffered because of that. The king decided to resolve this issue once and for all and declared that man who will solve the problem in the way of maintaining a constant temperature in a room Throne gets half the kingdom and the hand of his beautiful daughter. Many inventors arrived to the kingdom to show their ideas. However, neither idea has not proved effective. In the kingdom lived poor watchmaker with his wife and son. The son was called Adam and was very smart boy and all the time he was spending in his room where he was trying to build a mysteries machine. People mocking from the boy, because they do not understand his idea. When the boy heard about the problem and the prize from the king immediately thought that this is an opportunity. He decided to use his machine and help the king. He worked without rest, and when the machine was finished, he named it the thermostat. Morning, Adam packed the machine and kissed his mother and father and he went to the castle. When the boy arrived at the castle the king was very surprise that the poor boy is trying to solve a serious king's problem but King gave him a chance. The boy told the king how the machine work. There are two major things time and temeperature, he said. Temperature can be controlled along the time, he continued. My king, he said, with this machine you can set temperature you want for any time includes any date, hour or season. My king you can give an order to thermostat that for this date and hour we have this season e.g. winter and we want this operation e.g. perform temperature bit warm that it is now in winter in Throne room. But what you mean by the 'date' boy, king asked. My king date is just a day and month or you can say that date is today. Actually month identifies season also for proper hour of the day we want thermostat to perform the proper operation. So returning to the Throne room topic, my king, you can set temperature by setting the thermostat_settings to warm temperature for cold winter season or cold temperature for summer. Great boy if this work I will give you half of my kingdom and the hand of my beautiful daughter. As you may suppose the thermostat worked perfectly, the king and queen were finally able to organize a ball and take the guests in the Throne room, boy get the half on kingdom and a hand of the beautiful princess. And all lived long and happily.