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

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

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.z: A = None
        self.y: E = None
        self.q: B = None
        self.x: C = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.y: E = None
        self.s: C = None
        self.r: D = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.p: D = None
        self.t: B = None
        self.z: B = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.z: A = None
        self.y: E = None
        self.q: B = None
        self.x: C = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.y: E = None
        self.s: C = None
        self.r: D = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.p: D = None
        self.t: B = None
        self.z: B = None
        self.txt = txt

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

g.p = e
d.s = g
d.r = g
d.z = c
k.s = d
k.q = d
k.z = l
k.y = h
k.x = j
c.z = g
c.y = h
c.s = j
c.r = m
h.w = j
h.p = m
h.t = d
h.z = e
m.z = l
m.y = h
m.s = k
m.r = c
e.s = g
e.r = l
e.z = c
l.p = e
i.w = j
i.p = c
i.t = d
i.z = d
j.s = e
j.q = e
j.z = l
j.y = i
j.x = k
assert h.p.r.s.s.r.p.s.p.r.txt == "l"