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

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

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

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

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

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

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

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

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

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

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

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

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