class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.z: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.v: B = None
        self.x: E = None
        self.z: E = None
        self.txt = txt

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

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

i = A("i")
n = B("n")
g = C("g")
f = D("f")
j = E("j")
b = D("b")
m = C("m")
d = E("d")

i.w = n
i.z = m
n.y = f
g.q = f
g.v = n
g.x = d
g.z = d
f.t = g
j.t = n
b.t = m
m.q = f
m.v = n
m.x = d
m.z = j
d.t = n
assert m.v.y.t.q.t.x.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.z: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.v: B = None
        self.x: E = None
        self.z: E = None
        self.txt = txt

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

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

i = A("i")
n = B("n")
g = C("g")
f = D("f")
j = E("j")
b = D("b")
m = C("m")
d = E("d")

i.w = n
i.z = m
n.y = f
g.q = f
g.v = n
g.x = d
g.z = d
f.t = g
j.t = n
b.t = m
m.q = f
m.v = n
m.x = d
m.z = j
d.t = n
assert m.v.y.t.q.t.x.txt == "d"