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

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

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

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

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

j = A("j")
e = B("e")
k = C("k")
d = D("d")
f = E("f")
c = E("c")

j.u = k
j.r = c
j.z = f
j.x = e
e.r = d
e.w = c
k.p = d
k.o = d
k.q = f
d.s = c
d.z = f
f.z = k
f.q = k
f.v = c
c.z = k
c.q = k
c.v = f
assert k.o.s.v.v.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.r: E = None
        self.z: E = None
        self.x: B = None
        self.txt = txt

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

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

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

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

j = A("j")
e = B("e")
k = C("k")
d = D("d")
f = E("f")
c = E("c")

j.u = k
j.r = c
j.z = f
j.x = e
e.r = d
e.w = c
k.p = d
k.o = d
k.q = f
d.s = c
d.z = f
f.z = k
f.q = k
f.v = c
c.z = k
c.q = k
c.v = f
assert k.o.s.v.v.txt == "c"