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

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

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

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

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

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

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

m.s = a
m.p = n
k.s = l
f.z = i
d.t = a
d.u = k
n.s = k
n.u = i
a.r = k
a.z = e
a.s = m
e.r = k
e.z = a
e.s = c
i.z = f
c.s = e
c.p = n
l.t = e
l.u = k
assert d.u.s.u.txt == "
class A:
    def __init__(self, txt: str):
        self.s: F = None
        self.p: E = None
        self.txt = txt

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

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

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

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

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

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

m.s = a
m.p = n
k.s = l
f.z = i
d.t = a
d.u = k
n.s = k
n.u = i
a.r = k
a.z = e
a.s = m
e.r = k
e.z = a
e.s = c
i.z = f
c.s = e
c.p = n
l.t = e
l.u = k
assert d.u.s.u.txt == "k"