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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: I = None
        self.w: C = None
        self.z: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: G = None
        self.x: I = None
        self.t: C = None
        self.r: A = None
        self.z: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: F = None
        self.q: E = None
        self.v: F = None
        self.u: A = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: I = None
        self.w: C = None
        self.z: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: G = None
        self.x: I = None
        self.t: C = None
        self.r: A = None
        self.z: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: F = None
        self.q: E = None
        self.v: F = None
        self.u: A = None
        self.txt = txt

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

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