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

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

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

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

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

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

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

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

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

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

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

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

a.v = g
a.s = g
a.x = g
j.t = h
h.q = g
g.x = f
l.r = j
l.z = b
l.u = h
c.t = h
f.r = c
f.z = b
f.u = h
b.r = c
b.z = l
b.u = h
n.r = c
n.z = b
n.u = h
assert c.t.q.x.r.t.q.x.z.u.txt == "h"