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

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

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

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

k = A("k")
i = B("i")
j = C("j")
h = D("h")
c = B("c")
f = B("f")
d = A("d")

k.o = d
k.s = h
k.q = i
k.x = j
i.t = h
i.r = c
i.u = j
j.v = h
h.p = k
h.z = i
h.o = j
h.y = j
c.t = h
c.r = i
c.u = j
f.t = h
f.r = i
f.u = j
d.o = k
d.s = h
d.q = i
d.x = j
assert c.u.v.o.v.y.v.z.txt == "
class A:
    def __init__(self, txt: str):
        self.o: A = None
        self.s: D = None
        self.q: B = None
        self.x: C = None
        self.txt = txt

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

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

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

k = A("k")
i = B("i")
j = C("j")
h = D("h")
c = B("c")
f = B("f")
d = A("d")

k.o = d
k.s = h
k.q = i
k.x = j
i.t = h
i.r = c
i.u = j
j.v = h
h.p = k
h.z = i
h.o = j
h.y = j
c.t = h
c.r = i
c.u = j
f.t = h
f.r = i
f.u = j
d.o = k
d.s = h
d.q = i
d.x = j
assert c.u.v.o.v.y.v.z.txt == "i"