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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.r: E = None
        self.y: F = None
        self.v: D = None
        self.w: F = None
        self.z: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: B = None
        self.p: B = None
        self.r: B = None
        self.z: B = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.r: E = None
        self.y: F = None
        self.v: D = None
        self.w: F = None
        self.z: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: B = None
        self.p: B = None
        self.r: B = None
        self.z: B = None
        self.txt = txt

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

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