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

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

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

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

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

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

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

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

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

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

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