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

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

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

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

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

j.z = m
j.x = m
j.s = l
e.w = j
e.p = j
i.t = c
i.x = c
i.v = n
i.w = m
k.r = i
k.y = m
k.o = h
k.v = c
l.z = i
l.x = i
l.s = j
m.t = n
m.v = c
m.w = i
m.x = e
c.w = j
c.p = j
n.w = l
n.p = h
h.z = i
h.x = m
h.s = l
assert k.v.w.x.v.p.s.z.x.p.txt == "
class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.x: C = None
        self.s: A = None
        self.txt = txt

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

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

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

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

j.z = m
j.x = m
j.s = l
e.w = j
e.p = j
i.t = c
i.x = c
i.v = n
i.w = m
k.r = i
k.y = m
k.o = h
k.v = c
l.z = i
l.x = i
l.s = j
m.t = n
m.v = c
m.w = i
m.x = e
c.w = j
c.p = j
n.w = l
n.p = h
h.z = i
h.x = m
h.s = l
assert k.v.w.x.v.p.s.z.x.p.txt == "j"