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

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

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

e = A("e")
j = B("j")
c = C("c")
i = B("i")
f = C("f")

e.u = c
e.p = c
e.r = j
j.o = c
j.x = f
j.t = i
c.o = j
c.q = f
c.s = i
i.o = f
i.x = f
i.t = j
f.o = i
f.s = i
f.q = c
assert c.o.t.x.o.t.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.p: C = None
        self.r: B = None
        self.txt = txt

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

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

e = A("e")
j = B("j")
c = C("c")
i = B("i")
f = C("f")

e.u = c
e.p = c
e.r = j
j.o = c
j.x = f
j.t = i
c.o = j
c.q = f
c.s = i
i.o = f
i.x = f
i.t = j
f.o = i
f.s = i
f.q = c
assert c.o.t.x.o.t.txt == "j"