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

class B:
    def __init__(self, txt: str):
        self.s: D = None
        self.q: H = None
        self.r: E = None
        self.p: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: E = None
        self.p: G = None
        self.x: B = None
        self.r: A = None
        self.w: F = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: G = None
        self.v: E = None
        self.u: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.s: D = None
        self.q: H = None
        self.r: E = None
        self.p: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: E = None
        self.p: G = None
        self.x: B = None
        self.r: A = None
        self.w: F = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: G = None
        self.v: E = None
        self.u: G = None
        self.txt = txt

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

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