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

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

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

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

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

c = A("c")
j = B("j")
l = C("l")
i = D("i")
b = E("b")
f = A("f")
m = D("m")

c.y = m
c.w = b
c.r = b
j.p = l
l.u = i
l.w = b
i.q = j
i.s = j
i.x = b
i.w = m
b.p = l
b.t = c
f.y = m
f.w = b
f.r = b
m.q = j
m.s = j
m.x = b
m.w = i
assert c.w.p.w.t.y.txt == "
class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.w: E = None
        self.r: E = None
        self.txt = txt

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

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

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

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

c = A("c")
j = B("j")
l = C("l")
i = D("i")
b = E("b")
f = A("f")
m = D("m")

c.y = m
c.w = b
c.r = b
j.p = l
l.u = i
l.w = b
i.q = j
i.s = j
i.x = b
i.w = m
b.p = l
b.t = c
f.y = m
f.w = b
f.r = b
m.q = j
m.s = j
m.x = b
m.w = i
assert c.w.p.w.t.y.txt == "m"