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

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

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

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

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

c.p = l
i.y = k
i.t = k
i.x = d
i.o = a
j.o = a
d.o = l
d.z = a
d.s = c
d.t = c
a.y = i
a.x = l
a.t = k
a.o = k
m.o = i
n.p = d
k.y = a
k.o = a
k.x = l
k.t = i
l.o = d
l.z = k
l.s = c
l.t = c
assert l.o.t.p.z.x.t.p.txt == "
class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

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

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

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

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

c.p = l
i.y = k
i.t = k
i.x = d
i.o = a
j.o = a
d.o = l
d.z = a
d.s = c
d.t = c
a.y = i
a.x = l
a.t = k
a.o = k
m.o = i
n.p = d
k.y = a
k.o = a
k.x = l
k.t = i
l.o = d
l.z = k
l.s = c
l.t = c
assert l.o.t.p.z.x.t.p.txt == "l"