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

class B:
    def __init__(self, txt: str):
        self.q: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.o: G = None
        self.u: D = None
        self.y: G = None
        self.t: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.v: A = None
        self.s: F = None
        self.y: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: H = None
        self.t: H = None
        self.r: A = None
        self.o: H = None
        self.s: H = None
        self.q: H = None
        self.v: H = None
        self.w: C = None
        self.x: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: F = None
        self.s: F = None
        self.z: E = None
        self.o: D = None
        self.u: I = None
        self.v: G = None
        self.y: G = None
        self.t: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: D = None
        self.p: B = None
        self.t: E = None
        self.w: B = None
        self.y: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.o: G = None
        self.u: D = None
        self.y: G = None
        self.t: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.v: A = None
        self.s: F = None
        self.y: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: H = None
        self.t: H = None
        self.r: A = None
        self.o: H = None
        self.s: H = None
        self.q: H = None
        self.v: H = None
        self.w: C = None
        self.x: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: F = None
        self.s: F = None
        self.z: E = None
        self.o: D = None
        self.u: I = None
        self.v: G = None
        self.y: G = None
        self.t: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: D = None
        self.p: B = None
        self.t: E = None
        self.w: B = None
        self.y: B = None
        self.txt = txt

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

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