class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.y: C = None
        self.u: E = None
        self.o: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.o: A = None
        self.w: B = None
        self.r: A = None
        self.p: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.y: C = None
        self.txt = txt

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

m = A("m")
j = B("j")
k = C("k")
d = D("d")
h = E("h")
a = B("a")

m.s = d
m.y = k
m.u = h
m.o = h
j.y = a
k.v = j
k.w = j
k.o = m
k.r = m
k.p = d
d.x = h
d.y = k
h.o = d
h.t = k
a.y = j
assert k.p.y.p.y.txt == "
class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.y: C = None
        self.u: E = None
        self.o: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.o: A = None
        self.w: B = None
        self.r: A = None
        self.p: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.y: C = None
        self.txt = txt

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

m = A("m")
j = B("j")
k = C("k")
d = D("d")
h = E("h")
a = B("a")

m.s = d
m.y = k
m.u = h
m.o = h
j.y = a
k.v = j
k.w = j
k.o = m
k.r = m
k.p = d
d.x = h
d.y = k
h.o = d
h.t = k
a.y = j
assert k.p.y.p.y.txt == "k"