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

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

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

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

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

k = A("k")
i = B("i")
d = C("d")
e = D("e")
j = E("j")
m = E("m")

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

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

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

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

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

k = A("k")
i = B("i")
d = C("d")
e = D("e")
j = E("j")
m = E("m")

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