class A:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.v: D = None
        self.o: F = None
        self.s: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: H = None
        self.z: A = None
        self.r: A = None
        self.y: D = None
        self.q: H = None
        self.txt = txt

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

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.v: D = None
        self.o: F = None
        self.s: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: H = None
        self.z: A = None
        self.r: A = None
        self.y: D = None
        self.q: H = None
        self.txt = txt

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

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

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

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

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

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

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