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

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

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

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

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

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

h.u = e
d.v = f
d.r = i
d.q = i
l.t = k
i.r = k
i.w = e
e.y = k
e.u = i
f.y = l
f.u = i
k.t = l
assert e.u.r.t.t.t.txt == "
class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

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

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

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

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

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

h.u = e
d.v = f
d.r = i
d.q = i
l.t = k
i.r = k
i.w = e
e.y = k
e.u = i
f.y = l
f.u = i
k.t = l
assert e.u.r.t.t.t.txt == "l"