class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.p: B = None
        self.s: D = None
        self.q: B = None
        self.t: D = None
        self.txt = txt

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

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

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

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

c = A("c")
a = B("a")
b = C("b")
k = D("k")
d = E("d")
j = B("j")
l = D("l")

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

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

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

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

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

c = A("c")
a = B("a")
b = C("b")
k = D("k")
d = E("d")
j = B("j")
l = D("l")

c.y = d
c.p = j
c.s = k
c.t = k
c.q = a
a.v = d
b.x = l
b.u = d
b.r = a
k.w = l
d.t = b
j.v = d
l.w = k
assert d.t.u.t.u.t.txt == "b"