class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.u: D = None
        self.x: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.v: B = None
        self.u: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.w: D = None
        self.y: B = None
        self.txt = txt

c = A("c")
f = B("f")
b = C("b")
j = D("j")
d = E("d")

c.t = j
c.u = j
c.x = j
f.o = j
b.r = c
b.p = c
b.z = f
b.q = j
j.v = f
j.u = b
d.u = f
d.y = f
d.w = j
assert j.u.p.x.u.z.txt == "
class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.u: D = None
        self.x: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.v: B = None
        self.u: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.w: D = None
        self.y: B = None
        self.txt = txt

c = A("c")
f = B("f")
b = C("b")
j = D("j")
d = E("d")

c.t = j
c.u = j
c.x = j
f.o = j
b.r = c
b.p = c
b.z = f
b.q = j
j.v = f
j.u = b
d.u = f
d.y = f
d.w = j
assert j.u.p.x.u.z.txt == "f"