import java.util.*;
public class sookshmas
{
public static void main(String[] args) {
ArrayListInteger list = new ArrayListInteger(100);
int count=2;
for(int a=0;a10;a++){
for(int b=0;b10;b++){
int x=(a+b)%10;
int y=(b+x)%10;
System .out .print("Numbers :"+a+" "+b+"\n"+a+" "+b+" "+x+" "+y+" ");
while(true){
if((x==a)&&(y==b)){
System .out .println ("\nLength :"+count);
list.add(count);
count =2;
break ;
}
else{
x=(x+y)%10;
y=(y+x)%10;
System .out .print(x+" "+y+" ");
count+=2;
}
}
System .out .println ("\n\n");
}
}
Integer var = list .stream().max(Integer::compare).get();
System.out.print("Max length is "+var);
}
}