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

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

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

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

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

k = A("k")
b = B("b")
i = C("i")
j = D("j")
a = E("a")

k.y = a
k.s = i
k.p = i
k.o = j
k.t = j
b.t = j
i.x = j
i.v = j
i.o = j
i.y = b
i.u = b
j.s = b
j.x = b
j.u = b
j.v = i
a.s = j
a.r = b
a.o = k
assert b.t.v.u.t.txt == "
class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.s: C = None
        self.o: D = None
        self.p: C = None
        self.t: D = None
        self.txt = txt

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

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

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

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

k = A("k")
b = B("b")
i = C("i")
j = D("j")
a = E("a")

k.y = a
k.s = i
k.p = i
k.o = j
k.t = j
b.t = j
i.x = j
i.v = j
i.o = j
i.y = b
i.u = b
j.s = b
j.x = b
j.u = b
j.v = i
a.s = j
a.r = b
a.o = k
assert b.t.v.u.t.txt == "j"