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

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

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

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.w: C = None
        self.s: E = None
        self.u: A = None
        self.txt = txt

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

e = A("e")
k = B("k")
l = C("l")
n = D("n")
h = E("h")
j = E("j")
a = C("a")

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

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

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

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.w: C = None
        self.s: E = None
        self.u: A = None
        self.txt = txt

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

e = A("e")
k = B("k")
l = C("l")
n = D("n")
h = E("h")
j = E("j")
a = C("a")

e.x = a
e.q = h
e.t = n
k.w = e
k.s = j
k.v = l
l.y = k
l.t = n
l.x = a
n.o = j
n.s = j
n.w = a
n.u = e
h.w = e
j.w = e
a.y = k
a.t = n
a.x = l
assert l.t.s.w.t.txt == "n"