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

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

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

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

e = A("e")
j = B("j")
l = C("l")
d = D("d")
n = A("n")
b = B("b")
g = C("g")
m = D("m")

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

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

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

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

e = A("e")
j = B("j")
l = C("l")
d = D("d")
n = A("n")
b = B("b")
g = C("g")
m = D("m")

e.q = m
e.v = b
e.z = l
e.u = j
j.v = n
j.w = l
l.v = m
l.q = d
d.r = b
d.x = n
d.u = g
d.t = l
n.q = d
n.v = b
n.u = b
n.z = l
b.v = e
b.w = g
g.v = d
g.q = m
m.r = b
m.x = e
m.u = g
m.t = g
assert l.v.r.v.z.v.t.v.u.txt == "g"