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

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

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

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

j = A("j")
h = B("h")
d = C("d")
l = D("l")
f = B("f")
n = D("n")
m = C("m")

j.z = m
j.s = m
j.p = l
h.u = j
h.s = n
d.s = l
d.p = f
d.o = n
d.t = j
l.y = j
l.v = d
l.z = f
f.u = j
f.s = n
n.y = j
n.v = d
n.z = h
m.s = l
m.p = f
m.o = n
m.t = j
assert h.s.v.p.u.s.s.y.txt == "
class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.p: D = None
        self.s: C = None
        self.txt = txt

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

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

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

j = A("j")
h = B("h")
d = C("d")
l = D("l")
f = B("f")
n = D("n")
m = C("m")

j.z = m
j.s = m
j.p = l
h.u = j
h.s = n
d.s = l
d.p = f
d.o = n
d.t = j
l.y = j
l.v = d
l.z = f
f.u = j
f.s = n
n.y = j
n.v = d
n.z = h
m.s = l
m.p = f
m.o = n
m.t = j
assert h.s.v.p.u.s.s.y.txt == "j"