class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.o: H = None
        self.t: G = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.v: G = None
        self.u: C = None
        self.r: H = None
        self.x: E = None
        self.s: G = None
        self.t: E = None
        self.z: H = None
        self.o: D = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: H = None
        self.x: B = None
        self.u: B = None
        self.y: A = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.v: G = None
        self.u: C = None
        self.r: H = None
        self.x: E = None
        self.s: G = None
        self.t: E = None
        self.z: H = None
        self.o: D = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: H = None
        self.x: B = None
        self.u: B = None
        self.y: A = None
        self.txt = txt

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

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

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

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