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

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

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

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

i = A("i")
k = B("k")
j = C("j")
l = D("l")
n = C("n")
f = D("f")
c = D("c")

i.z = c
i.v = k
i.s = n
k.r = j
j.t = n
j.u = f
j.w = c
l.p = c
n.t = j
n.u = f
n.w = f
f.p = l
c.p = f
assert j.t.t.w.p.p.txt == "
class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.v: B = None
        self.s: C = None
        self.txt = txt

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

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

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

i = A("i")
k = B("k")
j = C("j")
l = D("l")
n = C("n")
f = D("f")
c = D("c")

i.z = c
i.v = k
i.s = n
k.r = j
j.t = n
j.u = f
j.w = c
l.p = c
n.t = j
n.u = f
n.w = f
f.p = l
c.p = f
assert j.t.t.w.p.p.txt == "l"