human
Smallest string divisible by two given strings | Function to calculate GCD of two numbers.
Function to calculate LCM of two numbers.
Function to find the smallest string which is divisible by strings S and T.
Store the length of both strings.
Store LCM of n and m.
Temporary strings to store concatenated strings.
Concatenate s1 ( l / n ) times.
Concatenate t1 ( l / m ) times.
If s1 and t1 are equal.
Otherwise , pr - 1.
Driver Code"
Solution in Python:

=====
Give me a code to smallest string divisible by two given strings and the other steps required?
assistant
#Here is code to smallest string divisible by two given strings and the other steps required.
 def gcd ( a , b ) :
	if ( b == 0 ) :
		return a
	return gcd ( b , a % b )
def lcm ( a , b ) :
	return ( a // gcd ( a , b ) ) * b
def findSmallestString ( s , t ) :
	n , m = len ( s ) , len ( t )
	l = lcm ( n , m )
	s1 , t1 = " " , " "
	for i in range ( l // n ) :
		s1 += s
	for i in range ( l // m ) :
		t1 += t
	if ( s1 == t1 ) :
		print ( s1 )
	else :
		print ( - 1 )
if __name__ == ' _ _ main _ _ ' :
	S , T = " baba " , " ba "
	findSmallestString ( S , T )