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

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

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

e = A("e")
b = B("b")
l = C("l")
i = C("i")
j = B("j")
f = A("f")

e.u = b
b.x = j
l.y = i
l.u = j
l.o = e
i.y = l
i.u = j
i.o = e
j.x = b
f.u = j
assert j.x.x.x.txt == "
class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

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

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

e = A("e")
b = B("b")
l = C("l")
i = C("i")
j = B("j")
f = A("f")

e.u = b
b.x = j
l.y = i
l.u = j
l.o = e
i.y = l
i.u = j
i.o = e
j.x = b
f.u = j
assert j.x.x.x.txt == "b"