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

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

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

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

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

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

e = A("e")
m = B("m")
a = C("a")
b = D("b")
f = E("f")
i = F("i")

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

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

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

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

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

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

e = A("e")
m = B("m")
a = C("a")
b = D("b")
f = E("f")
i = F("i")

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