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

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

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

class D:
    def __init__(self, txt: str):
        self.v: A = None
        self.s: A = None
        self.q: G = None
        self.u: E = None
        self.z: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: H = None
        self.w: B = None
        self.x: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.v: E = None
        self.t: G = None
        self.w: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: H = None
        self.z: C = None
        self.y: E = None
        self.p: C = None
        self.r: I = None
        self.w: F = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.v: A = None
        self.s: A = None
        self.q: G = None
        self.u: E = None
        self.z: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: H = None
        self.w: B = None
        self.x: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.v: E = None
        self.t: G = None
        self.w: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: H = None
        self.z: C = None
        self.y: E = None
        self.p: C = None
        self.r: I = None
        self.w: F = None
        self.txt = txt

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

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

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

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