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

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

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.w: A = None
        self.y: D = None
        self.x: A = None
        self.txt = txt

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

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

m = A("m")
k = B("k")
a = C("a")
n = D("n")
b = E("b")
d = B("d")
i = E("i")

m.p = a
k.w = d
k.v = d
k.s = d
k.r = m
a.r = d
a.w = m
a.x = m
a.y = n
n.u = k
n.s = a
b.s = i
b.z = i
b.o = a
b.q = n
d.w = k
d.v = k
d.s = k
d.r = m
i.s = b
i.z = b
i.o = a
i.q = n
assert m.p.y.u.txt == "
class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.w: A = None
        self.y: D = None
        self.x: A = None
        self.txt = txt

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

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

m = A("m")
k = B("k")
a = C("a")
n = D("n")
b = E("b")
d = B("d")
i = E("i")

m.p = a
k.w = d
k.v = d
k.s = d
k.r = m
a.r = d
a.w = m
a.x = m
a.y = n
n.u = k
n.s = a
b.s = i
b.z = i
b.o = a
b.q = n
d.w = k
d.v = k
d.s = k
d.r = m
i.s = b
i.z = b
i.o = a
i.q = n
assert m.p.y.u.txt == "k"