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

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

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

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

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

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

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

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

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

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

n.v = l
n.q = j
n.w = d
e.o = j
e.s = b
e.r = a
i.r = a
i.x = n
i.t = n
j.v = i
j.z = l
g.o = j
g.s = b
g.r = e
b.v = j
b.q = l
b.w = i
f.v = l
f.q = j
f.w = d
l.v = i
l.z = j
a.o = j
a.s = f
a.r = e
d.r = g
d.x = f
d.t = f
assert n.w.t.v.z.z.txt == "l"