class A:
    def __init__(self, txt: str):
        self.q: G = None
        self.u: G = None
        self.z: B = None
        self.o: E = None
        self.r: B = None
        self.t: F = None
        self.w: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: G = None
        self.q: C = None
        self.v: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.q: H = None
        self.y: H = None
        self.t: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: G = None
        self.u: C = None
        self.s: D = None
        self.q: D = None
        self.x: C = None
        self.v: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: C = None
        self.y: D = None
        self.s: D = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: G = None
        self.q: C = None
        self.v: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.q: H = None
        self.y: H = None
        self.t: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: G = None
        self.u: C = None
        self.s: D = None
        self.q: D = None
        self.x: C = None
        self.v: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: C = None
        self.y: D = None
        self.s: D = None
        self.txt = txt

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

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

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