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

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.x: C = None
        self.w: C = None
        self.q: A = None
        self.o: C = None
        self.y: C = None
        self.txt = txt

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

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

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

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

j = A("j")
e = B("e")
m = C("m")
i = D("i")
l = E("l")
d = F("d")
h = D("h")
a = A("a")
k = A("k")

j.z = d
e.t = d
e.x = m
e.w = m
e.o = m
e.y = m
e.q = k
m.q = h
m.z = d
i.p = j
l.s = e
l.v = e
l.u = e
l.o = d
l.q = a
d.z = h
h.p = k
a.z = d
k.z = d
assert d.z.p.z.z.p.z.txt == "
class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.x: C = None
        self.w: C = None
        self.q: A = None
        self.o: C = None
        self.y: C = None
        self.txt = txt

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

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

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

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

j = A("j")
e = B("e")
m = C("m")
i = D("i")
l = E("l")
d = F("d")
h = D("h")
a = A("a")
k = A("k")

j.z = d
e.t = d
e.x = m
e.w = m
e.o = m
e.y = m
e.q = k
m.q = h
m.z = d
i.p = j
l.s = e
l.v = e
l.u = e
l.o = d
l.q = a
d.z = h
h.p = k
a.z = d
k.z = d
assert d.z.p.z.z.p.z.txt == "d"