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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.w: D = None
        self.s: E = None
        self.v: A = None
        self.t: D = None
        self.txt = txt

h = A("h")
b = B("b")
g = C("g")
k = D("k")
d = E("d")
l = E("l")

h.u = k
b.r = k
g.x = d
k.w = l
d.z = g
d.w = k
d.t = k
d.s = l
d.v = h
l.z = g
l.w = k
l.t = k
l.s = d
l.v = h
assert b.r.w.z.x.w.txt == "
class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.w: D = None
        self.s: E = None
        self.v: A = None
        self.t: D = None
        self.txt = txt

h = A("h")
b = B("b")
g = C("g")
k = D("k")
d = E("d")
l = E("l")

h.u = k
b.r = k
g.x = d
k.w = l
d.z = g
d.w = k
d.t = k
d.s = l
d.v = h
l.z = g
l.w = k
l.t = k
l.s = d
l.v = h
assert b.r.w.z.x.w.txt == "k"