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

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

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

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

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

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

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

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

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

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

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