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

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

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

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

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

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

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

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

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

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

h.p = g
h.o = a
h.y = b
n.p = l
n.s = h
n.o = e
a.w = e
a.y = e
a.s = b
d.z = b
d.s = b
d.x = l
d.p = e
e.p = g
e.s = h
e.o = n
j.z = a
j.x = l
j.p = n
j.s = b
i.p = g
i.o = b
i.y = b
l.z = b
l.x = g
l.p = e
l.s = a
b.w = e
b.y = e
b.s = a
g.z = a
g.s = a
g.x = j
g.p = n
assert d.x.z.y.s.o.w.txt == "e"