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

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

class C:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.w: C = None
        self.p: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.r: C = None
        self.y: F = None
        self.z: A = None
        self.p: H = None
        self.o: H = None
        self.s: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: H = None
        self.t: D = None
        self.s: A = None
        self.u: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: E = None
        self.v: A = None
        self.q: A = None
        self.p: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: D = None
        self.r: A = None
        self.s: C = None
        self.o: F = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.w: C = None
        self.p: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.r: C = None
        self.y: F = None
        self.z: A = None
        self.p: H = None
        self.o: H = None
        self.s: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: H = None
        self.t: D = None
        self.s: A = None
        self.u: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: E = None
        self.v: A = None
        self.q: A = None
        self.p: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: D = None
        self.r: A = None
        self.s: C = None
        self.o: F = None
        self.txt = txt

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

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