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

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

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

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

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

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

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

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

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

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

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

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

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

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

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