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

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

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

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

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

m = A("m")
k = B("k")
j = C("j")
h = D("h")
e = E("e")
i = D("i")
b = D("b")
l = A("l")

m.u = j
m.x = j
m.w = e
m.p = k
m.s = k
k.u = e
j.z = i
h.o = k
h.y = m
e.p = h
i.o = k
i.y = l
b.o = k
b.y = l
l.u = j
l.x = j
l.w = e
l.p = k
l.s = k
assert k.u.p.y.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.w: E = None
        self.p: B = None
        self.x: C = None
        self.s: B = None
        self.txt = txt

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

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

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

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

m = A("m")
k = B("k")
j = C("j")
h = D("h")
e = E("e")
i = D("i")
b = D("b")
l = A("l")

m.u = j
m.x = j
m.w = e
m.p = k
m.s = k
k.u = e
j.z = i
h.o = k
h.y = m
e.p = h
i.o = k
i.y = l
b.o = k
b.y = l
l.u = j
l.x = j
l.w = e
l.p = k
l.s = k
assert k.u.p.y.txt == "m"