Write a program in python that by default prints a number from the Fibonacci sequence, while on argument --next it prints a program in Java, which by default prints the next number from the sequence, while on --next it prints a program in python with yet another number by default, and so on, switching between python and Java while advancing the Fibonacci sequence. Don’t use a class in python, use class Main in Java, avoid comments inside the code.
Gemini 3 Pro:
import sys;x=0;y=1;J="public class Main{public static void main(String[]a){int x=%d,y=%d;String P=\"%s\",J=\"%s\";if(a.length>0&&a[0].equals(\"--next\"))System.out.printf(P,y,x+y,J.replace(\"\\\\\",\"\\\\\\\\\").replace(\"\\\"\",\"\\\\\\\"\"),P.replace(\"\\\\\",\"\\\\\\\\\").replace(\"\\\"\",\"\\\\\\\"\"));else System.out.println(x);}}";P="import sys;x=%d;y=%d;J=\"%s\";P=\"%s\";print(J%%(y,x+y,P.replace('\\\\','\\\\\\\\').replace('\"','\\\\\"'),J.replace('\\\\','\\\\\\\\').replace('\"','\\\\\"')))if len(sys.argv)>1 and sys.argv[1]=='--next'else print(x)";print(J%(y,x+y,P.replace('\\','\\\\').replace('"','\\"'),J.replace('\\','\\\\').replace('"','\\"')))if len(sys.argv)>1 and sys.argv[1]=='--next'else print(x)
Saw the same with my Fibonacci double quine test that Gemini 3 Pro is the first to solve (Sonnet 3.5 was the first to solve the previous tier of this problem last year):
Gemini 3 Pro: