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

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

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

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

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

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

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

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

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

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

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