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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

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

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