First problem solution