class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.v: B = None
        self.x: B = None
        self.q: E = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

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

i.z = m
i.v = c
i.x = c
i.q = f
c.v = m
c.s = m
c.o = k
c.r = f
k.z = m
k.u = f
k.q = f
k.x = c
k.p = i
m.r = i
f.v = i
f.u = k
assert c.o.x.r.v.txt == "i"