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

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

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

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

d = A("d")
e = B("e")
b = C("b")
j = D("j")
h = A("h")
a = C("a")
l = C("l")
g = A("g")
c = D("c")
n = B("n")

d.q = c
d.v = l
d.x = n
e.w = a
e.t = a
e.s = d
b.y = d
j.u = g
j.x = c
j.z = d
h.q = c
h.v = l
h.x = n
a.y = g
l.y = d
g.q = j
g.v = l
g.x = e
c.u = g
c.x = j
c.z = d
n.w = l
n.t = b
n.s = h
assert d.v.y.q.z.v.txt == "
class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.v: C = None
        self.x: B = None
        self.txt = txt

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

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

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

d = A("d")
e = B("e")
b = C("b")
j = D("j")
h = A("h")
a = C("a")
l = C("l")
g = A("g")
c = D("c")
n = B("n")

d.q = c
d.v = l
d.x = n
e.w = a
e.t = a
e.s = d
b.y = d
j.u = g
j.x = c
j.z = d
h.q = c
h.v = l
h.x = n
a.y = g
l.y = d
g.q = j
g.v = l
g.x = e
c.u = g
c.x = j
c.z = d
n.w = l
n.t = b
n.s = h
assert d.v.y.q.z.v.txt == "l"