class A:
    def __init__(self, txt: str):
        self.x: G = None
        self.o: D = None
        self.v: C = None
        self.q: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.x: G = None
        self.r: I = None
        self.v: H = None
        self.w: A = None
        self.o: B = None
        self.t: F = None
        self.u: B = None
        self.q: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.x: E = None
        self.o: C = None
        self.s: H = None
        self.r: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: G = None
        self.p: H = None
        self.s: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: C = None
        self.p: A = None
        self.u: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: B = None
        self.q: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: G = None
        self.y: D = None
        self.t: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: H = None
        self.v: F = None
        self.u: C = None
        self.y: E = None
        self.x: H = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.x: G = None
        self.r: I = None
        self.v: H = None
        self.w: A = None
        self.o: B = None
        self.t: F = None
        self.u: B = None
        self.q: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.x: E = None
        self.o: C = None
        self.s: H = None
        self.r: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: G = None
        self.p: H = None
        self.s: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: C = None
        self.p: A = None
        self.u: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: B = None
        self.q: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: G = None
        self.y: D = None
        self.t: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: H = None
        self.v: F = None
        self.u: C = None
        self.y: E = None
        self.x: H = None
        self.txt = txt

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

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