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

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

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

class D:
    def __init__(self, txt: str):
        self.u: I = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: I = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: A = None
        self.x: A = None
        self.z: E = None
        self.u: A = None
        self.w: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: E = None
        self.q: C = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.u: I = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: I = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: A = None
        self.x: A = None
        self.z: E = None
        self.u: A = None
        self.w: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: E = None
        self.q: C = None
        self.txt = txt

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

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