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

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

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

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.t: C = None
        self.s: E = None
        self.v: B = None
        self.x: F = None
        self.u: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.x: F = None
        self.v: B = None
        self.o: D = None
        self.p: A = None
        self.t: F = None
        self.txt = txt

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

m = A("m")
b = B("b")
e = C("e")
f = D("f")
g = E("g")
k = F("k")

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

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

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

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.t: C = None
        self.s: E = None
        self.v: B = None
        self.x: F = None
        self.u: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.x: F = None
        self.v: B = None
        self.o: D = None
        self.p: A = None
        self.t: F = None
        self.txt = txt

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

m = A("m")
b = B("b")
e = C("e")
f = D("f")
g = E("g")
k = F("k")

m.y = e
m.z = b
m.u = b
m.o = f
b.r = m
b.u = m
b.p = m
b.w = e
b.q = f
e.q = k
e.z = m
f.p = g
f.s = g
f.u = g
f.t = e
f.v = b
f.x = k
g.w = m
g.p = m
g.x = k
g.t = k
g.v = b
g.o = f
k.u = g
k.v = f
k.t = m
assert m.o.v.q.t.txt == "e"