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

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

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

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

d = A("d")
g = B("g")
j = C("j")
l = D("l")
i = A("i")
c = B("c")
b = C("b")
e = C("e")
n = A("n")

d.p = e
d.z = l
d.t = l
d.o = n
g.r = l
g.s = e
g.x = c
j.s = c
j.z = b
j.o = i
l.y = d
i.p = j
i.z = l
i.t = l
i.o = d
c.r = l
c.s = j
c.x = g
b.s = g
b.z = j
b.o = d
e.s = g
e.z = j
e.o = i
n.p = e
n.z = l
n.t = l
n.o = i
assert j.s.r.y.o.t.y.p.o.o.txt == "
class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.z: D = None
        self.t: D = None
        self.o: A = None
        self.txt = txt

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

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

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

d = A("d")
g = B("g")
j = C("j")
l = D("l")
i = A("i")
c = B("c")
b = C("b")
e = C("e")
n = A("n")

d.p = e
d.z = l
d.t = l
d.o = n
g.r = l
g.s = e
g.x = c
j.s = c
j.z = b
j.o = i
l.y = d
i.p = j
i.z = l
i.t = l
i.o = d
c.r = l
c.s = j
c.x = g
b.s = g
b.z = j
b.o = d
e.s = g
e.z = j
e.o = i
n.p = e
n.z = l
n.t = l
n.o = i
assert j.s.r.y.o.t.y.p.o.o.txt == "d"