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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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