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

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

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

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

j = A("j")
f = B("f")
l = C("l")
e = D("e")
b = B("b")
i = C("i")
a = D("a")
n = D("n")
h = B("h")
k = D("k")

j.t = l
j.v = f
j.u = b
f.w = h
f.p = a
f.q = n
l.z = j
l.p = k
e.p = n
e.s = j
b.w = h
b.p = k
b.q = e
i.z = j
i.p = e
a.p = k
a.s = j
n.p = a
n.s = j
h.w = b
h.p = a
h.q = k
k.p = a
k.s = j
assert b.q.p.s.v.q.p.p.p.s.v.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.v: B = None
        self.u: B = None
        self.txt = txt

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

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

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

j = A("j")
f = B("f")
l = C("l")
e = D("e")
b = B("b")
i = C("i")
a = D("a")
n = D("n")
h = B("h")
k = D("k")

j.t = l
j.v = f
j.u = b
f.w = h
f.p = a
f.q = n
l.z = j
l.p = k
e.p = n
e.s = j
b.w = h
b.p = k
b.q = e
i.z = j
i.p = e
a.p = k
a.s = j
n.p = a
n.s = j
h.w = b
h.p = a
h.q = k
k.p = a
k.s = j
assert b.q.p.s.v.q.p.p.p.s.v.txt == "f"