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

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

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

class D:
    def __init__(self, txt: str):
        self.r: H = None
        self.p: G = None
        self.t: A = None
        self.u: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.v: D = None
        self.u: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: H = None
        self.x: H = None
        self.s: B = None
        self.r: I = None
        self.o: B = None
        self.z: I = None
        self.u: I = None
        self.v: B = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.r: H = None
        self.p: G = None
        self.t: A = None
        self.u: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.v: D = None
        self.u: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: H = None
        self.x: H = None
        self.s: B = None
        self.r: I = None
        self.o: B = None
        self.z: I = None
        self.u: I = None
        self.v: B = None
        self.txt = txt

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

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

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