package chapter5;import java.util.Scanner;public class demo5 { public static void main(String[] args) { Scanner sc=new Scanner(System.in); String a=sc.next(); String b=sc.next(); int max=0; int maxi=0; int arr[][]=new int[a.length()][b.length()]; for(int i=0;imax) { maxi=i; max=arr[i][j]; } } } for(int i=max-1;i>=0;i--) { System.out.print(a.charAt(maxi-i)); } sc.close(); }}