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

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

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

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.w: A = None
        self.p: B = None
        self.z: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.w: D = None
        self.txt = txt

m = A("m")
f = B("f")
k = C("k")
e = D("e")
n = E("n")
j = F("j")
l = B("l")

m.x = l
m.u = l
m.p = e
m.r = n
f.o = e
f.p = e
f.t = n
k.u = j
e.s = m
e.w = m
e.p = l
e.z = n
n.o = j
n.z = k
n.p = k
n.s = e
j.r = m
j.w = e
l.o = e
l.p = e
l.t = n
assert l.p.p.t.s.p.txt == "
class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.p: D = None
        self.r: E = None
        self.u: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.w: A = None
        self.p: B = None
        self.z: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.w: D = None
        self.txt = txt

m = A("m")
f = B("f")
k = C("k")
e = D("e")
n = E("n")
j = F("j")
l = B("l")

m.x = l
m.u = l
m.p = e
m.r = n
f.o = e
f.p = e
f.t = n
k.u = j
e.s = m
e.w = m
e.p = l
e.z = n
n.o = j
n.z = k
n.p = k
n.s = e
j.r = m
j.w = e
l.o = e
l.p = e
l.t = n
assert l.p.p.t.s.p.txt == "l"