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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

k = A("k")
i = B("i")
c = C("c")
b = D("b")
l = E("l")
f = C("f")

k.s = f
k.x = i
i.t = f
i.y = f
i.o = k
i.x = k
i.r = l
c.q = k
c.o = k
c.s = l
b.z = i
b.s = i
b.t = k
b.x = k
l.z = b
f.q = k
f.o = k
f.s = l
assert b.z.y.q.x.o.x.txt == "
class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.x: B = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

k = A("k")
i = B("i")
c = C("c")
b = D("b")
l = E("l")
f = C("f")

k.s = f
k.x = i
i.t = f
i.y = f
i.o = k
i.x = k
i.r = l
c.q = k
c.o = k
c.s = l
b.z = i
b.s = i
b.t = k
b.x = k
l.z = b
f.q = k
f.o = k
f.s = l
assert b.z.y.q.x.o.x.txt == "i"