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

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

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

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

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

b = A("b")
e = B("e")
g = C("g")
i = D("i")
k = E("k")

b.q = k
b.s = k
b.y = g
b.x = e
b.t = i
e.o = k
g.u = e
g.p = i
g.o = i
i.q = b
i.y = b
i.r = b
i.p = e
i.w = g
k.u = b
k.y = b
k.r = i
k.t = e
k.p = e
assert i.r.q.r.txt == "
class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.s: E = None
        self.y: C = None
        self.x: B = None
        self.t: D = None
        self.txt = txt

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

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

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

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

b = A("b")
e = B("e")
g = C("g")
i = D("i")
k = E("k")

b.q = k
b.s = k
b.y = g
b.x = e
b.t = i
e.o = k
g.u = e
g.p = i
g.o = i
i.q = b
i.y = b
i.r = b
i.p = e
i.w = g
k.u = b
k.y = b
k.r = i
k.t = e
k.p = e
assert i.r.q.r.txt == "i"