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

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

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

a = A("a")
e = B("e")
l = C("l")
d = C("d")
k = C("k")
i = A("i")
j = B("j")

a.p = e
e.r = j
e.q = j
e.w = k
l.v = d
l.s = e
d.v = k
d.s = j
k.v = d
k.s = j
i.p = j
j.r = e
j.q = e
j.w = l
assert e.q.r.w.v.s.txt == "
class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

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

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

a = A("a")
e = B("e")
l = C("l")
d = C("d")
k = C("k")
i = A("i")
j = B("j")

a.p = e
e.r = j
e.q = j
e.w = k
l.v = d
l.s = e
d.v = k
d.s = j
k.v = d
k.s = j
i.p = j
j.r = e
j.q = e
j.w = l
assert e.q.r.w.v.s.txt == "j"