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

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

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

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

k = A("k")
j = B("j")
c = C("c")
e = D("e")
h = D("h")
i = C("i")
b = C("b")
a = B("a")
n = A("n")
m = D("m")

k.s = m
k.u = n
k.o = n
k.z = j
j.x = c
j.s = k
c.p = j
c.v = h
c.x = a
c.o = a
e.u = b
e.y = a
e.o = j
e.z = k
h.u = b
h.y = j
h.o = j
h.z = n
i.p = a
i.x = a
i.v = e
i.o = j
b.p = j
b.x = j
b.v = m
b.o = a
a.x = i
a.s = k
n.s = e
n.u = k
n.o = k
n.z = a
m.u = b
m.y = j
m.o = a
m.z = k
assert i.o.s.z.txt == "
class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.u: A = None
        self.z: B = None
        self.o: A = None
        self.txt = txt

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

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

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

k = A("k")
j = B("j")
c = C("c")
e = D("e")
h = D("h")
i = C("i")
b = C("b")
a = B("a")
n = A("n")
m = D("m")

k.s = m
k.u = n
k.o = n
k.z = j
j.x = c
j.s = k
c.p = j
c.v = h
c.x = a
c.o = a
e.u = b
e.y = a
e.o = j
e.z = k
h.u = b
h.y = j
h.o = j
h.z = n
i.p = a
i.x = a
i.v = e
i.o = j
b.p = j
b.x = j
b.v = m
b.o = a
a.x = i
a.s = k
n.s = e
n.u = k
n.o = k
n.z = a
m.u = b
m.y = j
m.o = a
m.z = k
assert i.o.s.z.txt == "j"