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

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.r: A = None
        self.y: C = None
        self.w: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.v: C = None
        self.y: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

k = A("k")
m = B("m")
d = C("d")
i = D("i")
a = E("a")
g = F("g")

k.o = d
k.v = m
k.z = m
m.t = a
m.w = a
m.r = k
m.y = d
d.z = m
i.w = g
i.u = m
i.z = m
i.x = m
i.y = d
i.q = a
a.s = d
a.v = d
a.y = g
g.w = k
assert i.y.z.y.txt == "
class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.v: B = None
        self.z: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.r: A = None
        self.y: C = None
        self.w: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.v: C = None
        self.y: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

k = A("k")
m = B("m")
d = C("d")
i = D("i")
a = E("a")
g = F("g")

k.o = d
k.v = m
k.z = m
m.t = a
m.w = a
m.r = k
m.y = d
d.z = m
i.w = g
i.u = m
i.z = m
i.x = m
i.y = d
i.q = a
a.s = d
a.v = d
a.y = g
g.w = k
assert i.y.z.y.txt == "d"