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

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

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.q: E = None
        self.p: D = None
        self.t: D = None
        self.v: D = None
        self.txt = txt

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

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

g = A("g")
h = B("h")
e = C("e")
f = D("f")
a = E("a")
b = E("b")
c = D("c")
m = C("m")

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

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

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.q: E = None
        self.p: D = None
        self.t: D = None
        self.v: D = None
        self.txt = txt

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

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

g = A("g")
h = B("h")
e = C("e")
f = D("f")
a = E("a")
b = E("b")
c = D("c")
m = C("m")

g.w = b
g.s = e
g.u = e
g.x = c
g.q = h
h.p = g
e.s = h
e.q = b
e.p = c
e.t = c
e.v = f
f.x = c
f.y = b
a.t = f
a.z = b
a.x = c
b.t = f
b.z = a
b.x = c
c.x = f
c.y = a
m.s = h
m.q = a
m.p = c
m.t = f
m.v = f
assert h.p.u.q.z.z.t.x.txt == "c"