Greed snake by java