class A:
    def __init__(self, txt: str):
        self.t: G = None
        self.u: H = None
        self.x: H = None
        self.o: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: H = None
        self.v: H = None
        self.w: F = None
        self.o: H = None
        self.t: B = None
        self.r: E = None
        self.y: F = None
        self.x: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.w: C = None
        self.p: H = None
        self.z: F = None
        self.v: C = None
        self.s: A = None
        self.u: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: E = None
        self.w: A = None
        self.t: F = None
        self.y: A = None
        self.x: B = None
        self.v: D = None
        self.q: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: E = None
        self.v: C = None
        self.x: C = None
        self.s: F = None
        self.o: E = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: H = None
        self.v: H = None
        self.w: F = None
        self.o: H = None
        self.t: B = None
        self.r: E = None
        self.y: F = None
        self.x: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.w: C = None
        self.p: H = None
        self.z: F = None
        self.v: C = None
        self.s: A = None
        self.u: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: E = None
        self.w: A = None
        self.t: F = None
        self.y: A = None
        self.x: B = None
        self.v: D = None
        self.q: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: E = None
        self.v: C = None
        self.x: C = None
        self.s: F = None
        self.o: E = None
        self.txt = txt

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

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