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

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

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

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

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

d.v = l
d.x = c
l.q = h
h.u = i
h.y = i
h.q = i
n.w = g
n.r = h
n.s = i
g.v = l
g.x = c
f.v = l
f.x = c
j.w = d
j.r = h
j.s = n
e.v = c
e.x = c
i.w = g
i.r = h
i.s = j
c.q = h
assert n.r.u.w.v.q.q.r.y.s.r.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.x: B = None
        self.txt = txt

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

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

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

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

d.v = l
d.x = c
l.q = h
h.u = i
h.y = i
h.q = i
n.w = g
n.r = h
n.s = i
g.v = l
g.x = c
f.v = l
f.x = c
j.w = d
j.r = h
j.s = n
e.v = c
e.x = c
i.w = g
i.r = h
i.s = j
c.q = h
assert n.r.u.w.v.q.q.r.y.s.r.txt == "h"