import time
from machine import I2C,SoftI2C,Pin
from pico_i2c_lcd import I2cLcd
i2c=SoftI2C(sda=Pin(26),scl=Pin(27),freq=400000)
lcd_address=i2c.scan()[0]
print(lcd_address)
lcd=I2cLcd(i2c,lcd_address,2,16)
a=int(input("enter first\n"))
b=int(input("enter second\n"))
if(a<b):
a,b=b,a
while(True):
lcd.clear()
lcd.move_to(0,0);
lcd.putstr((str(a) + " % " + str(b) ));
res=a%b
lcd.move_to(0,1)
lcd.putstr(str(res))
if(res==0):
time.sleep(1)
lcd.clear()
lcd.move_to(0,0)
lcd.putstr("HCF: " + str(b))
break
a=b
b=res
time.sleep(1)