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

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.v: E = None
        self.t: A = None
        self.w: E = None
        self.s: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: F = None
        self.u: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: H = None
        self.v: F = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.v: E = None
        self.t: A = None
        self.w: E = None
        self.s: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: F = None
        self.u: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: H = None
        self.v: F = None
        self.txt = txt

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

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

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

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

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