added Logic.java
(copy of acm/Main.java)