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

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

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

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

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

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

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

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

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

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

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

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

e.u = h
e.o = k
b.s = l
b.t = j
b.q = j
k.z = b
k.s = b
k.w = e
k.r = h
l.o = n
l.x = b
l.z = j
l.u = j
j.r = k
j.w = e
j.y = h
h.u = e
h.o = n
n.z = b
n.s = b
n.w = e
n.r = e
assert l.z.y.u.o.s.t.txt == "j"