class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.z: G = None
        self.s: D = None
        self.v: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.t: G = None
        self.x: E = None
        self.p: G = None
        self.r: G = None
        self.y: E = None
        self.o: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.u: F = None
        self.w: C = None
        self.t: F = None
        self.q: F = None
        self.y: D = None
        self.z: F = None
        self.p: D = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.t: G = None
        self.x: E = None
        self.p: G = None
        self.r: G = None
        self.y: E = None
        self.o: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.u: F = None
        self.w: C = None
        self.t: F = None
        self.q: F = None
        self.y: D = None
        self.z: F = None
        self.p: D = None
        self.txt = txt

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

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