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

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

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

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

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

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

a = A("a")
l = B("l")
g = C("g")
n = D("n")
f = E("f")
b = F("b")
d = B("d")
h = B("h")

a.z = g
a.w = f
a.v = f
a.r = n
a.y = b
l.t = b
l.z = f
g.p = a
g.o = n
g.z = n
g.s = h
g.w = l
g.q = f
n.r = a
n.s = b
n.v = d
f.o = a
f.s = h
f.p = n
b.u = a
b.r = a
b.p = a
b.z = g
b.q = h
d.t = b
d.z = f
h.t = b
h.z = f
assert h.t.r.z.txt == "
class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.w: E = None
        self.r: D = None
        self.v: E = None
        self.y: F = None
        self.txt = txt

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

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

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

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

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

a = A("a")
l = B("l")
g = C("g")
n = D("n")
f = E("f")
b = F("b")
d = B("d")
h = B("h")

a.z = g
a.w = f
a.v = f
a.r = n
a.y = b
l.t = b
l.z = f
g.p = a
g.o = n
g.z = n
g.s = h
g.w = l
g.q = f
n.r = a
n.s = b
n.v = d
f.o = a
f.s = h
f.p = n
b.u = a
b.r = a
b.p = a
b.z = g
b.q = h
d.t = b
d.z = f
h.t = b
h.z = f
assert h.t.r.z.txt == "g"