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

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

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

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

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

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

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

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

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

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

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