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

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.o: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.x: G = None
        self.w: D = None
        self.y: E = None
        self.q: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.z: G = None
        self.t: A = None
        self.s: D = None
        self.u: E = None
        self.y: B = None
        self.v: A = None
        self.o: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: B = None
        self.r: C = None
        self.v: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.o: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.x: G = None
        self.w: D = None
        self.y: E = None
        self.q: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.z: G = None
        self.t: A = None
        self.s: D = None
        self.u: E = None
        self.y: B = None
        self.v: A = None
        self.o: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: B = None
        self.r: C = None
        self.v: A = None
        self.txt = txt

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

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