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

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

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

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

c = A("c")
g = B("g")
m = C("m")
j = D("j")
h = A("h")
a = A("a")
k = B("k")
i = A("i")
l = A("l")

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

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

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

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

c = A("c")
g = B("g")
m = C("m")
j = D("j")
h = A("h")
a = A("a")
k = B("k")
i = A("i")
l = A("l")

c.y = m
c.x = j
c.o = j
c.s = k
g.z = m
g.y = m
g.p = k
g.t = h
m.v = j
m.x = g
m.z = c
j.x = k
h.y = m
h.x = j
h.o = j
h.s = g
a.y = m
a.x = j
a.o = j
a.s = k
k.z = m
k.y = m
k.p = g
k.t = l
i.y = m
i.x = j
i.o = j
i.s = k
l.y = m
l.x = j
l.o = j
l.s = g
assert g.p.p.y.x.p.z.txt == "m"