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

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

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

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

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

l = A("l")
n = B("n")
c = C("c")
a = D("a")
b = E("b")

l.v = b
l.s = n
l.u = c
n.r = l
c.p = b
a.w = l
a.s = n
a.z = c
b.t = n
assert b.t.r.u.txt == "
class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.s: B = None
        self.u: C = None
        self.txt = txt

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

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

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

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

l = A("l")
n = B("n")
c = C("c")
a = D("a")
b = E("b")

l.v = b
l.s = n
l.u = c
n.r = l
c.p = b
a.w = l
a.s = n
a.z = c
b.t = n
assert b.t.r.u.txt == "c"