class A:
    def __init__(self, txt: str):
        self.z: G = None
        self.u: G = None
        self.p: C = None
        self.o: H = None
        self.y: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.x: F = None
        self.p: H = None
        self.r: D = None
        self.y: D = None
        self.t: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.t: H = None
        self.p: B = None
        self.q: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.z: D = None
        self.v: A = None
        self.r: H = None
        self.o: D = None
        self.q: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: B = None
        self.s: G = None
        self.y: B = None
        self.q: A = None
        self.r: C = None
        self.p: G = None
        self.v: H = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.x: F = None
        self.p: H = None
        self.r: D = None
        self.y: D = None
        self.t: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.t: H = None
        self.p: B = None
        self.q: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.z: D = None
        self.v: A = None
        self.r: H = None
        self.o: D = None
        self.q: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: B = None
        self.s: G = None
        self.y: B = None
        self.q: A = None
        self.r: C = None
        self.p: G = None
        self.v: H = None
        self.txt = txt

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

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

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

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