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

class B:
    def __init__(self, txt: str):
        self.p: G = None
        self.r: F = None
        self.x: E = None
        self.w: B = None
        self.v: E = None
        self.o: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.v: A = None
        self.z: E = None
        self.q: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.x: A = None
        self.s: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: F = None
        self.w: F = None
        self.r: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: G = None
        self.r: F = None
        self.x: E = None
        self.w: B = None
        self.v: E = None
        self.o: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.v: A = None
        self.z: E = None
        self.q: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.x: A = None
        self.s: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: F = None
        self.w: F = None
        self.r: D = None
        self.txt = txt

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

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