import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Scanner;
public class test31 {
//分别判断字典排序和长度排序
public static boolean issortby_dictionary(int n,String[]arr){
//字典排序主要是要用到compareto的方法
//compareTo方法用于比较字符串时,会先从第一位开始比较,如果遇到
//不同的字符,则会返回这两个字符的ascii差值,返回值是int类型。
//如果相同则去下一位比较
for (int i = 0; i <n-1 ; i++) {
if (arr[i].compareTo(arr[i+1])>0){
return false;
}
}
return true;
}
public static boolean issortby_length(int n,String[]arr){
for (int i = 0; i <n-1 ; i++) {
if (arr[i].length()>arr[i+1].length()){
return false;
}
}
return true;
}
public static void main(String[] args) throws IOException {
/*Scanner scanner=new Scanner(System.in);
String a=scanner.nextLine();
int n=Integer.parseInt(a);//字符串直接读为数字类型*/
//换一种写法
BufferedReader bufferedReader=new BufferedReader(new InputStreamReader(System.in));
//上面代码的意思 buffer代表缓冲区,可以接收任意长度的内容,避免乱码产生
//BufferedReader里传入Reader对键盘写入数据进行读取
//上面写法常用于字符较多的情况,缓冲区字符流读取一行文本
//**********************************************
//这里是把读出的一行字符数据转化为int类型数据
int n=Integer.parseInt(bufferedReader.readLine());//抛出的异常为读写异常,
// 磁盘上读一个文件不存在时会抛出
String[]arr=new String[n];
for (int i = 0; i <n ; i++) {
arr[i]=bufferedReader.readLine();//将每一行读到的数据存入数组
}
if (issortby_dictionary(n,arr)&&issortby_length(n,arr)){
System.out.println("both");
}else if (issortby_length(n,arr)){
System.out.println("lengths");
}else if(issortby_dictionary(n,arr)){
System.out.println("lexicographically");
}else {
System.out.println("none");
}
}
}
import java.util.Scanner;
public class test33 {
//最小公倍数是能被A和B整除的最小正整数值
public static int func33(int A,int B){
//首先要知道求最小公倍数的公式(A*B)/最大公约数
//辗转相除法的思路来求最小公约数,拿较大的数不断地去取摩
//较小的数,然后拿较大的数去继续取摩。
if (A<B){
int tmp=A;
B=A;
A=tmp;
}
int a;
//不断辗转相除后的数
while (( a=A%B)>0){
A=B;
B=a;
}
return B;
}
public static void main(String[] args) {
Scanner scanner=new Scanner(System.in);
int a=scanner.nextInt();
int b=scanner.nextInt();
int ab=func33(a,b);//求出最大公约数
System.out.println(a*b/ab);
}
}