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

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

class C:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

k = A("k")
m = B("m")
j = C("j")
g = A("g")
l = C("l")
e = A("e")

k.o = m
m.u = k
j.o = l
g.o = m
l.o = j
e.o = m
assert e.o.u.o.u.o.u.txt == "
class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

k = A("k")
m = B("m")
j = C("j")
g = A("g")
l = C("l")
e = A("e")

k.o = m
m.u = k
j.o = l
g.o = m
l.o = j
e.o = m
assert e.o.u.o.u.o.u.txt == "k"