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

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.v: F = None
        self.x: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.q: D = None
        self.s: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.p: E = None
        self.s: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.o: E = None
        self.q: E = None
        self.s: E = None
        self.y: A = None
        self.v: D = None
        self.txt = txt

d = A("d")
m = B("m")
a = C("a")
h = D("h")
n = E("n")
j = F("j")
f = G("f")
c = A("c")

d.w = a
d.y = a
d.z = f
m.w = h
m.x = h
m.v = j
a.y = d
h.q = j
n.r = a
n.q = h
n.s = h
j.w = a
j.p = n
j.s = f
f.t = n
f.o = n
f.q = n
f.s = n
f.y = d
f.v = h
c.w = a
c.y = a
c.z = f
assert d.z.y.z.v.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.z: G = None
        self.y: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.v: F = None
        self.x: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.q: D = None
        self.s: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.p: E = None
        self.s: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.o: E = None
        self.q: E = None
        self.s: E = None
        self.y: A = None
        self.v: D = None
        self.txt = txt

d = A("d")
m = B("m")
a = C("a")
h = D("h")
n = E("n")
j = F("j")
f = G("f")
c = A("c")

d.w = a
d.y = a
d.z = f
m.w = h
m.x = h
m.v = j
a.y = d
h.q = j
n.r = a
n.q = h
n.s = h
j.w = a
j.p = n
j.s = f
f.t = n
f.o = n
f.q = n
f.s = n
f.y = d
f.v = h
c.w = a
c.y = a
c.z = f
assert d.z.y.z.v.txt == "h"