UVa initialization and UVa 00272 solution