public String[] nextStrings(int n) throws IOException {
            String[] res = new String[n];
            for (int i = 0; i < n; ++i) {
                res[i] = next();
            }
            return res;
        }