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

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

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

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

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

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

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

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

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

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

l.v = a
l.p = b
l.z = b
e.s = h
h.y = a
h.o = d
h.u = l
b.x = j
b.y = j
b.z = j
b.w = j
j.x = b
j.y = b
j.z = b
j.w = b
a.v = l
a.p = b
a.z = j
f.y = l
f.u = l
f.o = n
n.s = f
g.y = l
g.o = n
g.u = a
d.s = f
assert n.s.u.v.txt == "a"