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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.v: A = None
        self.u: A = None
        self.w: A = None
        self.q: A = None
        self.txt = txt

e = A("e")
j = B("j")
i = C("i")
k = D("k")
m = E("m")
a = C("a")
c = C("c")
b = C("b")

e.s = m
e.o = j
j.x = k
i.t = k
i.y = j
k.w = m
k.p = j
m.r = c
m.v = e
m.u = e
m.w = e
m.q = e
a.t = k
a.y = j
c.t = k
c.y = j
b.t = k
b.y = j
assert c.y.x.w.r.t.w.w.o.txt == "
class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.o: B = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.v: A = None
        self.u: A = None
        self.w: A = None
        self.q: A = None
        self.txt = txt

e = A("e")
j = B("j")
i = C("i")
k = D("k")
m = E("m")
a = C("a")
c = C("c")
b = C("b")

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