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

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

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

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

m = A("m")
c = B("c")
i = C("i")
f = D("f")
j = B("j")
a = D("a")
e = C("e")
b = A("b")
g = B("g")
l = C("l")

m.p = g
m.o = b
m.z = i
m.t = a
c.s = j
c.t = i
i.y = a
i.z = m
f.o = l
j.s = g
j.t = i
a.o = e
e.y = f
e.z = b
b.p = g
b.o = m
b.z = e
b.t = a
g.s = c
g.t = e
l.y = a
l.z = b
assert c.s.t.z.txt == "
class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.o: A = None
        self.z: C = None
        self.t: D = None
        self.txt = txt

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

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

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

m = A("m")
c = B("c")
i = C("i")
f = D("f")
j = B("j")
a = D("a")
e = C("e")
b = A("b")
g = B("g")
l = C("l")

m.p = g
m.o = b
m.z = i
m.t = a
c.s = j
c.t = i
i.y = a
i.z = m
f.o = l
j.s = g
j.t = i
a.o = e
e.y = f
e.z = b
b.p = g
b.o = m
b.z = e
b.t = a
g.s = c
g.t = e
l.y = a
l.z = b
assert c.s.t.z.txt == "m"