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

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

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

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

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

l.u = a
l.q = k
l.y = b
b.v = n
b.x = a
n.s = d
n.t = b
n.q = a
d.z = n
d.p = j
d.s = f
d.y = a
k.u = a
k.q = l
k.y = b
j.z = n
j.p = f
j.s = d
j.y = b
a.v = n
a.x = b
f.z = n
f.p = j
f.s = j
f.y = b
c.u = a
c.q = l
c.y = b
assert a.v.s.p.p.z.s.txt == "
class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.q: A = None
        self.y: B = None
        self.txt = txt

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

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

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

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

l.u = a
l.q = k
l.y = b
b.v = n
b.x = a
n.s = d
n.t = b
n.q = a
d.z = n
d.p = j
d.s = f
d.y = a
k.u = a
k.q = l
k.y = b
j.z = n
j.p = f
j.s = d
j.y = b
a.v = n
a.x = b
f.z = n
f.p = j
f.s = j
f.y = b
c.u = a
c.q = l
c.y = b
assert a.v.s.p.p.z.s.txt == "d"