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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.w: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: E = None
        self.v: H = None
        self.w: C = None
        self.p: D = None
        self.r: B = None
        self.y: I = None
        self.q: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: I = None
        self.r: F = None
        self.y: C = None
        self.w: B = None
        self.x: A = None
        self.q: E = None
        self.txt = txt

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

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.w: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: E = None
        self.v: H = None
        self.w: C = None
        self.p: D = None
        self.r: B = None
        self.y: I = None
        self.q: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: I = None
        self.r: F = None
        self.y: C = None
        self.w: B = None
        self.x: A = None
        self.q: E = None
        self.txt = txt

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

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

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