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

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.y: D = None
        self.t: E = None
        self.v: C = None
        self.q: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: D = None
        self.q: C = None
        self.v: A = None
        self.u: E = None
        self.t: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.r: A = None
        self.t: C = None
        self.w: B = None
        self.x: A = None
        self.txt = txt

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

k = A("k")
e = B("e")
l = C("l")
n = D("n")
a = E("a")
f = E("f")
h = A("h")
b = A("b")
c = A("c")
d = C("d")

k.x = f
k.o = l
e.w = h
e.y = n
e.t = a
e.q = a
e.v = l
l.x = n
l.q = d
l.v = h
l.u = f
l.t = b
n.q = l
n.t = l
n.r = h
n.w = e
n.x = b
a.s = e
f.s = e
h.x = a
h.o = l
b.x = f
b.o = l
c.x = a
c.o = l
d.x = n
d.q = l
d.v = h
d.u = f
d.t = k
assert f.s.t.s.y.t.u.s.txt == "
class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.o: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.y: D = None
        self.t: E = None
        self.v: C = None
        self.q: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: D = None
        self.q: C = None
        self.v: A = None
        self.u: E = None
        self.t: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.r: A = None
        self.t: C = None
        self.w: B = None
        self.x: A = None
        self.txt = txt

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

k = A("k")
e = B("e")
l = C("l")
n = D("n")
a = E("a")
f = E("f")
h = A("h")
b = A("b")
c = A("c")
d = C("d")

k.x = f
k.o = l
e.w = h
e.y = n
e.t = a
e.q = a
e.v = l
l.x = n
l.q = d
l.v = h
l.u = f
l.t = b
n.q = l
n.t = l
n.r = h
n.w = e
n.x = b
a.s = e
f.s = e
h.x = a
h.o = l
b.x = f
b.o = l
c.x = a
c.o = l
d.x = n
d.q = l
d.v = h
d.u = f
d.t = k
assert f.s.t.s.y.t.u.s.txt == "e"