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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.p: B = None
        self.txt = txt

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

k.z = i
k.v = i
k.o = l
k.s = l
f.p = b
f.u = b
f.y = k
f.z = i
f.r = l
b.r = f
l.q = b
l.u = k
l.v = f
i.v = l
i.p = f
assert f.u.r.u.txt == "
class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.o: D = None
        self.s: D = None
        self.v: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.p: B = None
        self.txt = txt

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

k.z = i
k.v = i
k.o = l
k.s = l
f.p = b
f.u = b
f.y = k
f.z = i
f.r = l
b.r = f
l.q = b
l.u = k
l.v = f
i.v = l
i.p = f
assert f.u.r.u.txt == "b"