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

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

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

class D:
    def __init__(self, txt: str):
        self.s: D = None
        self.t: D = None
        self.y: A = None
        self.txt = txt

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

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

e.t = k
e.r = l
b.p = e
b.w = d
k.s = l
k.p = l
k.y = b
k.t = d
k.z = f
l.s = f
l.t = f
l.y = e
d.w = k
n.p = e
n.w = d
f.s = l
f.t = l
f.y = e
m.p = e
m.w = d
assert e.r.s.y.t.t.w.s.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.r: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.s: D = None
        self.t: D = None
        self.y: A = None
        self.txt = txt

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

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

e.t = k
e.r = l
b.p = e
b.w = d
k.s = l
k.p = l
k.y = b
k.t = d
k.z = f
l.s = f
l.t = f
l.y = e
d.w = k
n.p = e
n.w = d
f.s = l
f.t = l
f.y = e
m.p = e
m.w = d
assert e.r.s.y.t.t.w.s.txt == "l"