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

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

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

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

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

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

j.x = f
j.s = f
j.o = h
j.t = h
j.y = b
h.s = n
n.x = l
n.y = l
n.o = j
n.t = f
n.p = i
l.z = j
l.s = n
l.p = n
l.o = h
l.w = d
b.y = l
i.y = d
d.z = f
d.s = n
d.p = n
d.o = h
d.w = l
f.x = j
f.s = j
f.o = h
f.t = h
f.y = i
assert d.w.z.s.s.t.s.x.w.txt == "
class A:
    def __init__(self, txt: str):
        self.x: A = None
        self.s: A = None
        self.o: B = None
        self.y: E = None
        self.t: B = None
        self.txt = txt

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

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

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

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

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

j.x = f
j.s = f
j.o = h
j.t = h
j.y = b
h.s = n
n.x = l
n.y = l
n.o = j
n.t = f
n.p = i
l.z = j
l.s = n
l.p = n
l.o = h
l.w = d
b.y = l
i.y = d
d.z = f
d.s = n
d.p = n
d.o = h
d.w = l
f.x = j
f.s = j
f.o = h
f.t = h
f.y = i
assert d.w.z.s.s.t.s.x.w.txt == "d"