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

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

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

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.r: E = None
        self.z: E = None
        self.w: A = None
        self.x: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.p: C = None
        self.o: D = None
        self.w: E = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.r: E = None
        self.z: E = None
        self.w: A = None
        self.x: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.p: C = None
        self.o: D = None
        self.w: E = None
        self.txt = txt

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

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