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

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

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

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

l = A("l")
d = B("d")
e = C("e")
n = D("n")

l.s = d
l.r = n
l.z = n
l.u = e
d.u = e
e.w = d
e.r = n
e.s = n
e.v = n
n.y = d
n.u = d
n.q = d
assert n.u.u.v.txt == "
class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.r: D = None
        self.z: D = None
        self.u: C = None
        self.txt = txt

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

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

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

l = A("l")
d = B("d")
e = C("e")
n = D("n")

l.s = d
l.r = n
l.z = n
l.u = e
d.u = e
e.w = d
e.r = n
e.s = n
e.v = n
n.y = d
n.u = d
n.q = d
assert n.u.u.v.txt == "n"