input and saving solution