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

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

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

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

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

k = A("k")
h = B("h")
i = C("i")
j = D("j")
f = E("f")
e = D("e")

k.r = f
k.w = i
k.z = i
k.q = j
k.o = h
h.x = f
h.y = j
h.s = i
i.s = h
j.w = h
f.s = h
f.o = e
e.w = h
assert i.s.y.w.s.s.txt == "
class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.w: C = None
        self.q: D = None
        self.z: C = None
        self.o: B = None
        self.txt = txt

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

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

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

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

k = A("k")
h = B("h")
i = C("i")
j = D("j")
f = E("f")
e = D("e")

k.r = f
k.w = i
k.z = i
k.q = j
k.o = h
h.x = f
h.y = j
h.s = i
i.s = h
j.w = h
f.s = h
f.o = e
e.w = h
assert i.s.y.w.s.s.txt == "h"