void printEff(File dir) throws IOException {
        PrintWriter w;
        if (file!= null) {
            w  = new PrintWriter(new FileWriter(new File(dir,file), true));
        } else {
            w = new PrintWriter(new OutputStreamWriter(System.out));
        }
        w.println(result());
        w.flush();
        if (file != null) {
            w.close();
        }
    }