Attempt to get input and write output