class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.s: G = None
        self.q: F = None
        self.z: G = None
        self.o: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.x: F = None
        self.r: E = None
        self.q: I = None
        self.z: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.u: A = None
        self.w: E = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.x: F = None
        self.r: E = None
        self.q: I = None
        self.z: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.u: A = None
        self.w: E = None
        self.txt = txt

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

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

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

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