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

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

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

class D:
    def __init__(self, txt: str):
        self.t: G = None
        self.w: D = None
        self.u: F = None
        self.z: H = None
        self.s: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.p: D = None
        self.x: E = None
        self.txt = txt

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

g = A("g")
b = B("b")
j = C("j")
f = D("f")
l = E("l")
h = F("h")
k = G("k")
m = H("m")
n = D("n")
a = F("a")

g.s = m
g.r = m
g.q = m
b.p = h
b.v = f
b.r = g
b.q = g
b.s = k
j.u = k
f.t = k
f.w = n
f.u = a
f.z = m
f.s = b
l.q = n
l.x = j
l.y = b
l.p = m
l.w = k
h.v = n
k.p = n
k.x = l
m.u = l
m.q = j
m.y = h
n.t = k
n.w = f
n.u = h
n.z = m
n.s = b
a.v = f
assert l.w.p.s.r.q.y.txt == "
class A:
    def __init__(self, txt: str):
        self.s: H = None
        self.r: H = None
        self.q: H = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.t: G = None
        self.w: D = None
        self.u: F = None
        self.z: H = None
        self.s: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.p: D = None
        self.x: E = None
        self.txt = txt

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

g = A("g")
b = B("b")
j = C("j")
f = D("f")
l = E("l")
h = F("h")
k = G("k")
m = H("m")
n = D("n")
a = F("a")

g.s = m
g.r = m
g.q = m
b.p = h
b.v = f
b.r = g
b.q = g
b.s = k
j.u = k
f.t = k
f.w = n
f.u = a
f.z = m
f.s = b
l.q = n
l.x = j
l.y = b
l.p = m
l.w = k
h.v = n
k.p = n
k.x = l
m.u = l
m.q = j
m.y = h
n.t = k
n.w = f
n.u = h
n.z = m
n.s = b
a.v = f
assert l.w.p.s.r.q.y.txt == "h"