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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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