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

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

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

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

j = A("j")
n = B("n")
b = C("b")
d = D("d")
f = B("f")
c = B("c")
e = C("e")
l = D("l")

j.v = l
j.p = e
n.z = c
n.s = f
b.z = e
d.t = j
f.z = n
f.s = n
c.z = f
c.s = n
e.z = b
l.t = j
assert d.t.p.z.z.z.z.z.txt == "
class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.p: C = None
        self.txt = txt

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

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

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

j = A("j")
n = B("n")
b = C("b")
d = D("d")
f = B("f")
c = B("c")
e = C("e")
l = D("l")

j.v = l
j.p = e
n.z = c
n.s = f
b.z = e
d.t = j
f.z = n
f.s = n
c.z = f
c.s = n
e.z = b
l.t = j
assert d.t.p.z.z.z.z.z.txt == "b"