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

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

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

class D:
    def __init__(self, txt: str):
        self.p: D = None
        self.w: D = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.r: F = None
        self.u: B = None
        self.o: D = None
        self.y: D = None
        self.x: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.s: B = None
        self.r: B = None
        self.txt = txt

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

h = A("h")
a = B("a")
e = C("e")
m = D("m")
f = E("f")
d = F("d")
g = G("g")
k = D("k")
c = B("c")

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

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

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

class D:
    def __init__(self, txt: str):
        self.p: D = None
        self.w: D = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.r: F = None
        self.u: B = None
        self.o: D = None
        self.y: D = None
        self.x: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.s: B = None
        self.r: B = None
        self.txt = txt

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

h = A("h")
a = B("a")
e = C("e")
m = D("m")
f = E("f")
d = F("d")
g = G("g")
k = D("k")
c = B("c")

h.z = a
h.v = c
h.r = m
h.u = k
h.s = k
h.y = f
a.x = d
a.w = d
a.z = c
e.s = h
m.p = k
m.w = k
f.v = e
f.x = e
f.r = d
f.u = a
f.o = k
f.y = k
d.v = f
d.s = a
d.r = a
g.s = f
k.p = m
k.w = m
c.x = d
c.w = d
c.z = a
assert a.z.z.z.txt == "c"