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

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

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

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

d = A("d")
a = B("a")
g = C("g")
j = D("j")
k = E("k")
n = F("n")
m = F("m")
e = B("e")

d.p = e
d.o = j
d.t = k
d.z = k
d.s = k
d.y = g
a.w = d
a.q = k
a.r = k
a.y = g
a.u = n
g.t = j
j.w = k
j.y = d
k.z = g
n.q = j
n.o = e
n.s = m
n.v = m
m.q = j
m.o = e
m.s = n
m.v = n
e.w = d
e.q = k
e.r = k
e.y = g
e.u = n
assert m.q.w.z.txt == "
class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.o: D = None
        self.t: E = None
        self.z: E = None
        self.y: C = None
        self.s: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

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

d = A("d")
a = B("a")
g = C("g")
j = D("j")
k = E("k")
n = F("n")
m = F("m")
e = B("e")

d.p = e
d.o = j
d.t = k
d.z = k
d.s = k
d.y = g
a.w = d
a.q = k
a.r = k
a.y = g
a.u = n
g.t = j
j.w = k
j.y = d
k.z = g
n.q = j
n.o = e
n.s = m
n.v = m
m.q = j
m.o = e
m.s = n
m.v = n
e.w = d
e.q = k
e.r = k
e.y = g
e.u = n
assert m.q.w.z.txt == "g"