class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.o: C = None
        self.p: G = None
        self.q: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: G = None
        self.y: A = None
        self.r: G = None
        self.v: F = None
        self.o: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.r: C = None
        self.q: B = None
        self.u: D = None
        self.y: A = None
        self.txt = txt

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

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

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

f.z = n
f.o = j
f.p = g
f.q = g
b.o = j
b.t = j
b.z = d
b.u = n
j.s = g
j.r = g
j.y = f
j.v = n
j.o = n
m.y = f
m.t = g
m.s = g
d.x = j
d.r = j
d.q = b
d.u = m
d.y = f
n.z = g
n.v = d
g.q = f
g.w = n
g.p = m
assert m.t.p.y.o.v.txt == "
class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.o: C = None
        self.p: G = None
        self.q: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: G = None
        self.y: A = None
        self.r: G = None
        self.v: F = None
        self.o: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.r: C = None
        self.q: B = None
        self.u: D = None
        self.y: A = None
        self.txt = txt

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

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

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

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