class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.q: A = None
        self.txt = txt

i = A("i")
e = B("e")
l = B("l")
c = A("c")
a = B("a")

i.u = l
e.u = i
e.q = c
l.u = c
l.q = c
c.u = l
a.u = i
a.q = c
assert a.u.u.q.u.q.txt == "
class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.q: A = None
        self.txt = txt

i = A("i")
e = B("e")
l = B("l")
c = A("c")
a = B("a")

i.u = l
e.u = i
e.q = c
l.u = c
l.q = c
c.u = l
a.u = i
a.q = c
assert a.u.u.q.u.q.txt == "c"