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

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.v: C = None
        self.z: A = None
        self.s: A = None
        self.r: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.r: E = None
        self.v: A = None
        self.w: C = None
        self.y: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: B = None
        self.y: D = None
        self.z: A = None
        self.q: B = None
        self.w: B = None
        self.txt = txt

d = A("d")
i = B("i")
c = C("c")
h = D("h")
g = E("g")
f = B("f")
a = B("a")
e = D("e")

d.q = e
d.u = e
d.r = i
d.y = h
d.z = c
i.t = g
i.r = g
i.v = c
i.z = d
i.s = d
c.x = f
h.x = g
h.r = g
h.v = d
h.w = c
h.y = c
g.x = i
g.w = i
g.y = e
g.z = d
g.q = a
f.t = g
f.r = g
f.v = c
f.z = d
f.s = d
a.t = g
a.r = g
a.v = c
a.z = d
a.s = d
e.x = g
e.r = g
e.v = d
e.w = c
e.y = c
assert h.y.x.r.z.txt == "
class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.u: D = None
        self.r: B = None
        self.y: D = None
        self.z: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.v: C = None
        self.z: A = None
        self.s: A = None
        self.r: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.r: E = None
        self.v: A = None
        self.w: C = None
        self.y: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: B = None
        self.y: D = None
        self.z: A = None
        self.q: B = None
        self.w: B = None
        self.txt = txt

d = A("d")
i = B("i")
c = C("c")
h = D("h")
g = E("g")
f = B("f")
a = B("a")
e = D("e")

d.q = e
d.u = e
d.r = i
d.y = h
d.z = c
i.t = g
i.r = g
i.v = c
i.z = d
i.s = d
c.x = f
h.x = g
h.r = g
h.v = d
h.w = c
h.y = c
g.x = i
g.w = i
g.y = e
g.z = d
g.q = a
f.t = g
f.r = g
f.v = c
f.z = d
f.s = d
a.t = g
a.r = g
a.v = c
a.z = d
a.s = d
e.x = g
e.r = g
e.v = d
e.w = c
e.y = c
assert h.y.x.r.z.txt == "d"