I solved it with reflection, but not sure if that is acceptable.
public static void main(String[] args) throws IllegalAccessException {
    Solution solution = new Solution();
    for(Field f : Solution.class.getFields()) System.out.println(f.get(solution));
}