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

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: G = None
        self.y: D = None
        self.s: F = None
        self.t: B = None
        self.w: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: A = None
        self.u: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

m = A("m")
n = B("n")
l = C("l")
h = D("h")
e = E("e")
a = F("a")
b = G("b")

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

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: G = None
        self.y: D = None
        self.s: F = None
        self.t: B = None
        self.w: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: A = None
        self.u: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

m = A("m")
n = B("n")
l = C("l")
h = D("h")
e = E("e")
a = F("a")
b = G("b")

m.z = n
n.x = e
l.u = b
l.y = h
l.s = a
l.t = n
l.w = e
h.o = b
e.w = n
e.x = n
e.s = a
e.v = l
a.s = m
a.u = b
b.q = m
assert l.y.o.q.z.txt == "n"