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

class B:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.q: D = None
        self.u: F = None
        self.o: F = None
        self.t: F = None
        self.r: A = None
        self.txt = txt

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

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

m = A("m")
n = B("n")
f = C("f")
g = D("g")
j = E("j")
b = F("b")
i = G("i")

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

class B:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.q: D = None
        self.u: F = None
        self.o: F = None
        self.t: F = None
        self.r: A = None
        self.txt = txt

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

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

m = A("m")
n = B("n")
f = C("f")
g = D("g")
j = E("j")
b = F("b")
i = G("i")

m.r = f
m.t = n
m.o = n
m.w = g
m.v = g
m.z = j
n.u = i
f.o = m
g.y = f
j.z = m
j.r = m
j.q = g
j.u = b
j.o = b
j.t = b
b.s = i
i.z = m
i.u = j
assert i.z.z.t.s.txt == "i"