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

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

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

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

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

c = A("c")
j = B("j")
l = C("l")
h = D("h")
e = E("e")

c.u = l
c.t = h
c.s = h
j.s = h
j.y = h
l.r = j
h.v = l
h.q = j
e.x = h
e.r = l
assert c.s.v.r.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.t: D = None
        self.s: D = None
        self.txt = txt

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

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

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

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

c = A("c")
j = B("j")
l = C("l")
h = D("h")
e = E("e")

c.u = l
c.t = h
c.s = h
j.s = h
j.y = h
l.r = j
h.v = l
h.q = j
e.x = h
e.r = l
assert c.s.v.r.txt == "j"