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

class B:
    def __init__(self, txt: str):
        self.o: E = None
        self.t: C = None
        self.s: D = None
        self.u: E = None
        self.z: E = None
        self.txt = txt

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

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

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

k = A("k")
n = B("n")
d = C("d")
h = D("h")
b = E("b")
g = A("g")

k.s = h
k.v = b
k.r = b
k.z = g
n.o = b
n.u = b
n.z = b
n.t = d
n.s = h
d.v = n
d.w = b
d.z = b
d.o = g
d.q = k
h.s = b
b.r = k
b.q = d
g.s = h
g.v = b
g.r = b
g.z = k
assert d.q.z.r.r.v.r.txt == "
class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.v: E = None
        self.z: A = None
        self.r: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: E = None
        self.t: C = None
        self.s: D = None
        self.u: E = None
        self.z: E = None
        self.txt = txt

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

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

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

k = A("k")
n = B("n")
d = C("d")
h = D("h")
b = E("b")
g = A("g")

k.s = h
k.v = b
k.r = b
k.z = g
n.o = b
n.u = b
n.z = b
n.t = d
n.s = h
d.v = n
d.w = b
d.z = b
d.o = g
d.q = k
h.s = b
b.r = k
b.q = d
g.s = h
g.v = b
g.r = b
g.z = k
assert d.q.z.r.r.v.r.txt == "k"