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

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

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

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

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

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

b = A("b")
i = B("i")
a = C("a")
m = D("m")
f = E("f")
n = F("n")
k = F("k")
l = B("l")
d = C("d")

b.y = a
i.t = f
i.o = f
i.q = m
i.z = l
a.x = b
a.p = l
a.z = k
a.r = k
a.q = m
m.s = b
m.z = b
m.x = f
m.t = f
m.u = f
m.p = k
f.s = l
f.u = l
f.z = n
f.p = i
f.r = b
n.q = f
n.x = m
k.q = f
k.x = m
l.t = f
l.o = f
l.q = m
l.z = i
d.x = b
d.p = i
d.z = k
d.r = n
d.q = m
assert l.q.p.q.z.x.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

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

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

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

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

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

b = A("b")
i = B("i")
a = C("a")
m = D("m")
f = E("f")
n = F("n")
k = F("k")
l = B("l")
d = C("d")

b.y = a
i.t = f
i.o = f
i.q = m
i.z = l
a.x = b
a.p = l
a.z = k
a.r = k
a.q = m
m.s = b
m.z = b
m.x = f
m.t = f
m.u = f
m.p = k
f.s = l
f.u = l
f.z = n
f.p = i
f.r = b
n.q = f
n.x = m
k.q = f
k.x = m
l.t = f
l.o = f
l.q = m
l.z = i
d.x = b
d.p = i
d.z = k
d.r = n
d.q = m
assert l.q.p.q.z.x.txt == "m"