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

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

class C:
    def __init__(self, txt: str):
        self.q: F = None
        self.t: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: D = None
        self.o: D = None
        self.y: B = None
        self.t: B = None
        self.x: B = None
        self.q: D = None
        self.z: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: F = None
        self.t: D = None
        self.txt = txt

k = A("k")
b = B("b")
c = C("c")
m = D("m")
l = E("l")
h = F("h")
i = G("i")

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

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

class C:
    def __init__(self, txt: str):
        self.q: F = None
        self.t: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: D = None
        self.o: D = None
        self.y: B = None
        self.t: B = None
        self.x: B = None
        self.q: D = None
        self.z: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: F = None
        self.t: D = None
        self.txt = txt

k = A("k")
b = B("b")
c = C("c")
m = D("m")
l = E("l")
h = F("h")
i = G("i")

k.v = c
k.z = b
b.z = c
b.o = k
b.y = h
b.u = m
b.w = l
c.q = h
c.t = h
m.q = c
m.z = c
m.v = c
l.v = i
h.r = m
h.o = m
h.q = m
h.y = b
h.t = b
h.x = b
h.z = k
i.r = h
i.t = m
assert k.v.t.y.z.txt == "c"