added input support to 1.c