class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.t: B = None
        self.z: B = None
        self.p: D = None
        self.o: G = None
        self.y: D = None
        self.w: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.o: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: G = None
        self.q: B = None
        self.o: A = None
        self.p: G = None
        self.x: F = None
        self.t: E = None
        self.u: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.t: D = None
        self.s: C = None
        self.u: C = None
        self.z: C = None
        self.x: F = None
        self.p: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: F = None
        self.z: G = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.o: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: G = None
        self.q: B = None
        self.o: A = None
        self.p: G = None
        self.x: F = None
        self.t: E = None
        self.u: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.t: D = None
        self.s: C = None
        self.u: C = None
        self.z: C = None
        self.x: F = None
        self.p: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: F = None
        self.z: G = None
        self.txt = txt

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

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

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