class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: H = None
        self.t: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: I = None
        self.u: D = None
        self.x: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.r: B = None
        self.t: A = None
        self.w: B = None
        self.z: A = None
        self.v: I = None
        self.q: F = None
        self.x: F = None
        self.s: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.p: B = None
        self.r: B = None
        self.o: C = None
        self.q: D = None
        self.v: F = None
        self.z: C = None
        self.x: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: H = None
        self.t: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: I = None
        self.u: D = None
        self.x: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.r: B = None
        self.t: A = None
        self.w: B = None
        self.z: A = None
        self.v: I = None
        self.q: F = None
        self.x: F = None
        self.s: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.p: B = None
        self.r: B = None
        self.o: C = None
        self.q: D = None
        self.v: F = None
        self.z: C = None
        self.x: B = None
        self.txt = txt

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

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