class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.p: D = None
        self.q: B = None
        self.y: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.w: A = None
        self.p: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.r: E = None
        self.u: E = None
        self.o: B = None
        self.s: C = None
        self.txt = txt

g = A("g")
b = B("b")
n = C("n")
m = D("m")
e = E("e")
l = F("l")
i = C("i")

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

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.w: A = None
        self.p: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.r: E = None
        self.u: E = None
        self.o: B = None
        self.s: C = None
        self.txt = txt

g = A("g")
b = B("b")
n = C("n")
m = D("m")
e = E("e")
l = F("l")
i = C("i")

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