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

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

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

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

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

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

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

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

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

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

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

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

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

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

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